cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
760
Views
0
Helpful
1
Replies

Powertool script for copying service profiles from one UCS domain to another

jimstehlik
Level 1
Level 1

Hello All,

I'm trying to modify this code so that when it moves the service profile from one UCS domain to another, it does not automatically associate it.

Here is the code:

Import-Module CiscoUcsPS

$devnull = set-ucspowertoolconfiguration -supportmultipledefaultucs $true

$ip1 = "AHC-UCS3"

$ip2 = "ahc-lgh-ucs2"

$srcorg = "org-root"

$destorg = "org-root"

$spname = "DWtest"

$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 | where { $_.GetType().Name -ne "LsVersionBeh" }

$destsp = $destorgmo | get-ucsserviceprofile -LimitScope -Hierarchy -ucs $ucs2 -Name $spname -Type instance | where { $_.GetType().Name -ne "LsVersionBeh" }

$diff = @()

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

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

#echo $srcsp

#echo $destsp

#echo $diff

disconnect-ucs

echo $handle

Get-UcsPSSession | select ucs, uri, version

Thanks,

Jim

1 Reply 1

thomsonac
Level 4
Level 4

Hey Jim,

Have you considered using UCS Central and global service profiles?  I just went through the tasks to integrate 4 brownfield and 1 greenfield UCS Domains into a coherent UCS Central setup and I've very pleased with the results.  As we deploy all new profiles as global service profiles moving between domains becomes as simple as disassociating from a blade in domain 1 and associating (when ready) the profile in domain 2.

Review Cisco Networking products for a $25 gift card