cisco ucs ps

30
CISCO UCS Power Shell Library User Guide Page 1 of 30 CISCO UCS Power Shell Library User Guide Revision History Date Description Author May 20, 2011 Initial Version Cisco

Upload: andrius-kozeniauskas

Post on 12-Sep-2014

136 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  1  of  30    

 

 

 

 

 

 

 

 

CISCO  UCS  Power  Shell  Library  User  Guide    

 

 

 

 

 

 

 

 

 

Revision  History  

Date   Description   Author  May  20,  2011   Initial  Version   Cisco                    

Page 2: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  2  of  30    

Table  of  Contents  1   PowerShell  Overview  ...........................................................................................................................  6  

2   Cisco  UCSM  PowerShell  Toolkit  Architecture  .......................................................................................  6  

3   Getting  Started  with  the  Toolkit  ...........................................................................................................  7  

3.1   Pre-­‐requisite  .................................................................................................................................  7  

3.2   Toolkit  Installation  ........................................................................................................................  7  

3.3   Getting  Help  for  Cmdlets  ..............................................................................................................  9  

3.4   Toolkit  Removal  ............................................................................................................................  9  

3.5   Initial  UCSM  Connection  ...............................................................................................................  9  

3.6   Multiple  UCS  Connection  ...........................................................................................................  10  

4   PowerShell  Cmdlet  Library  .................................................................................................................  11  

4.1   CiscoUCSM.dll  .............................................................................................................................  11  

4.2   CiscoUCSPS.dll  ............................................................................................................................  11  

4.3   Existing  UCS  XSD  Schema  ...........................................................................................................  12  

4.4   Logging  .......................................................................................................................................  12  

4.5   Help  ............................................................................................................................................  12  

5   UCS  PowerShell  Cmdlet  Library  Features  ...........................................................................................  12  

5.1   Password  Management  ..............................................................................................................  12  

5.2   Object  Oriented  Library  ..............................................................................................................  12  

5.3   Pipeline  Support  .........................................................................................................................  12  

5.4   PowerShell  Features  ...................................................................................................................  13  

5.4.1   -­‐XML  ...................................................................................................................................  13  

5.4.2   -­‐Force  ..................................................................................................................................  13  

5.4.3   -­‐Recursive  ...........................................................................................................................  13  

5.5   Error  Handling  ............................................................................................................................  13  

5.6   Examples  .....................................................................................................................................  13  

5.6.1   Run  Cmdlets  .......................................................................................................................  13  

5.6.2   Create  object  ......................................................................................................................  13  

5.6.3   Pipeline  Support  .................................................................................................................  14  

6   Content  of  the  Library  ........................................................................................................................  14  

6.1   Get  Cmdlets  ................................................................................................................................  14  

6.1.1   Get-­‐chassis  (Get  Chassis  Details)  ........................................................................................  14  

Page 3: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  3  of  30    

6.1.2   Get-­‐Blade  (Get  Blade  Details)  .............................................................................................  14  

6.1.3   Get-­‐LocatorLED  (Get  status  of  LocatorLED)  ........................................................................  14  

6.1.4   Get-­‐Vlan  (Get  config  of  system  Vlan)  .................................................................................  14  

6.1.5   Get-­‐Vsan  (Get  config  of  system  Vsan)  ................................................................................  15  

6.1.6   Get-­‐ServerPool  (Get  status  of  ServerPool)  .........................................................................  15  

6.1.7   Get-­‐UuidPool  (Get  status  of  UuidPool)  ...............................................................................  15  

6.1.8   Get-­‐Schedule  (Get  status  of  Schedule)  ...............................................................................  15  

6.1.9   Get-­‐ServiceProfile(Get  status  of    Service  Profile)  ...............................................................  15  

6.1.10   Get-­‐SPTemplate(Get  SP  template  details)  ..........................................................................  15  

6.1.11   Get-­‐Org(Get  Org  list  within  UCS)  ........................................................................................  16  

6.1.12   Get-­‐VnicConnPolicy(Gets  list  of  available  VnicConnPolicy  )  ...............................................  16  

6.1.13   Get-­‐CurrentUCSPSSession  ..................................................................................................  16  

6.1.14   Get-­‐VhbaTemplate(Gets  Vhba  template  info)  ....................................................................  16  

6.1.15   Get-­‐AdapterPolicy  ..............................................................................................................  16  

6.1.16   Get-­‐Audit  ............................................................................................................................  16  

6.1.17   Get-­‐BiosPolicy  .....................................................................................................................  17  

6.1.18   Get-­‐FabricPort  ....................................................................................................................  17  

6.1.19   Get-­‐Fault  .............................................................................................................................  17  

6.1.20   Get-­‐IpmiPolicy  ....................................................................................................................  17  

6.1.21   Get-­‐PowerPolicy  .................................................................................................................  17  

6.1.22   Get-­‐RackUnit  ......................................................................................................................  17  

6.1.23   Get-­‐Session  .........................................................................................................................  17  

6.1.24   Get-­‐UCSEvent  .....................................................................................................................  18  

6.1.25   Get-­‐Vhba  ............................................................................................................................  18  

6.1.26   Get-­‐Vnic  ..............................................................................................................................  18  

6.2   Set  Cmdlets  .................................................................................................................................  18  

6.2.1   Set-­‐LocatorLED  ...................................................................................................................  18  

6.2.2   Set-­‐BladePower  ..................................................................................................................  18  

6.2.3   Set-­‐Vlan  ..............................................................................................................................  19  

6.2.4   Set-­‐Vsan  ..............................................................................................................................  19  

6.2.5   Set-­‐ServiceProfile  ...............................................................................................................  19  

6.2.6   Set-­‐VnicConnPolicy  .............................................................................................................  19  

Page 4: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  4  of  30    

6.2.7   Set-­‐VhbaTemplate  ..............................................................................................................  20  

6.2.8   Set-­‐ServerPool  ....................................................................................................................  20  

6.2.9   Set-­‐BiosPolicy  .....................................................................................................................  20  

6.2.10   Set-­‐FabricPort  .....................................................................................................................  20  

6.2.11   Set-­‐IpmiPolicy  .....................................................................................................................  21  

6.2.12   Set-­‐PowerPolicy  ..................................................................................................................  21  

6.2.13   Set-­‐ServerPower  .................................................................................................................  21  

6.2.14   Set-­‐ThresholdPolicy  ............................................................................................................  21  

6.2.15   Set-­‐Vhba  .............................................................................................................................  22  

6.2.16   Set-­‐Vnic  ...............................................................................................................................  22  

6.3   Add  Cmdlets  ...............................................................................................................................  22  

6.3.1   Add-­‐Vlan  .............................................................................................................................  22  

6.3.2   Add-­‐Vsan  ............................................................................................................................  22  

6.3.3   Add-­‐ServiceProfile  ..............................................................................................................  23  

6.3.4   Add-­‐SPTemplate  .................................................................................................................  23  

6.3.5   Add-­‐VhbaTemplate  .............................................................................................................  23  

6.3.6   Add-­‐ServerPool  ...................................................................................................................  23  

6.3.7   Add-­‐UuIdPool  .....................................................................................................................  24  

6.3.8   Add-­‐Schedule  ......................................................................................................................  24  

6.3.9   Add-­‐Org  ..............................................................................................................................  24  

6.3.10   Add-­‐SpFromTemplate  .........................................................................................................  24  

6.3.11   Add-­‐Vhba  ............................................................................................................................  25  

6.3.12   Add-­‐Vnic  .............................................................................................................................  25  

6.4   Remove  Cmdlets  .........................................................................................................................  25  

6.4.1   Remove-­‐Chassis  ..................................................................................................................  26  

6.4.2   Remove-­‐ServiceProfile  .......................................................................................................  26  

6.4.3   Remove-­‐SPTemplate  ..........................................................................................................  26  

6.4.4   Remove-­‐ServerPool  ............................................................................................................  26  

6.4.5   Remove-­‐UUidPool  ..............................................................................................................  26  

6.4.6   Remove-­‐Vlan  ......................................................................................................................  27  

6.4.7   Remove-­‐Vsan  ......................................................................................................................  27  

6.4.8   Remove-­‐VhbaTemplate  ......................................................................................................  27  

Page 5: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  5  of  30    

6.4.9   Remove-­‐Schedule  ...............................................................................................................  27  

6.4.10   Remove-­‐Blade  ....................................................................................................................  27  

6.4.11   Remove-­‐Org  ........................................................................................................................  27  

6.4.12   Remove-­‐Session  .................................................................................................................  28  

6.4.13   Remove-­‐Vhba  .....................................................................................................................  28  

6.4.14   Remove-­‐Vnic  .......................................................................................................................  28  

6.5   Miscellaneous  Cmdlets  ...............................................................................................................  28  

6.5.1   Connect-­‐UCSM  ...................................................................................................................  28  

6.5.2   Disconnect-­‐UCSM  ...............................................................................................................  29  

6.5.3   Disconnect-­‐AllUCSM  ...........................................................................................................  29  

6.5.4   Register-­‐Blade  ....................................................................................................................  29  

6.5.5   Unregister-­‐Chassis  ..............................................................................................................  29  

6.5.6   Register-­‐Chassis  ..................................................................................................................  29  

6.5.7   Invoke-­‐XMLCommand  ........................................................................................................  29  

6.5.8   Copy-­‐ServiceProfile  ............................................................................................................  30  

6.5.9   Unregister-­‐Blade  .................................................................................................................  30  

Page 6: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  6  of  30    

Introduction  

Primary  goal  of  this  document  is  to  specify  functionality  of  UCS  PowerShell  Management  Library.  Cisco  UCS  Manager  PowerShell  toolkit  is  a  community-­‐supported  extensibility  tool  developed  for  users  of  the  Unified  Computing  System  who  wish  to  leverage  PowerShell-­‐based  scripts  to  manage  and  automate  their  IT  environment.    This  release  is  currently  in  beta  status,  and  is  not  recommended  for  production  environments.    It  will  be  supported  primarily  through  the  Cisco  Developer  Network  Forums.    The  current  release  of  the  toolkit  contains  over  70  Cmdlets  specific  to  managing  and  automating  UCS  Manager.  

1 PowerShell  Overview  Windows  PowerShell  is  Microsoft's  task  automation  framework,  consisting  of  a  command-­‐line  shell  and  associated  scripting  language  built  on  top  of,  and  integrated  with  the  .NET  Framework.  PowerShell  provides  full  access  to  COM  and  WMI,  enabling  administrators  to  perform  administrative  tasks  on  both  local  and  remote  Windows  systems.  

In  PowerShell,  administrative  tasks  are  generally  performed  by  Cmdlets  (pronounced  command-­‐lets),  specialized  .NET  classes  implementing  a  particular  operation.  Sets  of  Cmdlets  may  be  combined  together  in  scripts,  executables  (which  are  standalone  applications),  or  by  instantiating  regular  .NET  classes  (or  WMI/COM  Objects).    These  work  by  accessing  data  in  different  data  stores,  like  the  file  system  or  registry,  which  are  made  available  to  the  PowerShell  runtime  via  Windows  PowerShell  providers.  

PowerShell  is  fast  becoming  a  defacto  standard  for  system  automation  within  Microsoft-­‐focused  IT  departments.    Besides  broad  support  for  managing  and  automating  many  of  the  core  Microsoft  products  (Windows,  System  Center,  Exchange  Server,  SQL  Server),  PowerShell  is  also  gaining  support  from  many  3rd  parties  (VMWare,  NetApp,  EMC,  etc)  interested  in  taking  advantage  of  the  flexible  and  powerful  scripting  environment  offered  by  PowerShell.    

2 Cisco  UCSM  PowerShell  Toolkit  Architecture  The  Cisco  UCSM  PowerShell  Toolkit  has  been  architected  to  closely  follow  PowerShell  best  practices  and  standards.    It  uses  standard  verbs,  supports  the  integrated  get-­‐help  online  help  system,  and  supports  common  PowerShell  practices  such  as  object-­‐based  output,  cmdlet  pipelining,  and  the  PowerShell  Common  Parameters.  

Built  using  Microsoft’s  .NET  technology,  the  UCSM  PowerShell  toolkit  uses  the  UCSM  XML  API  for  all  communication  between  the  toolkit  and  the  UCSM  instance.    The  toolkit  generates  the  appropriate  XML  document  for  the  API  call,  and  then  sends  it  to  the  Web  Service  resident  on  all  UCSM  instances.    Authentication  is  handled  using  the  built-­‐in  AAA  functions  of  UCS,  and  session  management  is  handled  by  the  PowerShell  toolkit  for  a  persistent  connection  experience.  

The  toolkit  is  delivered  as  a  PowerShell  module.    Installation  and  usage  of  the  module  is  covered  in  the  next  section.  

Page 7: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  7  of  30    

3 Getting  Started  with  the  Toolkit  

3.1 Pre-­‐requisite  Following  are  the  pre-­‐requisites  for  PowerShell  library:  

1. Windows  XP  Professional,  Windows  Server  2003,  Windows  Server  2008  2. Dot  Net  framework  2.0  3. PowerShell  2.0  

3.2 Toolkit  Installation  As  discussed  above,  the  toolkit  is  delivered  as  a  PowerShell  module.    To  begin  using  the  toolkit,  the  module  must  be  loaded.    Follow  the  steps  here  to  load  the  module  and  begin  using  the  toolkit  

1. Extract  the  contents  of  the  CiscoUCSM-­‐PowerShell.zip  file  to  a  directory  of  your  choice.  2. The  PowerShell  management  library  contains  following  DLLs  and  PowerShell  XML  help  schema  

files  which  are  required  to  be  present  in  the  directory.  a. CiscoUCSM.dll  b. CiscoUCSPS.dll  c. CiscoUCSPS.dll-­‐Help.xml  

3. Open  up  a  PowerShell  window,  and  navigate  to  the  directory  where  the  zip  archive  was  extracted.  

 

4. Using  the  import-­‐module  cmdlet,  add  the  module  to  the  current  PowerShell  session  

 

Page 8: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  8  of  30    

5. Once  the  module  is  imported,  verify  that  it  loaded  successfully  using  the  Get-­‐Module    cmdlet  

   

1) Now  that  the  module  is  loaded,  a  complete  list  of  available  Cmdlets  specific  to  the  UCSM  module  is  available  by  running  the  following  from  a  PowerShell  prompt  

a. PS>  Get-­‐Command  –Module  CiscoUCSPS  b. When  the  command  has  been  run  successfully,  the  previous  command  will  output  a  list  

of  the  Cmdlets  that  have  been  built  as  part  of  the  UCSM  PowerShell  toolkit.  

 

The  above  steps  will  allow  the  use  of  the  UCSM  PowerShell  toolkit  within  the  current  PowerShell  session.    To  enable  the  use  of  this  and  other  modules  in  new  PowerShell  sessions  automatically,  the  

Page 9: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  9  of  30    

import-­‐module  task  can  be  added  to  the  various  PowerShell  profiles.    For  a  detailed  description  of  PowerShell  profiles,  please  visit:    http://msdn.microsoft.com/en-­‐us/library/bb613488(VS.85).aspx.  

3.3 Getting  Help  for  Cmdlets  • Get-­‐Help  Connect-­‐UCSM  • To  see  the  examples,  type:  "get-­‐help  Connect-­‐UCSM  -­‐examples".  • For  more  information,  type:  "get-­‐help  Connect-­‐UCSM  -­‐detailed".  • For  technical  information,  type:  "get-­‐help  Connect-­‐UCSM  -­‐full".  

3.4 Toolkit  Removal  To  remove  the  toolkit,  follow  these  steps:  

1) Remove  the  module  from  the  PowerShell  session    

   

2) Delete  the  contents  of  the  directory  where  the  Cisco  UCSM  PowerShell  toolkit  archive  was  extracted  using  Windows  explorer.  

3.5 Initial  UCSM  Connection  Once  the  toolkit  module  has  been  added  to  the  PowerShell  session,  a  connection  needs  to  be  established  to  the  UCSM  API.    This  connection  is  persistent,  object-­‐based,  and  will  be  utilized  by  the  subsequent  UCSM-­‐focused  Cmdlets  that  are  run  in  that  session.    The  following  steps  describe  establishing  a  UCSM  connection  via  the  PowerShell  toolkit.  

1) If  not  already  completed,  add  the  UCSM  PowerShell  module  to  the  session  using  the  steps  previously  described  in  this  document.  

2) Using  the  Connect-­‐UCSM  cmdlet,  establish  the  connection  to  UCSM.    Complete  syntax  for  the  Connect-­‐UCSM  cmdlet  is  available  via  Get-­‐Help  Connect-­‐UCSM.  

3) For  example,  to  connect  to  a  UCSM  instance  located  at  http://10.193.35.33,  the  command  would  look  like  this    

Page 10: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  10  of  30    

 4) The  command  output  shown  above  indicates  a  successful  connection  to  the  UCSM  instance.  5) Additional  parameters  to  the  Connect-­‐UCSM  cmdlet  allow  for  secure  connections,  non-­‐standard  

ports,  etc.  6) Following  the  establishment  of  the  connection  using  the  previous  steps,  the  other  UCSM  

cmdlets  will  be  executed  using  the  authentication  granted  through  connection  just  created.  Examples  (Connecting  to  UCS  ):  

• Connect-­‐UCSM  -­‐name  192.168.68.128  -­‐Credential  $cred  -­‐Port  8080  -­‐SSL    • Connect-­‐UCSM  192.168.68.128  $creds  8061  –Connection  Test  • Connect-­‐UCSM  192.168.68.128  $creds  –SSL  –Connection  Test234  • Connect-­‐UCSM  192.168.68.128  $creds  8061  –Connection  ucsBgl  • Connect-­‐UCSM  savbu-­‐samc17.cisco.com  –SSL  –Connection  ucsSJ  

3.6 Multiple  UCS  Connection  To  manage  connections  to  multiple  UCSM  instances,  an  additional  parameter  named  Connection  can  be  specified  while  running  Connect-­‐UCSM.    When  specified,  the  connection  established  is  ‘assigned’  to  a  variable  of  the  same  name.    When  subsequently  running  Cmdlets  against  the  UCSM  infrastructure,  each  cmdlet  has  the  option  to  be  run  against  a  specific  connection  variable.    If  the  variable  name  is  omitted,  it  will  automatically  be  run  against  ‘CurrentUCSMInstance’,  which  is  a  variable,  created  when  no  specific  connection  name  is  specified  during  the  Connect-­‐UCSM  event.  

A  complete  list  of  local  PowerShell  UCSM  session  variables  can  be  seen  using  the  Get-­‐CurrentUCSPSSession  cmdlet.    Individual  sessions  can  be  disconnected  using  the  Disconnect-­‐UCSM  cmdlet.  All  sessions  can  be  disconnected  at  once  using  Disconnect-­‐AllUCSM  cmdlet.  

Page 11: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  11  of  30    

Every  Cmdlet  accepts  a  Connection  parameter  as  object.  If  a  user  ignores  to  provide  this  connection  parameter,  then  CurrentUCSMInstance  is  considered.  If  CurrentUCSMInstance  is  not  defined,  then  connection  error  is  thrown.  Hence  it  would  make  easy  to  work  on  UCS.  User  can  connect  to  multiple  UCSs  but  only  one  can  be  CurrentUCSMInstance.  If  a  user  tries  to  connect  to  UCS  without  providing  a  connection  string  with  existing  CurrentUCSMInstance,  CurrentUCSMInstance  will  be  replaced  with  new  connection  values.  It  is  also  applicable  to  existing  connection  strings.  

Cmdlet  “Get-­‐CurrentUCSPSSession”  will  display  all  existing  connections.  Output  of  “Get-­‐  CurrentUCSPSSession”  is  pipeable  to  other  Cmdlets  i.e.  “Get-­‐CurrentUCSPSSession  |  Get-­‐Blade”  will  display  all  blades  on  all  connections.  

 

 

 

 

 

 

 

 

 

 

4 PowerShell  Cmdlet  Library  

4.1 CiscoUCSM.dll  The  CiscoUCSM.dll  contains  generic  API’s  to  talk  to  UCSM.  These  API’s  perform  the  task  of  forming  the  XML  query  understandable  by  UCSM,  and  getting  back  the  response  from  UCSM.  

4.2 CiscoUCSPS.dll  Windows  PowerShell  is  Microsoft's  task  automation  framework,  consisting  of  a  command-­‐line  shell  and  associated  scripting  language  built  on  top  of,  and  integrated  with  the  .NET  Framework.  In  PowerShell,  Cmdlets,  which  are  specialized  .NET  classes  implementing  a  particular  operation,  are  used  to  perform  tasks.  CiscoUCSPS.dll  contains  UCS  specific  PowerShell  Cmdlets.    

                             

UCS  -­‐1         UCS  –  2                                UCS  -­‐  3  

Windows  XP,  Server  2003,  Server  2008  

PowerShell  CLI  Session  

SSL  

 Non-­‐Secured  

Non-­‐Secured  

 

SSL  

 Non-­‐Secured  

 Non-­‐Secured  

 Non-­‐Secured  

Page 12: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  12  of  30    

4.3 Existing  UCS  XSD  Schema  Classes  have  been  generated  from  UCS  schema  and  they  are  now  extended  to  have  methods  for  various  operations.  E.g.  computeBlade  class  has  functions  for  setting  the  blade  power,  locater  LED  etc.  Different  classes  have  been  developed  as  per  the  new  design  and  architecture.  There  are  two  library  files  (.dll)  as  follows:  

• CiscoUCSM.dll  (Common  Library):  This  common  library  can  be  plugged-­‐in  with  any  application  to  create  an  application  or  framework.  

• CiscoUCSMPSCmdlet.dll  (PowerShell  Library):  This  library  utilizes  the  CiscoUCSM.dll  to  generate  PowerShell  Cmdlets.  

4.4 Logging  Different  level  of  logging  is  provided  in  PS  Library.  It  includes  Info  and  Error.  By  default  all  the  errors  are  logged  in.    User  can  define  PowerShell  variable  “$CiscoUCSPSLogging”  as  “Info”  or  “Error”  if  detailed  information  is  required  along  with  all  the  errors.  Incase  user  sets  some  arbitrary  value  to  a  PowerShell  variable,  all  the  errors  are  logged  in.  

4.5 Help  • The  library  supports  standard  “Get-­‐Help  Cmdlet”.  Standard  help  file  for  all  the  Cmdlets  is  

available  with  examples,  full  details  about  parameters.  

5 UCS  PowerShell  Cmdlet  Library  Features  

5.1 Password  Management  It  is  possible  to  pass  an  encrypted  password  to  the  Connect-­‐UCSM  cmdlet  for  automation  (using  PSCredentials  object),  as  well  as  prompting  the  user  for  the  password  if  they  don’t  enter  it  in  the  cmdlet  using  masking  for  passwords.  

5.2 Object  Oriented  Library  Classes  have  been  defined  for  entities  of  UCS.  e.g.  blades  will  be  represented  by  the  class  computeBlade.  It  will  have  various  functions  pertaining  to  blades,  which  can  be  invoked  through  standard  PowerShell  behavior.  

$blades  =  Get-­‐Blade  

$blades[0].SetBladePower(“On”)  

5.3 Pipeline  Support  Pipeline  support  has  been  provided  as  per  default  PowerShell  behavior.  e.g.  

Get-­‐ServiceProfile  |  Remove-­‐ServiceProfile  (Will  ask  for  confirmation  from  user).  

Get-­‐ServiceProfile  -­‐SPName  test123  |  Remove-­‐ServiceProfile  –Force  (Will  forcefully  remove  the  service  profile).  

Page 13: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  13  of  30    

5.4 PowerShell  Features  Following  flags  have  been  implemented:  

5.4.1 -­‐XML  This  flag  has  been  implemented  in  all  Cmdlets.  No  value  is  required  for  this  flag.  If  passed  to  a  Cmdlet,  it  will  first  display  XML  query  sent  to  UCS  before  the  output  from  UCS.  E.g.  “Get-­‐Chassis  –XML”  will  display  the  details  of  chassis  on  UCS  after  displaying  XML  query  sent  to  UCS.  

5.4.2 -­‐Force  A  confirmation  from  user  is  sought  if  this  flag  is  not  provided..  E.g.  Get-­‐ServiceProfile  -­‐SPName  test123  |  Remove-­‐ServiceProfile  –Force  (Will  forcefully  remove  the  service  profile).  

5.4.3 -­‐Recursive  This  flag  has  been  implemented  in  all  relevant  Get  Cmdlets.  It  will  traverse  the  tree  of  entity  and  displays  all  details.  

5.5 Error  Handling  For  each  logged  error  event  the  Management  Library  will  store  UCS  XML  API  call  request  and  response  as  well  as  error  code  and  description  of  the  problem  returned  by  UCS.  

• Error  handling  inside  the  object  invocation  functions  and  in  all  Cmdlets  as  per  PowerShell  standard  behavior.  

$org  =  get-­‐org  –name  root  

$org.AddOrg(“Finance”,  “new  org  description”,  $True)    will  throws  exception.  

5.6 Examples  

5.6.1 Run  Cmdlets  • Get-­‐Chassis  –chassis  1    • Get-­‐Blade  –chassis  1  –blade  2  • Set-­‐LocatorLED  -­‐  chassis  2  -­‐  blade  3  –status  on  • Add-­‐ServiceProfile  -­‐Org  root/savbu/QA  –SPName  win2008  •  Remove-­‐ServiceProfile  -­‐SPName  22  -­‐Org  root  • Register-­‐Blade  –chassis  2  –blade  1  

5.6.2 Create  object  • $blade  =  Get-­‐Blade  • blade.count  (Gives  total  number  of  blade  object)  • $blade  |  Format-­‐List  • $blade.Register-­‐Blade()  • $blade.SetBladePower(on)  • $CurrentUCSMInstance.Disconnect()  • $CurrentUCSMInstance.Refresh()  

Page 14: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  14  of  30    

5.6.3 Pipeline  Support  • Get-­‐ServiceProfile  |  Format-­‐Table  -­‐Property  Desc,  dn  • Get-­‐Org  |  Get-­‐ServiceProfile  |  Set-­‐ServiceProfile  -­‐Desc  TestingSetSP  • Get-­‐Org  |  Get-­‐ServiceProfile  • Get-­‐Chassis  -­‐Chassis  1  |  Get-­‐Blade  -­‐Blade  1  • Get-­‐ServiceProfile  -­‐Recursive  -­‐SPName  test123  |  Format-­‐Table  -­‐Property  dn  • Get-­‐Org  -­‐recursive  |  Add-­‐ServiceProfile  -­‐SPName  test123  • Get-­‐Chassis  |  Get-­‐Blade  -­‐Blade  2  • Get-­‐Chassis  |  Get-­‐Blade  -­‐Blade  1  |  Add-­‐ServiceProfile  • Get-­‐Org  -­‐OrgName  root  -­‐Recursive  |  Set-­‐ServerPool  -­‐ServerPoolName  testSP123  -­‐Description  

testingSettingServerPool  • Get-­‐Org  -­‐OrgName  root  -­‐Recursive  |  Set-­‐ServerPool  -­‐ServerPoolName  testSP123  • Get-­‐Org  -­‐OrgName  root  -­‐Recursive  |  Set-­‐ServerPool  -­‐ServerPoolName  testSP123  -­‐MemberShip  

"sys/chassis-­‐3/blade-­‐5,  sys/chassis-­‐3/blade-­‐6"  -­‐Force  -­‐XML  

6 Content  of  the  Library    The  Cisco  UCS  PowerShell  library  consists  of  Connection-­‐Cmdlet,  Get,  Set,  Add,  Remove  and  other  Misc  Cmdlets.  

6.1 Get  Cmdlets  

6.1.1 Get-­‐chassis  (Get  Chassis  Details)  Input  Parameter   Type   Mandatory   Description  Chassis   Number   N   Chassis  Id  XML   Flag   N   Display  the  XML  query    

6.1.2 Get-­‐Blade  (Get  Blade  Details)  Input  Parameter   Type   Mandatory   Description  Chassis   Number   N   Chassis  Id  Blade   Number   N   Slog  Id  of  Blade    XML   Flag   N   Display  the  XML  query    

6.1.3 Get-­‐LocatorLED  (Get  status  of  LocatorLED)  Input  Parameter   Type   Mandatory   Description  Chassis   Number   N   Chassis  Id  Blade   Number   N   Slog  Id  of  Blade  XML   Flag   N   Display  the  XML  query    

6.1.4 Get-­‐Vlan  (Get  config  of  system  Vlan)  Input  Parameter   Type   Mandatory   Description  VLANName   String   N   Name  of  new  Vlan  FI   String   N   A,  B,  Dual  

Page 15: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  15  of  30    

XML   Flag   N   Display  the  XML  query    

6.1.5 Get-­‐Vsan  (Get  config  of  system  Vsan)  Input  Parameter   Type   Mandatory   Description  VSANName   String   N   Name  of  Vsan  FI   String   N   A,  B,  Dual  XML   Flag   N   Display  the  XML  query  

 

6.1.6 Get-­‐ServerPool  (Get  status  of  ServerPool)  Input  Parameter   Type   Mandatory   Description  ServerPoolName   String   N   Name  of  server  pool  Org   String   N   Organization  where  server  pool  

created  XML   Flag   N   Display  the  XML  query  Recursive   Flag   N   Recursive  search  flag    

6.1.7 Get-­‐UuidPool  (Get  status  of  UuidPool)  Input  Parameter   Type   Mandatory   Description  UuidPoolName   String   N   Name  of  Uuid  pool  Org   String   N   Organization  where  uuid  pool  

created  XML   Flag   N   Display  the  XML  query  Recursive   Flag   N   Recursive  search  flag    

6.1.8 Get-­‐Schedule  (Get  status  of  Schedule)  Input  Parameter   Type   Mandatory   Description  ScheduleName   String   N   name  of  new  Schedule  XML   Flag   N   Display  the  XML  query    

6.1.9 Get-­‐ServiceProfile(Get  status  of    Service  Profile)  Input  Parameter   Type   Mandatory   Description  Org   String   N   Organization  where  SP  Created  SPName   String   N   Name  of  SP  XML   Flag   N   Display  the  XML  query  Recursive   Flag   N   Recursive  search  flag    

6.1.10 Get-­‐SPTemplate(Get  SP  template  details)  Input  Parameter   Type   Mandatory   Description  SPTemplateName   String   N   Name  of  SP  Org   String   N   Org  where  the  template  added  

Page 16: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  16  of  30    

XML   Flag   N   Display  the  XML  query  Recursive   Flag   N   Recursive  search  flag  

 

6.1.11 Get-­‐Org(Get  Org  list  within  UCS)  Input  Parameter   Type   Mandatory   Description  OrgName   String   N   Name  of  new  Organization  XML   Flag   N   Display  the  XML  query  Recursive   Flag   N   if  provided,  will  give  the  full  

organization  hierarchy  

 

6.1.12 Get-­‐VnicConnPolicy(Gets  list  of  available  VnicConnPolicy  )  Input  Parameter   Type   Mandatory   Description  VnicConnPolicyName   String   N   Name  of  Policy  Org   String   N   Name  of  organization  XML   Flag   N   Display  the  XML  query  Recursive   Flag   N   Recursive  search  flag  

 

6.1.13 Get-­‐CurrentUCSPSSession    No  input  parameters.  

 

6.1.14 Get-­‐VhbaTemplate(Gets  Vhba  template  info)  Input  Parameter   Type   Mandatory   Description  VhbaTemplateName   String   N   Name  of  Vhba  Template  Org   String   N   Name  of  org  XML   Flag   N   Display  the  XML  query  

 

6.1.15 Get-­‐AdapterPolicy  Input  Parameter   Type   Mandatory   Description  AdapterPolicyName   String   N   Name  of  Adapter  Policy  Org   String   N   Name  of  org  Recursive   Flag   N   Recursive  search  flag  XML   Flag   N   Display  the  XML  query  

 

6.1.16 Get-­‐Audit  Input  Parameter   Type   Mandatory   Description  AuditID   Integer   N   ID  of  Audit  Event  to  display  XML   Flag   N   Display  the  XML  query  

 

Page 17: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  17  of  30    

6.1.17 Get-­‐BiosPolicy  Input  Parameter   Type   Mandatory   Description  BiosPolicyName   String   N   Name  of  Policy  Org   String   N   Name  of  org  Recursive   Flag   N   Recursive  search  flag  XML   Flag   N   Display  the  XML  query  

 

6.1.18 Get-­‐FabricPort  Input  Parameter   Type   Mandatory   Description  Port   Integer   N   FabPortID  Slot   Integer   N   Bank  of  ports  to  select  (1=20/40  

Fixed  ports,  2=Mezz  Slot  #1,  3=Mezz  slot  #2)  

XML   Flag   N   Display  the  XML  query    

6.1.19 Get-­‐Fault  Input  Parameter   Type   Mandatory   Description  FaultID   Integer   N   ID  of  fault  to  display  XML   Flag   N   Display  the  XML  query  

 

6.1.20 Get-­‐IpmiPolicy  Input  Parameter   Type   Mandatory   Description  IpmiPolicyName   String   N   Name  of  IPMI  Policy  Org   String   N   Name  of  org  Recursive   Flag   N   Recursive  search  flag  XML   Flag   N   Display  the  XML  query  

 

6.1.21 Get-­‐PowerPolicy  Input  Parameter   Type   Mandatory   Description  PowerPolicyName   String   N   Name  of  Power  Policy  Org   String   N   Name  of  org  Recursive   Flag   N   Recursive  search  flag  XML   Flag   N   Display  the  XML  query  

 

6.1.22 Get-­‐RackUnit  Input  Parameter   Type   Mandatory   Description  RackUnit   Integer   N   rack  unit  number  XML   Flag   N   Display  the  XML  query  

 

6.1.23 Get-­‐Session  Input  Parameter   Type   Mandatory   Description  

Page 18: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  18  of  30    

UserName   String   N   get  sessions  from  a  specific  user  Sessiontype   String   N   get  sessions  from  a  specific  

authentication  SessionIdentifier   String   N   ID  of  the  session  XML   Flag   N   Display  the  XML  query  

 

6.1.24 Get-­‐UCSEvent  Input  Parameter   Type   Mandatory   Description  EventID   Integer   N   ID  of  Event    XML   Flag   N   Display  the  XML  query  

 

6.1.25 Get-­‐Vhba  Input  Parameter   Type   Mandatory   Description  VhbaName   String   N   name  of  Vhba  Org   String   N   Org  where  Vnic  is  created  SPName   String   Y   name  of  Service  Profile  Recursive   Flag   N   Recursive  search  flag  XML   Flag   N   Display  the  XML  query  

 

6.1.26 Get-­‐Vnic  Input  Parameter   Type   Mandatory   Description  VNICName   String   N   name  of  new  VNIC  Org   String   N   Org  where  Vnic  is  created  SPName   String   Y   name  of  Service  Profile  Recursive   Flag   N   Recursive  search  flag  XML   Flag   N   Display  the  XML  query  

 

6.2 Set  Cmdlets    

6.2.1 Set-­‐LocatorLED  Input  Parameter   Type   Mandatory   Description  Chassis   Number   Y   Chassis  Id  Blade   Number   Y   Slog  Id  of  Blade  Status   String   Y   On/Off  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.2 Set-­‐BladePower  Input  Parameter   Type   Mandatory   Description  Chassis   Number   Y   Chassis  Id  

Page 19: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  19  of  30    

Blade   Number   Y   number  of  Blade    Status   String   Y   On/Off  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.3 Set-­‐Vlan  Input  Parameter   Type   Mandatory   Description  VLANName   String   Y   Name  of  new  Vlan  ID   Number   Y   Vlan  Id  FI   String   Y   A,  B,  Dual  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.4 Set-­‐Vsan  Input  Parameter   Type   Mandatory   Description  VSANName   String   Y   Name  of  vsan  FI   String   Y   A,  B,  Dual  DefaultZoning   Flag   N   Flag  to  enable  default  zoning  ID   Number   Y   VSAN  ID  FCoEID   Number   Y   FCOEID  XML   flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.5 Set-­‐ServiceProfile  Input  Parameter   Type   Mandatory   Description  SPName   String   Y   DN  of  SP  Org   String     N   Name  of  Org  Desc   String   N   Description  Label   String   N   Lable  for  SP  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.6 Set-­‐VnicConnPolicy  Input  Parameter   Type   Mandatory   Description  VnicConnPolicyName   String   Y   Name  of  policy  Spname   String   Y   Name  of  SP  Org   String   N   Name  of  org  XML   Flag   N   Display  the  XML  query  

Page 20: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  20  of  30    

Force   Flag   N   Prompts  the  user  before  continuing  with  the  operation  

 

6.2.7 Set-­‐VhbaTemplate  Input  Parameter   Type   Mandatory   Description  VhbaTemplateName   String   Y   Name  of  vhba  template  Org   String   N   Name  of  org  WWPN   String   Y   Wwpn  address  or  pool  name  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.8 Set-­‐ServerPool  Input  Parameter   Type   Mandatory   Description  ServerPoolName   String   Y   DN  of  Pool  Name  Org     String   N   Name  of  org  Description   String   N   Description  Membership   Array   N   List  or  range  of  Blade  DNs  to  be  

added.  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.9 Set-­‐BiosPolicy  Input  Parameter   Type   Mandatory   Description  BiosPolicyName   String   Y   Name  of  BIOS  Policy  SPName   String   N   name  of  SP  org   String   N   Name  of  Org  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.10 Set-­‐FabricPort  Input  Parameter   Type   Mandatory   Description  Port   Integer   Y   In  of  FabPortID  Status   String   N   Enabled/Disabled  Type   String   N   Uplink/Server/FCoE/Unconfigured  Slot   Integer   N   Which  Bank  of  Ports  to  Manage  

(1=  20/40  fixed  ports,  2=Mezz  Card  #1,  3=Mezz  Card  #2)  

FI   String   Y   Global/A/B  

Page 21: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  21  of  30    

XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.11 Set-­‐IpmiPolicy  Input  Parameter   Type   Mandatory   Description  IpmiPolicyName   String   Y   Name  of  Policy  SPName   String   Y   name  of  SP  org   String   N   Name  of  Org  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.12 Set-­‐PowerPolicy  Input  Parameter   Type   Mandatory   Description  PowerPolicyName   String   Y   Name  of  Power  Policy  SPName   String   Y   name  of  SP  org   String   N   Name  of  Org  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.13 Set-­‐ServerPower  Input  Parameter   Type   Mandatory   Description  org   String   N   Organization  where  the  SP  

resides  SPName   String   Y   name  of  SP  Status   String   Y   Name  of  Power  Condition  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.14 Set-­‐ThresholdPolicy  Input  Parameter   Type   Mandatory   Description  ThresholdPolicyName   String   Y   Name  of  Threshold  Policy  SPName   String   Y   name  of  SP  Org   String   N   Name  of  Org  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

Page 22: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  22  of  30    

6.2.15 Set-­‐Vhba  Input  Parameter   Type   Mandatory   Description  VhbaName   String   Y   Name  of  vHBA  SPName   String   Y   name  of  SP  wwpnpool   String   N   Name  of  WWPNPool  wwpn   String   N   WWPN  address  Org   String   N   Name  of  Org  vsan   String   N   Name  of  VSAN  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.2.16 Set-­‐Vnic  Input  Parameter   Type   Mandatory   Description  VNICName   String   Y   Name  of  vNIC  SPName   String   Y   name  of  SP  macpool   String   N   Name  of  MacPool  mac   String   N   Mac  address  Org   String   N   Name  of  Org  VLANName   String   N   Name  of  VLAN(s)  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3 Add  Cmdlets  

6.3.1 Add-­‐Vlan  Input  Parameter   Type   Mandatory   Description  VLANName   String   Y   Name  of  new  VLAN  ID   Number   Y   Vlan  id  FI   String   N   Global/A/B  Sharing   String   N   Primary/Isolated  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.2 Add-­‐Vsan  Input  Parameter   Type   Mandatory   Description  VSANName   String   Y   Name  of  new  vsan  FI   String   Y   A,  B,  Dual  DefaulZoning   Boolean   N   Enabled/Disabled  Id   Number   Y   Vsan  id  FCoEID   Number   Y   FCoEID  

Page 23: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  23  of  30    

XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.3 Add-­‐ServiceProfile  Input  Parameter   Type   Mandatory   Description  SPName   String   Y   Name  of  SP  Org   String   N   Org  where  SP  is  created  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.4 Add-­‐SPTemplate  Input  Parameter   Type   Mandatory   Description  SPTemplateName   String   Y   DN  of  SP  Org   String   N   Org  where  the  template  is  added  Description   String   N   Description  Type   String     Updating  vs  static  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.5 Add-­‐VhbaTemplate  Input  Parameter   Type   Mandatory   Description  VhbaTemplateName   String   Y   Name  of  new  vhba  template  org   String   N   Org  where  Vnic  is  created  DataFieldSize   Number   N    FI   String   Y   A,  B,  Dual  PinGroup   String   N   Name  of  Pin  gourp  Vsan   String   N   Name  of  vsan  Wwpnpool   String   N   Name  of  wwpn  pool  Qospolicy   String   N   Name  of  qos  policy  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.6 Add-­‐ServerPool  Input  Parameter   Type   Mandatory   Description  ServerPoolName   String   Y   Name  of  server  pool  Org   String   N   Organization  where  the  server  

pool  created  Description   String   N   Description  XML   Flag   N   Display  the  XML  query  

Page 24: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  24  of  30    

Force   Flag   N   Prompts  the  user  before  continuing  with  the  operation  

 

6.3.7 Add-­‐UuIdPool  Input  Parameter   Type   Mandatory   Description  UuidPoolName   String   Y   Name  of  UUID  pool  Org   String   N   Organization  where  the  pool  

created  Description   String   N   Description  Prefix   String   N   Format  validated  prefix  or  

‘derived’  Blockstart   String   N   UUId  start  value  Size   Number   N   Number  of  sequential  UUIDs  to  

create  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.8 Add-­‐Schedule  Input  Parameter   Type   Mandatory   Description  ScheduleName   String   Y   Name  of  Schedule  Description   String   N   Description  for  the  new  schedule  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.9 Add-­‐Org  Input  Parameter   Type   Mandatory   Description  OrgName   String   Y   Name  of  new  Organization  Org   String   N   Name  of  Organization  under  

which  the  new  organization  will  be  added  

Description   String   N   Description  of  new  Org  XML   Flag   N   Display  the  XML  query    

6.3.10 Add-­‐SpFromTemplate  Input  Parameter   Type   Mandatory   Description  SPName   String   Y   Name  of  New  SP  SPTemplate   String   Y   Name  of  SP  Template  Number   String   N   Number  of  Child  SPs  Org   String   N   Org  where  the  SP  created  TemplateOrg   String   N   TemplateOrg  from  where  the  

Service  Template  taken  

Page 25: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  25  of  30    

XML   Flag   N   Display  the  XML  query    

6.3.11 Add-­‐Vhba  Input  Parameter   Type   Mandatory   Description  VhbaName   String   Y   name  of  new  Vhba  org   String   Y   Org  where  Vnic  is  created  SPName   String   Y   name  of  Service  Profile  binding   Boolean   N   enable/disabled  (default)  DataFieldSize   Integer   N    FI   String   Y   A/B  PinGroup   String   N   Name  of  Pin  Group  vsan   String   N   name  of  Vsan  WWPN   String   N   name  of  WWPN  WWPNpool   String   N   name  of  WWPN  Pool  qospolicy   String   N   name  of  qos  policy  adaptorpolicy   String   N   name  of  adaptor  policy  vhbatemplate   String   N   name  of  vhba  template  to  use  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.3.12 Add-­‐Vnic  Input  Parameter   Type   Mandatory   Description  VNICName   String   Y   name  of  new  VNIC  org   String   N   Org  where  Vnic  is  created  SPName   String   Y   name  of  Service  Profile  FI   String   Y   A/B  VLANName   String   N   name  of  VLan  macpool   String   N   Name  of  MacPool  Mac   String   N   Mac  address  PinGroup   String   N   Name  of  Pin  Group  Failover   Boolean   N   Yes/No  Nativevlan   String   N   name  of  vlan  Qospolicy   String   N   Name  of  Qos  policy  Netcntrlpolicy   String   N   Name  of  Net  Control  Policy  Adaptorpolicy   String   N   name  of  adaptor  policy  Vnictemplate   String   N   name  of  VNIC  template  to  use  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4 Remove  Cmdlets    

Page 26: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  26  of  30    

6.4.1 Remove-­‐Chassis  Input  Parameter   Type   Mandatory   Description  Chassis   Number   Y   Chassis  Id  to  delete  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.2 Remove-­‐ServiceProfile  Input  Parameter   Type   Mandatory   Description  Org   String   N   Org  where  the  SP  created  SPName   String   Y   Name  of  SP  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.3 Remove-­‐SPTemplate  Input  Parameter   Type   Mandatory   Description  SPTemplateName   String   Y   DN  of  SP  Org   String   N   Org  where  the  template  is  added  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.4 Remove-­‐ServerPool  Input  Parameter   Type   Mandatory   Description  ServerPoolName   String   Y   Name  of  server  pool  Org   String   N   Organization  where  the  server  

pool  created  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.5 Remove-­‐UUidPool  Input  Parameter   Type   Mandatory   Description  UuidPoolName   String   Y   DN  of  UUID  pool  Org   String   N   Name  of  Org  Block   String   N   UUID  suffix  Block  start  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

Page 27: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  27  of  30    

6.4.6 Remove-­‐Vlan    Input  Parameter   Type   Mandatory   Description  VLANName   String   Y   Name  of  new  VLAN  FI   String   Y   A,  B,  Dual  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.7 Remove-­‐Vsan  Input  Parameter   Type   Mandatory   Description  VSANName   String   Y   Name  of  new  VSAN  FI   String   Y   A,  B,  Dual  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.8 Remove-­‐VhbaTemplate  Input  Parameter   Type   Mandatory   Description  VhbaTemplateName   String   Y   Name  of  vbhatemplate  Org   String   N   Name  of  organization  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.9 Remove-­‐Schedule  Input  Parameter   Type   Mandatory   Description  ScheduleName   String   Y   name  of  schedule  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.10 Remove-­‐Blade  Input  Parameter   Type   Mandatory   Description  chassis   Integer   Y   Chassis  number  blade   Integer   Y   blade  number  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.11 Remove-­‐Org  Input  Parameter   Type   Mandatory   Description  

Page 28: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  28  of  30    

Org   String   Y   Name  of  organization  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.12 Remove-­‐Session  Input  Parameter   Type   Mandatory   Description  SessionIdentifier   String   Y   ID  of  session  to  sessiontype   String   N   local  /  remote  userName   String   N   name  of  user  authenticated  to  

SessionID  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.13 Remove-­‐Vhba  Input  Parameter   Type   Mandatory   Description  VhbaName   String   Y   name  of  new  Vhba  Org   String   N   Org  where  Vnic  is  created  SPname   String   Y   name  of  Service  Profile  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.4.14 Remove-­‐Vnic  Input  Parameter   Type   Mandatory   Description  VLANName   String   Y   name  of  new  VNIC  Org   String   N   Org  where  Vnic  is  created  SPName   String   Y   name  of  Service  Profile  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.5 Miscellaneous  Cmdlets    

6.5.1 Connect-­‐UCSM  Input  Parameter   Type   Mandatory   Description  Name   String   Y   IP  or  Hostname  of  UCS  Credential   PSCredential   Y   Auth  token  Port   Number   N   Web  server  port  to  connect  to  SSL   Flag   N   Use  SSL  connection  

Page 29: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  29  of  30    

RefreshCookie   Flag   N   Triggers  UCS  Cookie  refresh  Connection   String   N   If  provided,  sets  the  connection  

return  value  to  this  variable    

6.5.2 Disconnect-­‐UCSM  Input  Parameter   Type   Mandatory   Description  Connection   String   N   Connection  string  returned  by  

Connect-­‐UCSM  

6.5.3 Disconnect-­‐AllUCSM  No  input  parameters.    

6.5.4 Register-­‐Blade  Input  Parameter   Type   Mandatory   Description  Chassis   Number   Y   Chassis  number  Blade   Number   Y   Blade  number  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.5.5 Unregister-­‐Chassis  Input  Parameter   Type   Mandatory   Description  Chassis   Number   Y   Chassis  number  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.5.6 Register-­‐Chassis  Input  Parameter   Type   Mandatory   Description  Chassis   Number   Y   Chassis  number  XML   Flag   N   Display  the  XML  query  Force   Flag   N   Prompts  the  user  before  

continuing  with  the  operation    

6.5.7 Invoke-­‐XMLCommand  Input  Parameter   Type   Mandatory   Description  XMLStringList   List  of  String   Y   List  of  Strings  of  XML  to  pass  to  

UCS  proxy  FileName  

 

String   Y   File  to  import  parameterized  XML  from  

 

Page 30: Cisco Ucs Ps

CISCO  UCS  Power  Shell  Library  User  Guide  

Page  30  of  30    

6.5.8 Copy-­‐ServiceProfile  Input  Parameter   Type   Mandatory   Description  SPName   String   Y   original  SP  to  clone  from  Org   String   N   Org  location  for  SP  to  clone  from  TargetSPName   String   Y   name  of  SP  to  clone  to  TargetOrg   String   N   org  location  of  cloned  SP  XML   Flag   N   Display  the  XML  query  

Force   Flag   N   Prompts  the  user  before  continuing  with  the  operation  

 

6.5.9 Unregister-­‐Blade  Input  Parameter   Type   Mandatory   Description  Chassis   Integer   Y   Chassis  Number  Blade   Integer   N   Blade  Number  XML   Flag   N   Display  the  XML  query  

Force   Flag   N   Prompts  the  user  before  continuing  with  the  operation