Vmware虚拟机通过PowerCLI从一台主机移动到另一台主机



嗨,我们有6个Vsphere服务器,我的Vcenter是基于Linux的,版本是Vsphere 5.5。

我们正在尝试通过PowerCLI脚本自动管理VMware环境。

我在网上得到了一个脚本,但出现了错误。感谢Lucd和Kunaludapi。

需要一些帮助。

Move-VM : Cannot convert 'System.Object[]' to the type 'VMware.VimAutomation.Vi
Core.Types.V1.Inventory.VIContainer' required by parameter 'Destination'. Speci
fied method is not supported.
At C:Scheduled tasksVmware DRS Script.ps1:103 char:53
+                        $objVM | move-vm -destination <<<<  (get-vmhost $strDe
st);
    + CategoryInfo          : InvalidArgument: (:) [Move-VM], ParameterBinding
   Exception
    + FullyQualifiedErrorId : CannotConvertArgument,VMware.VimAutomation.ViCor
   e.Cmdlets.Commands.MoveVM

谷歌是你的朋友

http://kc-tek.blogspot.co.nz/2012/06/vmotion-vms-from-one-given-host-to.html

As always when using PowerCLI you have to connect to your vCentre server
Connect-VIserver SeverName
Issue the command to 'get' the VMs from the host you want to move them off and then 'move' them to the target host.
Get-VM -Location "HostName" | Move-VM -Destination (Get-Vmhost "NewHost")

相关内容

  • 没有找到相关文章

最新更新