kitchen-hyperv 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/kitchen/driver/hyperv_version.rb +1 -1
- data/support/hyperv.ps1 +14 -14
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e34b84dd7e2463baa68a448fcad48faf91d99c55
|
|
4
|
+
data.tar.gz: 507d81b5c1fb7ea6faafa1c189121854b1870eb8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54b782a1a66f60716d700733144c016619cc5c027e807b1ca813325a1e2d7419226d4f4e8796f2ba61b08e4ee6a04cb0008491d1d8f34c7341e2649cac8e6c55
|
|
7
|
+
data.tar.gz: da830ca060e563b1c80fdba8d15ce29eb004a6bc8ac12cbd672344c0b81711185def65532bbff84fe345d3c5f2d836fae1fe675e279445b438b764b9e44206e0
|
data/CHANGELOG.md
CHANGED
data/support/hyperv.ps1
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#requires -Version 2 -Modules Hyper-V
|
|
2
2
|
|
|
3
3
|
#implicitly import hyperv module to avoid powercli cmdlets
|
|
4
|
-
if((Get-Module -Name
|
|
4
|
+
if((Get-Module -Name 'hyper-v') -ne $null)
|
|
5
5
|
{
|
|
6
|
-
Remove-Module -Name
|
|
7
|
-
Import-Module -Name
|
|
6
|
+
Remove-Module -Name hyper-v
|
|
7
|
+
Import-Module -Name hyper-v
|
|
8
8
|
}
|
|
9
9
|
else
|
|
10
10
|
{
|
|
11
|
-
Import-Module -Name
|
|
11
|
+
Import-Module -Name hyper-v
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
$ProgressPreference = 'SilentlyContinue'
|
|
@@ -84,7 +84,7 @@ function New-KitchenVM
|
|
|
84
84
|
else {
|
|
85
85
|
$vm | Set-VMMemory -DynamicMemoryEnabled $false
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
$vm | Start-Vm -passthru |
|
|
89
89
|
foreach {
|
|
90
90
|
$vm = $_
|
|
@@ -117,17 +117,17 @@ Function Set-VMNetworkConfiguration
|
|
|
117
117
|
)
|
|
118
118
|
|
|
119
119
|
$vm = Get-WmiObject -Namespace 'root\virtualization\v2' -Class 'Msvm_ComputerSystem' | Where-Object {
|
|
120
|
-
$_.ElementName -eq $NetworkAdapter.VMName
|
|
120
|
+
$_.ElementName -eq $NetworkAdapter.VMName
|
|
121
121
|
}
|
|
122
122
|
$VMSettings = $vm.GetRelated('Msvm_VirtualSystemSettingData') | Where-Object {
|
|
123
|
-
$_.VirtualSystemType -eq 'Microsoft:Hyper-V:System:Realized'
|
|
123
|
+
$_.VirtualSystemType -eq 'Microsoft:Hyper-V:System:Realized'
|
|
124
124
|
}
|
|
125
125
|
$VMNetAdapters = $VMSettings.GetRelated('Msvm_SyntheticEthernetPortSettingData')
|
|
126
126
|
|
|
127
127
|
$NetworkSettings = @()
|
|
128
|
-
foreach ($NetAdapter in $VMNetAdapters)
|
|
128
|
+
foreach ($NetAdapter in $VMNetAdapters)
|
|
129
129
|
{
|
|
130
|
-
if ($NetAdapter.Address -eq $NetworkAdapter.MacAddress)
|
|
130
|
+
if ($NetAdapter.Address -eq $NetworkAdapter.MacAddress)
|
|
131
131
|
{
|
|
132
132
|
$NetworkSettings = $NetworkSettings + $NetAdapter.GetRelated('Msvm_GuestNetworkAdapterConfiguration')
|
|
133
133
|
}
|
|
@@ -142,17 +142,17 @@ Function Set-VMNetworkConfiguration
|
|
|
142
142
|
$Service = Get-WmiObject -Class 'Msvm_VirtualSystemManagementService' -Namespace 'root\virtualization\v2'
|
|
143
143
|
$setIP = $Service.SetGuestNetworkAdapterConfiguration($vm, $NetworkSettings[0].GetText(1))
|
|
144
144
|
|
|
145
|
-
if ($setIP.ReturnValue -eq 4096)
|
|
145
|
+
if ($setIP.ReturnValue -eq 4096)
|
|
146
146
|
{
|
|
147
147
|
$job = [WMI]$setIP.job
|
|
148
148
|
|
|
149
|
-
while ($job.JobState -eq 3 -or $job.JobState -eq 4)
|
|
149
|
+
while ($job.JobState -eq 3 -or $job.JobState -eq 4)
|
|
150
150
|
{
|
|
151
151
|
Start-Sleep 1
|
|
152
152
|
$job = [WMI]$setIP.job
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
if ($job.JobState -ne 7)
|
|
155
|
+
if ($job.JobState -ne 7)
|
|
156
156
|
{
|
|
157
157
|
$job.GetError()
|
|
158
158
|
}
|
|
@@ -168,7 +168,7 @@ function Get-VmDetail
|
|
|
168
168
|
Get-VM -Id $Id |
|
|
169
169
|
ForEach-Object {
|
|
170
170
|
$vm = $_
|
|
171
|
-
do
|
|
171
|
+
do
|
|
172
172
|
{
|
|
173
173
|
Start-Sleep -Seconds 1
|
|
174
174
|
}
|
|
@@ -189,7 +189,7 @@ function Get-DefaultVMSwitch
|
|
|
189
189
|
Select-Object Name, Id
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
function Mount-VMISO
|
|
192
|
+
function Mount-VMISO
|
|
193
193
|
{
|
|
194
194
|
[cmdletbinding()]
|
|
195
195
|
param($Id, $Path)
|