From be75702f35d2ec9bf42f58015efa61b1772c21bb Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Sat, 9 Aug 2014 10:30:10 -0700 Subject: [PATCH] fixes import for hyper-v generation 2 VMs --- plugins/providers/hyperv/scripts/import_vm.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/providers/hyperv/scripts/import_vm.ps1 b/plugins/providers/hyperv/scripts/import_vm.ps1 index e52870af0..0b1d74a7e 100644 --- a/plugins/providers/hyperv/scripts/import_vm.ps1 +++ b/plugins/providers/hyperv/scripts/import_vm.ps1 @@ -15,6 +15,7 @@ $Dir = Split-Path $script:MyInvocation.MyCommand.Path $vm_name = $vmconfig.configuration.properties.name.'#text' $processors = $vmconfig.configuration.settings.processors.count.'#text' +$generation = [int]($vmconfig.configuration.properties.subtype.'#text')+1 function GetUniqueName($name) { Get-VM | ForEach-Object -Process { @@ -61,6 +62,7 @@ Switch ((Select-Xml -xml $vmconfig -XPath "//boot").node.device0."#text") { $vm_params = @{ Name = $vm_name + Generation = $generation NoVHD = $True MemoryStartupBytes = $MemoryStartupBytes SwitchName = $switchname