Log In
Developer Network
Technologies
Join the Network
Member Services
Events & Community
Unified Computing UCS Manager Developer Center
Overview
UCS Manager XML Schema
UCS Automation Tool (goUCS)
Server and Host Management API
UCS Standalone C-Series Servers
Cisco Standalone C-Series CIMC XML API
goUCS Automation Tool
Cisco Standalone C-Series HUU Utilities
Documentation
Community
Testing
UCS Management Ecosystem
Management with HP Software
HP Operations Manager (HPOM)
HP Operations Orchestration (HPOO)
Management with Microsoft Software
Microsoft System Center
Cisco UCS PowerTool for UCSM
SDK
System Management Resources
Altiris
UCS Management with VMware Software
OpenStack
UCS Labs
Labs Wiki
VM-FEX
Overview
Getting Started
Resources
Flexpod
Overview
Getting Started
Resources
Everything
This Site
Blogs
Cisco UCS for RackTables
Jeffrey Silberman
25 Oct 2012
Cisco UCS PowerTool Examples
Eric Williams
20 Jul 2012
ANNOUNCEMENT: goUCS version 2.0 Released
Eric Williams
08 Mar 2012
Getting to Know your UCS Fabric Interconnect Neighbors
John McDonough
10 Nov 2011
SCOM MP version 2.0 for Cisco UCS is now available
Chakri Avala
01 Sep 2011
Showing 1 - 5 of 16 results.
Items per Page 5
Page
(Changing the value of this field will reload the page.)
1
2
3
4
of 4
First
Previous
Next
Last
Forums
Message Boards Home
Recent Posts
Statistics
Answer
(
Unmark
)
Mark as an Answer
« Back to Microsoft Discussions
RE: New Message from Matt Oswalt in Unified Computing UCS Manager - Microso
Threads [
Previous
|
Next
]
Matt Oswalt
Posts:
8
Join Date:
3/30/12
Recent Posts
Applying changes to Service Profiles in a specific Sub-Organization
ucs
cisco
powertool
suborg
Answer
4/27/12 2:11 PM
Mark as an Answer
Submit
Reply with Quote
Quick Reply
I'm trying to figure out how to apply changes to a service profile on a sub-org level. I notice that there is a type of Cisco.Ucs.OrgOrg and that the Get-UcsServiceProfile Cmdlet has a parameter of "-Org". However, I don't know how to use the Cisco.Ucs.OrgOrg type.
Do I need to typecast a string containing the desired sub-org name to type Cisco.Ucs.OrgOrg? If so, how? Any details regarding changes on a sub-org level would be appreciated. I know documentation on PowerTool thus far is scarce as it is, but I can't find ANYTHING about this particular item.
Thanks!
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Bhaskar Jayakrishnan
Posts:
18
Join Date:
6/30/11
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
4/27/12 2:22 PM as a reply to Matt Oswalt.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Matt,
OrgOrg is a Managed Object that represents an organization. You need to get a handle to the sub-org.
Say you have an org org-root/org-a/org-b, you should do:
$org = Get-UcsOrg -Level root | Get-UcsOrg -Name a -LimitScope | Get-UcsOrg -Name b -LimitScope
You need the -LimitScope to ensure that you do not pick up an org name "a" anywhere lower in the hierarchy.
Now use $org with the required cmdlets ... like:
Get-UcsServiceProfile -Org $org ... etc.
We support a convenient transforms as can be seen below:
Get-UcsServiceProfile -Org a/b
Get-UcsServiceProfile -Org org-a/org-b
Get-UcsServiceProfile -Org org-root/org-a/org-b
Text transforms are convenient, but it is not the same thing as fetching a real MO, since the MO has the Ucs information embedded in it.
Do let us know if you need any more information.
Thanks,
- bhaskar
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Matt Oswalt
Posts:
8
Join Date:
3/30/12
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
4/27/12 4:07 PM as a reply to Bhaskar Jayakrishnan.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Thanks, that helps me understand a little more.
I will further clarify my specific needs - there are no nested suborgs, other than what's nested within "root". There are, however, several suborgs at that level and I want to limit my changes to only specific sub-organizations for "layer 8" reasons. As a result, I need my script to not only limit changes to the suborg specified, but allow the user of the script to select it from a list at runtime for ease of use.
As a result, I used the following snippet to populate a string array to present these to the user.
echo 'Getting organizational units from system...'
foreach ($thisOrg in Get-UcsOrg | Select Name | Out-String)
{
$UcsOrgs += $thisOrg.ToString()
}
I then created a new var to hold the Org object (non-string) and referred to it in my statement to power on service profiles:
#This is where I will later build in the ability to choose an org from the list. For now, I'm simply hard coding as string.
$targetedOrgString = 'ORG-A'
echo "Powering on all Service Profiles in $targetedOrgString ..."
$targetedOrg = Get-UcsOrg -Name $targetedOrgString
Get-UcsServiceProfile -Org $targetedOrg | Set-UcsServerPower -State admin-up -Force
Any issues with the above segments? Anything I can improve upon?
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Vijay Balyan
Posts:
22
Join Date:
2/3/12
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
4/27/12 8:55 PM as a reply to Matt Oswalt.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Hey Matt,
Do you want something like the following,
# Import the UCS PowerTool module
Import-Module CiscoUcsPs
# Connect to the UCS System
$user = "username"
$password = "xxxxx" | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object system.Management.Automation.PSCredential($user, $password)
Connect-Ucs ucs-pod01 -Credential $cred
# Get all the available Orgs
$org = Get-UcsOrg -Level root
# Get a list of all the Orgs Present
$orgNameList = $org | Get-UcsOrg -Hierarchy | % {$a = $_.Dn; $b=$a.split("/"); $b[1] } | Get-Unique
# Print the list
Write-Host "Available Orgs:"
Write-Host "=============="
$orgNameList
# Ask user to select one of the Orgs from the above printed list
$selectedOrgName = Read-Host "Select an Org to continue"
# Derive the MO for the selected Org
$selectedOrgMo = Get-UcsOrg -Level root | Get-UcsOrg -Name $selectedOrgName
Write-Host "Powering on all Service Profiles in Org " $selectedOrgName
$selectedOrgMo | Get-UcsServiceProfile | Set-UcsServerPower -State admin-up -Force
Sample Output:
============
Available Orgs:
==============
org-A
org-B
org-destOrg
org-Finance
Select an Org to continue: A
Powering on all Service Profiles in Org A
State : admin-up
Dn : org-root/org-A/ls-Asp/power
Rn : power
Status : modified
Ucs : ucs-pod01
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Matt Oswalt
Posts:
8
Join Date:
3/30/12
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
4/30/12 2:11 PM as a reply to Vijay Balyan.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Wow....that's great! Thank you!
I was initially pretty discouraged when I discovered the relative lack of practical documentation, but if the forum is or will be anything like this, I'll do my best to contribute so we can get some mean PowerTool scripts going!
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Vijay Balyan
Posts:
22
Join Date:
2/3/12
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
4/30/12 7:51 PM as a reply to Matt Oswalt.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Matt,
Just wanted to mention that it was a quick one that i posted.
But you should note that It does not take care of orgs within orgs. And so It also does not take care of same org name appearing at multiple level.
The below should take care of displaying Orgs from all levels.. But Get-Unique will eliminate multiple entries of the same name, even when they are at different Org levels.
$orgNameList = $org | Get-UcsOrg -Hierarchy | % {$a = $_.Rn; if(::IsMatch($a,"org-*")){ $a }} | Get-Unique
Thanks,
Vijay Vikrant Balyan
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Matt Oswalt
Posts:
8
Join Date:
3/30/12
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
5/2/12 1:50 PM as a reply to Vijay Balyan.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Matt,
Just wanted to mention that it was a quick one that i posted.
But you should note that It does not take care of orgs within orgs. And so It also does not take care of same org name appearing at multiple level.
The below should take care of displaying Orgs from all levels.. But Get-Unique will eliminate multiple entries of the same name, even when they are at different Org levels.
$orgNameList = $org | Get-UcsOrg -Hierarchy | % {$a = $_.Rn; if(::IsMatch($a,"org-*")){ $a }} | Get-Unique
Thanks,
Vijay Vikrant Balyan
Fortunately, although my environment is large, it is not very complex. There are only a few sub-orgs off of the root (so far) so this script is more than sufficient. I did modify it a little to improve usability.
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Matt Oswalt
Posts:
8
Join Date:
3/30/12
Recent Posts
RE: Applying changes to Service Profiles in a specific Sub-Organization
Answer
5/2/12 1:56 PM as a reply to Matt Oswalt.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
I noticed you're using the following to "import" the UCS PowerTool module:
# Import the UCS PowerTool module
Import-Module CiscoUcsPs
When I run that I get this:
Import-Module : The specified module 'CiscoUcsPs' was not loaded because no valid module file was found in any module directory.
So instead of running that I have to use this:
cd 'C:\Program Files (x86)\Cisco\Cisco UCS PowerTool'
.\StartUcsPS.ps1
Any idea how I can get that to import the way you are?
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Eric Williams
Posts:
42
Join Date:
3/31/10
Recent Posts
RE: New Message from Matt Oswalt in Unified Computing UCS Manager - Microso
Answer
5/2/12 3:09 PM as a reply to Matt Oswalt.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Matt:
If you upgrade to version 0.9.8.0 (available on CDN) we have added pathing support for powershell library locations to add the path to the Cisco UCS PowerTool psd1 (CiscoUcsPS.psd1) which is now located in C:\Program Files (x86)\Cisco\Cisco UCS PowerTool\Modules\CiscoUcsPS. After upgrade if you are still having issues, please let me know.
Thanks,
Eric
From: Cisco Developer Community Forums [mailto:cdicuser@developer.cisco.com]
Sent: Wednesday, May 02, 2012 7:56 AM
To: cdicuser@developer.cisco.com
Subject: New Message from Matt Oswalt in Unified Computing UCS Manager - Microsoft Discussions: RE: Applying changes to Service Profiles in a specific Sub-Organization
Matt Oswalt has created a new message in the forum "Microsoft Discussions":
--------------------------------------------------------------
I noticed you're using the following to "import" the UCS PowerTool module:
# Import the UCS PowerTool module
Import-Module CiscoUcsPs
When I run that I get this:
Import-Module : The specified module 'CiscoUcsPs' was not loaded because no valid module file was found in any module directory.
So instead of running that I have to use this:
cd 'C:\Program Files (x86)\Cisco\Cisco UCS PowerTool'
.\StartUcsPS.ps1
Any idea how I can get that to import the way you are?
--
To respond to this post, please click the following link:
<http://developer.cisco.com/web/unifiedcomputing/forums/-/message_boards/view_message/5547644>
or simply reply to this email.
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Matt Oswalt
Posts:
8
Join Date:
3/30/12
Recent Posts
RE: New Message from Matt Oswalt in Unified Computing UCS Manager - Microso
Answer
5/2/12 7:15 PM as a reply to Eric Williams.
Mark as an Answer
Submit
Reply with Quote
Quick Reply
Matt:
If you upgrade to version 0.9.8.0 (available on CDN) we have added pathing support for powershell library locations to add the path to the Cisco UCS PowerTool psd1 (CiscoUcsPS.psd1) which is now located in C:\Program Files (x86)\Cisco\Cisco UCS PowerTool\Modules\CiscoUcsPS. After upgrade if you are still having issues, please let me know.
Thanks,
Eric
Thanks, Eric! That did the trick! I have been meaning to apply the new update since it came out just didn't get around to it.
Sign in to vote.
Flag
Please sign in to flag this as inappropriate.
Top
Collateral
No files available