标签:虚拟机 powershell hpyer-v
#宿主机为Server2012R2,基于母盘创建差异虚拟磁盘,二代虚拟机,动态内存。创建多台虚拟机请修改VMName后重复执行
$VMName = "s11"
$ParentVMPath = "D:"
$ParentVHDPath = "C:\VM\MotherVHD.vhdx"
$VmPath = $ParentVMPath + "\$VMName"
$VMVHDPath = $VmPath + "\Virtual Hard Disks"
New-Item $VMVHDPath -ItemType directory
New-VHD -ParentPath $ParentVHDPath -Path "$VMVHDPath\$VMName.vhdx" -Differencing
New-VM -Name "$VMName" -MemoryStartupBytes 3GB -Generation 2 -VHDPath "$VMVHDPath\$VMName.vhdx" -SwitchName "int88" -Path "$ParentVMPath"
Set-VM -Name $VMName -DynamicMemory -MemoryMinimumBytes 512MB -MemoryMaximumBytes 6GB -ProcessorCount 4
Add-VMDvdDrive -VMName $VMName
本文出自 “fymint” 博客,请务必保留此出处http://fymint.blog.51cto.com/10204722/1660362
标签:虚拟机 powershell hpyer-v
原文地址:http://fymint.blog.51cto.com/10204722/1660362