<?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_thread?p_l_id=&amp;threadId=6203197" />
  <subtitle>Modify Boot Policy to service profile template</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=6203197</id>
  <updated>2013-06-20T01:20:05Z</updated>
  <dc:date>2013-06-20T01:20:05Z</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>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=6204102" />
    <author>
      <name>Sage Harvey</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=6204102</id>
    <updated>2012-07-31T15:03:49Z</updated>
    <published>2012-07-31T15:03:49Z</published>
    <summary type="html">Hi Matteo,

You can do something like this:
[code]Get-UcsServiceProfile -name spName | Set-UcsServiceProfile -BootPolicyName san_boot -Force
or when you're done...
Get-UcsServiceProfile -name spName | Set-UcsServiceProfile -BootPolicyName local_boot -Force[/code]

That's assuming you've set up a boot policy called san_boot &amp; local_boot, you've got boot luns built, presented, zoned, etc.  The -Force just prevents confirmation that you want to change the boot policy setting.

Sage</summary>
    <dc:creator>Sage Harvey</dc:creator>
    <dc:date>2012-07-31T15:03:49Z</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>

