04-17-2025 05:41 AM
We made a script to deploy new ESXi servers. (in powershell)
It creates a profile from a template and connects a server to it.
Then we set the correct files to make it http boot and install ESXi.
But I cannot find the command to reboot the server to start the installation process.
"Set-IntersightComputeServerSetting -AdminPowerState Reboot " looked promising but that does not reboot the server but reboots the managament controller.
Anybody have any ideas.
Solved! Go to Solution.
04-22-2025 06:04 AM
Hello @arnold-romeijn
I just played around with the commands and it's correct that "-AdminPowerState Reboot" only reboots the controller.
But depending on how rough you want to be. HardReset and PowerCycle reboots the server.
I did the following.
#Collects the server profile
$ServerProfile = Get-IntersightServerProfile -Name "PROFILENAME"
#Collects Computeblade associated with the server profile
$ComputeBlade = Get-IntersightComputeBlade -Moid $ServerProfile.AssignedServer.ActualInstance.Moid
#Gets the specific servers settings
$ComputeServerSettings = Get-IntersightComputeServerSetting -Name $ComputeBlade.Name
$ComputeServerSettings | Set-IntersightComputeServerSetting -AdminPowerState PowerCycle
This also works
$ComputeServerSettings | Set-IntersightComputeServerSetting -AdminPowerState Hardreset
I get a barcalona error when i run the command, but it actually reboots the server
04-22-2025 06:04 AM
Hello @arnold-romeijn
I just played around with the commands and it's correct that "-AdminPowerState Reboot" only reboots the controller.
But depending on how rough you want to be. HardReset and PowerCycle reboots the server.
I did the following.
#Collects the server profile
$ServerProfile = Get-IntersightServerProfile -Name "PROFILENAME"
#Collects Computeblade associated with the server profile
$ComputeBlade = Get-IntersightComputeBlade -Moid $ServerProfile.AssignedServer.ActualInstance.Moid
#Gets the specific servers settings
$ComputeServerSettings = Get-IntersightComputeServerSetting -Name $ComputeBlade.Name
$ComputeServerSettings | Set-IntersightComputeServerSetting -AdminPowerState PowerCycle
This also works
$ComputeServerSettings | Set-IntersightComputeServerSetting -AdminPowerState Hardreset
I get a barcalona error when i run the command, but it actually reboots the server
04-22-2025 07:22 AM
Thank you Mark, that works!
Now i found (well, somebody send me the link
Cisco Intersight API Docs
AdminPowerState:
string
User configured power state of the server.
* `Policy` - Power state is set to the default value in the policy.
* `PowerOn` - Power state of the server is set to On.
* `PowerOff` - Power state is the server set to Off.
* `PowerCycle` - Power state the server is reset.
* `HardReset` - Power state the server is hard reset.
* `Shutdown` - Operating system on the server is shut down.
* `Reboot` - Power state of IMC is rebooted.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide