07-30-2014 07:39 AM
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
12-07-2014 08:47 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide