首页 > 代码库 > Powercli 批量配置虚拟机cpu/memory/disk/network
Powercli 批量配置虚拟机cpu/memory/disk/network
Add-PSSnapin *vmware* $passwd = Read-Host "input your vcenter password: " -AsSecureString Connect-VIServer -Server 10.10.10.10 -User administrator@vsphere.local -Password $passwd $vms = Import-CSV E:\NewVMs.csv foreach ($vm in $vms){ $cpu = $vm.NumCPU $mem = $vm.MemoryGB $disk = $vm.DiskGB $note = $vm.Description $network = $vm.NetworkName get-vm -Name $vm.Name | Set-VM -NumCpu $cpu -MemoryGB $mem -Notes $note -RunAsync } $vms = Import-CSV E:\NewVMs.csv foreach ($vm in $vms){ $disk = $vm.DiskGB Get-VM -Name $vm.Name | Get-HardDisk | Set-HardDisk -CapacityGB $disk } $vms = Import-CSV E:\NewVMs.csv foreach ($vm in $vms){ $net = $vm.NetworkName Get-VM -Name $vm.Name | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName $net -RunAsync }
本文出自 “汜水流年_” 博客,请务必保留此出处http://timefiles.blog.51cto.com/8475652/1886931
Powercli 批量配置虚拟机cpu/memory/disk/network
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。