<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Modify Boot Policy to service profile template</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_recent_posts?p_l_id=" />
  <subtitle>Modify Boot Policy to service profile template</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_recent_posts?p_l_id=</id>
  <updated>2013-05-20T20:57:11Z</updated>
  <dc:date>2013-05-20T20:57:11Z</dc:date>
  <entry>
    <title>RE: Modify Boot Policy to service profile template</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6204198" />
    <author>
      <name>Matteo Belletti</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6204198</id>
    <updated>2012-07-31T15:16:08Z</updated>
    <published>2012-07-31T15:16:08Z</published>
    <summary type="html">Hi,
I've resolved with the following script:


#########################
# Input Parameters #
#########################
PARAM ($Org, $SPTemp)


#######################
# Input variables here#
#######################
$ucsvip = "x.x.x.x"
$ucsadmin = "ucs_user"
$ucspsswd = "ucs_user"

#########################################
# Import the Cisco UCS PowerTool module #
#########################################
Import-Module CiscoUcsPS


############################################
# Authenticate to UCSM with the admin user #
############################################
$user = $ucsadmin
$password = $ucspsswd | ConvertTo-SecureString -AsPlainText -Force
$cred = New-Object system.Management.Automation.PSCredential($user, $password)
$handle1 = Connect-Ucs $ucsvip -Credential $cred

############################################
# Set Service Profile Template Boot Policy #
############################################


Set-UcsServiceProfile -ServiceProfile org-root/org-$Org/$SPTemp -BootPolicyName BOOT_POLICY_NAME -force


# Loop through each SP requiring acknowledgement
${lsAcks} = Get-UcsLsmaintAck -OperState "waiting-for-user" 
   
foreach (${lsAck} in ${lsAcks})
{
     # Acknowledge Maintenance Acknowlwedgement to progress reboot
     Set-UcsLsmaintAck -LsmaintAck ${lsAck} -AdminState "trigger-immediate" -force
    
     # Wait for UCS state change; reboot triggered
     ${lsAck} | Watch-Ucs -Property OperState -SuccessValue pending-next-boot -PollSec 30 -TimeoutSec 600
   
}</summary>
    <dc:creator>Matteo Belletti</dc:creator>
    <dc:date>2012-07-31T15:16:08Z</dc:date>
  </entry>
  <entry>
    <title>Modify Boot Policy to service profile template</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6203196" />
    <author>
      <name>Matteo Belletti</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6203196</id>
    <updated>2012-07-31T07:30:24Z</updated>
    <published>2012-07-31T07:30:24Z</published>
    <summary type="html">Hi all,
I need to modify my Service Profile profile Boot Policy in a Disaster Recovery Environment. Actually the Boot Policy is set to boot from local disk, when we'll test the disaster recovery, the server will boot from san.
How can i script it with powershell?
Thanks</summary>
    <dc:creator>Matteo Belletti</dc:creator>
    <dc:date>2012-07-31T07:30:24Z</dc:date>
  </entry>
</feed>

