Friday 19 August 2016

Reset System Configuration using powercli

From quite a few months I am using Ravello Systems cloud infrastructure for my lab testing purpose and it was very painful for me whenever I wanted to test a feature or solution I have to deploy a new ESXi every time.
To ease that task I have come with the idea of writing a script, after dedicating few here is my cup of tea you could use along with the snippet.

$vmhost="esxi01vsan62-srm-xbdx487y.srv.ravcloud.com"
set-vmhost $vmhost -state maintenance
Connect-VIServer $vmhost -username root -password VMw@re1
$esxhost = Get-VMHost $vmhost
$hostview = $esxhost | Get-View
$ns = Get-View -Id $hostview.ConfigManager.firmwareSystem
$ns.ResetFirmwareToFactoryDefaults()









No comments:

Post a Comment