Skip to content

Cisco UCS remove server from pool and from service profile template without reboot?

Cisco UCS remove server from pool and from service profile template without reboot?

YES, there is a way!

Steps:

1) Note all the Service Profile to Blade associations.

2) For each Service Profile with blade in Server Pool run a command like below: (this would be Service Profile test01 associated with balde 4/4).
Associate-UcsServiceProfile -ServiceProfile (Get-UcsServiceProfile -name “test01”) -Blade (Get-UcsBlade -Chassis 4 -SlotId 4)

Step 2 above can also be automated with the below PowerShell by @pshankarb. PowerShell is run against the Server Pool.

Run the abelow script as :> C:\server_pool.ps1 -dls “a.b.c.d” -serverpool “pool1; pool2” dls> ucs IP serverpool> comma separated list of all server pools of interest.

param(

               [string]$dls,

               [string]$serverpool

              

               )

$domains= ($dls.split(“;”))

$server_pools= ($serverpool.split(“;”))

foreach($domain in $domains){

 

if($domain.count -eq 0){

write-host “invalid domain. Exiting.”

exit(0);

}

$pwd = convertto-securestring -Force -AsPlainText “###”

$local = new-object -typename System.Management.Automation.PSCredential -argumentlist “ucs-ADS\###”

$conn =  Connect-Ucs $domain -Credential $local;

 

if(!$conn){

write-host “no connection. check input.”

exit(0);

}

foreach($pool in $server_pools){

 

$pndn_list= ((Get-UcsServerPoolAssignment| ?{$_.opername -match $pool})| select pndn).pndn

 

foreach($pndn in $pndn_list){

 

if(!$pndn){

continue

}

$sp= get-ucsserviceprofile| ?{$_.pndn -match $pndn}

Associate-UcsServiceProfile -ServiceProfile $sp -Blade (Get-UcsBlade -dn $pndn) -force

}

}

disconnect-ucs

}

3) Remove the Server Pool from the corresponding Service Profile Template.

4) Delete Server Pool.

Published inUncategorized

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *