cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4209
Views
30
Helpful
3
Replies

Boot Host via SSH (CIMC)

Iser
Level 1
Level 1

Hey together,

 

I searched the internet for quite some time and didn't really find what I need so I decided to ask here now.

 

We are currently running 3 Host servers in a cluster for VMWare.

Each server is connected with one power supply to a UPS and one to direct power.

 

We are using Powerchute to shutdown the VMs and Hosts after a certain time of power outage.

 

The problem is, that the servers will not reboot if the power is restored, if the actual outage is over before the UPS is shutdown so both power supplies are without power.

 

So my idea was to boot up the hosts via SSH script if the power is restored.

 

I can't find a way to boot the hosts via SSH. Only found ways to reboot the CIMC which is working fine but not what I need.

Is it even possible?

I know it would probably be best practise to connect the two power supplies to two different UPS but we currently don't have these...

 

Thanks in advance for the help.

1 Accepted Solution

Accepted Solutions

Kirk J
Cisco Employee
Cisco Employee


From https://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_REST_API_guide_301/b_Cisco_IMC_api_3x60_chapter_010.html#id_14844__section_0D1EDB4D23E7449AA48D6743EB16E4BC
you can hit it with redfish:
curl -vv https://10.10.10.10/redfish/v1/Systems/FCH2005V1EN/Actions/System.Reset -d '{"ResetType":"On"}' --insecure -u admin:Admin123
 

Think IMC power tools also has 'start-imcserver' cmdlet

 

Kirk... 

View solution in original post

3 Replies 3

Brian Morrissey
Cisco Employee
Cisco Employee

The following should work from CIMC CLI to power on the host:

 

Server# scope chassis
Server /chassis # power on
This operation will change the server's power state.

 

You can also use XMLAPI:

https://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/4_0/b_Cisco_IMC_api_40/b_Cisco_IMC_api_40_appendix_0110.html#reference_9DBE7486B7EE4F399398645FEC9333D9__section_D99E7E41BAA8498CA1E2EC9D9C1442A5

 

Thanks for the hints.

It is working fine if I manually connect to the server via SSH but is it possible to run it as a single command?

Or with a Powershell script?

 

I tried the following but it doesn't work.

plink -ssh -P 22 <IP> -l <admin> -pw <Password> "scope chassis; power on; y"

and 

New-SSHSession -ComputerName <IP> -Credential (Get-Credential) -ConnectionTimeout 300 -OperationTimeout 300

Invoke-SSHCommand -Index 0 -Command "scope chassis power on y"

 

With and without the semicolon.

 

Also tried to send it with 3 single commands like 

Invoke-SSHCommand -Index 0 -Command "scope chassis"

Invoke-SSHCommand -Index 0 -Command "power on"

...

 

 

Kirk J
Cisco Employee
Cisco Employee


From https://www.cisco.com/c/en/us/td/docs/unified_computing/ucs/c/sw/api/3_0/b_Cisco_IMC_REST_API_guide_301/b_Cisco_IMC_api_3x60_chapter_010.html#id_14844__section_0D1EDB4D23E7449AA48D6743EB16E4BC
you can hit it with redfish:
curl -vv https://10.10.10.10/redfish/v1/Systems/FCH2005V1EN/Actions/System.Reset -d '{"ResetType":"On"}' --insecure -u admin:Admin123
 

Think IMC power tools also has 'start-imcserver' cmdlet

 

Kirk... 

Review Cisco Networking for a $25 gift card

Review Cisco Networking for a $25 gift card