Blogs

Introduction

Racktables version 0.20.1 has new feature support for Cisco UCS environments. Racktables is a structured and robust open-source solution for datacenter asset management, that helps document hardware assets, network addresses, space in racks and network configuration.
...Read More

 

I just added a new section to the UCS PowerTool section on the UCS CDN site that will provide a central repository of PoSh scripts, examples, and videos that detail use cases and examples for UCS PowerTool.

Here is the link:
http://developer.cisco.com/web/unifiedcomputing/powertool-examples
...Read More

 

I would like to announce the general availability of goUCS version 2.0 on Cisco Developer Network. A lot of time and effort has been put into the newest goUCS release, with some of the main features being detailed below.

 

Lest anyone thinks I have forgotten about my blogging on the UCS API, I have not, but I have written a blog recently for the Data Center blog and it is applicable to the UCS so I thought I would share the link here along with the blog into.

Early in my career I moved quite a bit, new job, growing family, whatever the reason it seemed like every two or three years we were packing up and going to a new place and meeting our new neighbors.
...Read More

 

Updated and completely revised version 2.0 MP for Cisco UCS is now available for download. Please check the release notes for the complete list of bug fixes ...Read More

 

Showing 1 - 5 of 16 results.
Items per Page 5
of 4

Forums

« Back to Microsoft Discussions

RE: How to Gracefully shutdown all servers in a chassis

Combination View Flat View Tree View
Threads [ Previous | Next ]
What would be the most efficient way to do this ? 
 
The output of "ConvertTo-UcsCmdlet" generated the following for the blade in 1/8 
 
Get-UcsOrg -Level root | Get-UcsOrg -Name "ESX" -LimitScope | Get-UcsServiceProfile -Name "ESX-1-8" -LimitScope | Get-UcsServerPower | Set-UcsServerPower -State "soft-shut-down"

 
 
I would imagine this should be something like this with pipelining : 
 
     Get-UcsBlade -Chassis 1  | Get-UcsServiceProfile | SetUcsServerPower -State "soft-shut-down" 
 
 
Thanks
 
James S 

James,



The snippet generated by ConvertTo-UcsCmdlet is the most relevant sequence to issue soft-shut-down to an associated service profile.



What exactly is the operation you are trying to do ?

Get-UcsBlade -Chassis 1 | Get-UcsServiceProfile | SetUcsServerPower -State "soft-shut-down"
does not map to MIT/MO model well.



Thanks,

- bhaskar



From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Thursday, May 17, 2012 3:09 AM
To: cdicuser@developer.cisco.com
Subject: New Message from James Shen in Unified Computing UCS Manager - Microsoft Discussions: How to Gracefully shutdown all servers in a chassis



James Shen has created a new message in the forum "Microsoft Discussions":

--------------------------------------------------------------
What would be the most efficient way to do this ?

The output of "ConvertTo-UcsCmdlet" generated the following for the blade in 1/8

Get-UcsOrg -Level root | Get-UcsOrg -Name "ESX" -LimitScope | Get-UcsServiceProfile -Name "ESX-1-8" -LimitScope | Get-UcsServerPower | Set-UcsServerPower -State "soft-shut-down"



I would imagine this should be something like this with pipelining :

Get-UcsBlade -Chassis 1 | Get-UcsServiceProfile | SetUcsServerPower -State "soft-shut-down"


Thanks

James S
--
To respond to this post, please click the following link:

<http://developer.cisco.com/web/unifiedcomputing/forums/-/message_boards/view_message/5744686>

or simply reply to this email.

James,

This is what I use, you can try it.

########################################################################

# Import the Cisco UCS PowerTool module
Import-Module CiscoUcsPS

# Connect to a UCS system
$passwd = ConvertTo-SecureString "password" -AsPlainText -Force
$ucsmcreds = New-Object System.Management.Automation.PSCredential ("admin", $passwd)
$handle = Connect-Ucs 192.168.1.1 -Credential $ucsmcreds

# Send command
# Excludes service profile which is not associated to any server
# If power is already down, no need to shutdown again
Get-UcsBlade | % { If (($_.AssignedToDn -ne "") -and ($_.OperPower -ne "off")) {
Write-Host "Shutting down" + "["$_.AssignedToDn"]..."
Get-UcsServiceProfile -Dn $_.AssignedToDn | Set-UcsServerPower -State "soft-shut-down" -Force
Write-Host
}
}

Write-Host "All done."

Disconnect-Ucs


########################################################################

Forgot to mention, that will shutdown servers in all chassis.

Replace
"Get-UcsBlade"
with
"Get-UcsBlade -Chassis 1"

then you can shutdown all servers in that chassis

Collateral


No files available