Is it possible to upgrade virtual machine hardware from version 4 to 7 in PowerShell?
Thanks,
Gregor
I created a script that will upgrade all your templates to the new hardware level see: http://ict-freak.nl/2009/06/27/powercli-upgrading-vhardware-to-vsphere-part-1-templates.
The next step is to capture the VM's ip-address, upgrade the vHardware and put the ip-address back to the VM. This step is a little bit harder but I hope to found it soon ;-).
Keep an eye on this blog, he will be releasing the script which does this over the next couple of days I believe....
If you found this information useful, please consider awarding points for Correct or Helpful.
Alan Renouf
Try
Get-VM yourvm | Get-View | % { $_.UpgradeVM($null) }
I created a script that will upgrade all your templates to the new hardware level see: http://ict-freak.nl/2009/06/27/powercli-upgrading-vhardware-to-vsphere-part-1-templates.
The next step is to capture the VM's ip-address, upgrade the vHardware and put the ip-address back to the VM. This step is a little bit harder but I hope to found it soon ;-).
You can find part 2 here: http://ict-freak.nl/2009/07/15/powercli-upgrading-vhardware-to-vsphere-part-2-vms/
I am having a hard time upgrading the Virtual Hardware with this method.
Get-VM yourvm | Get-View | % { $_.UpgradeVM($null) }
Whether the VM is powered on or off I get a message in vCenter that the operation can not be performed in the current state.
Any thoughts, and also thoughts around the login and let drivers install part as well? Thanks to all in advance.
Hi,
I get different error
//
Is the VM powered on, like the error message seems to indicate ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD,
Thanks for the quick reply.
The VM is poweredOn.
Even PoweredOff status, the error message is slight different.
//
This works in my environment (ESXi 4.1):
Get-VM $vm | Get-View | % { $_.UpgradeVM("vmx-07") }
You'd think this would be a feature part of the Scheduled Task in vCenter.
If using vSphere 5 and vCenter (let's say the VM is called Fax Server):
UpgradeHW.ps1
---
Set-ExecutionPolicy RemoteSigned
Connect-VIServer yourvcenterservernamehere -User YourUserNamehere -Password YourPassWordhere
#Stop the VM
Get-VM "Fax Server" | Stop-VM -Confirm:$false
Start-Sleep -Seconds 120
#Upgrade the VM
Get-VM "Fax Server" | Get-View | % { $_.UpgradeVM("vmx-08") }
Start-Sleep -Seconds 120
#Power-up the upgraded VM
Start-VM -VM "Fax Server"
-----
Figure 2 minutes for it to shutdown then start upgrade, then within 2 minutes power it up. Try it out.
Put it in a bat file called UpgradeHW.bat
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSconsolefile "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -command C:\scripts\UpgradeHW.ps1
Have fun.