cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
13407
Views
6
Helpful
10
Replies

UCS PowerTool + Service Profiles

jimstehlik
Level 1
Level 1

Hello,

During the recent Cisco Live, I sat in the BRKCOM-1004 - Automating UCS for Systems Administrators session hosted by Ike Kent and Jason Shaw.  During their presentation, they demonstrated using the UCS PowerTool how you could look for a fault, once a fault was reached, move a Service Profile from one blade to another.  They also used a .csv file as input.  I would like to obtain that .csv as well as see the full script because they had it looping.  Here are the four lines of code from the slide deck:

Get SP Hierarchy:
$lSpMos = (Get-UcsServiceProfile -dn $aInSpDn -hierarchy)

–Get Blade Hierarchy:
$lBladeMos = (Get-UcsManagedObject -dn $aInDn -hierarchy)

–Delete our requirement:
Get-UcsServiceProfile -dn $aInSpDn | Disconnect-UcsServiceProfile –force

–Decomission our blade:
Set-UcsManagedObject -force -XmlTag computeBlade -PropertyMap @{dn = $lPnDn ; lc= "decommission"}

–Associate a service profile with a blade:
Get-UcsServiceProfile -dn $aInSpDn | Associate-UcsServiceProfile -ServerPoolName $lPoolName -force

I would also like to know how to have the service profile associated with a blade from a second UCS domain too.

Thank you,

Jim

1 Accepted Solution

Accepted Solutions

Here is a script I wrote to do most of that.  Only thing it doesn't do is disassciate your SP on domain A at this point, but the replication it does do:

Import-Module CiscoUcsPS

$devnull = set-ucspowertoolconfiguration -supportmultipledefaultucs $true

$ip1 = "1.2.3.4"

$ip2 = "2.3.4.5"

$srcorg = "org-root"

$destorg = "org-root"

$spname = "bob"

$cred1 = Get-Credential

$cred2 = Get-Credential

$ucs1 = Connect-Ucs $ip1 -Credential $cred1

$ucs2 = Connect-Ucs $ip2 -Credential $cred2

$srcorgmo = Get-UcsManagedObject -Dn $srcorg -Ucs $ucs1

$destorgmo = Get-UcsManagedObject -Dn $destorg -Ucs $ucs2

$srcsp = $srcorgmo | Get-UcsServiceProfile -LimitScope -Hierarchy -Ucs $ucs1 -name $spname -type instance

$destsp = $destorg | get-ucsserviceprofile -LimitScope -Hierarchy -ucs $ucs2 -Name $spname -Type instance

$diff = @()

$diff = Compare-UcsManagedObject @($destsp) @($srcsp)

Sync-UcsMo -ucs $ucs2 ($diff) -force