Overview of Cisco UCS Manager CLI

This chapter includes the following sections:

Managed Objects

Cisco UCS uses a managed object model, where managed objects are abstract representations of physical or logical entities that can be managed. For example, servers, chassis, and processors are physical entities represented as managed objects, and resource pools, user roles, service profiles, and policies are logical entities represented as managed objects.

Managed objects may have one or more associated properties that can be configured.

Command Modes

The CLI is organized into a hierarchy of command modes, with the EXEC mode being the highest-level mode of the hierarchy. Higher-level modes branch into lower-level modes. You use create, enter, and scope commands to move from higher-level modes to modes in the next lower level , and you use the exit command to move up one level in the mode hierarchy.


Note


Most command modes are associated with managed objects, so you must create an object before you can access the mode associated with that object. You use create and enter commands to create managed objects for the modes being accessed. The scope commands do not create managed objects and can only access modes for which managed objects already exist.


Each mode contains a set of commands that can be entered in that mode. Most of the commands available in each mode pertain to the associated managed object. Depending on your assigned role and locale, you may have access to only a subset of the commands available in a mode; commands to which you do not have access are hidden.

The CLI prompt for each mode shows the full path down the mode hierarchy to the current mode. This helps you to determine where you are in the command mode hierarchy, and it can be an invaluable tool when you need to navigate through the hierarchy.

The following table lists the main command modes, the commands used to access each mode, and the CLI prompt associated with each mode.

Table 1 Main Command Modes and Prompts

Mode Name

Commands Used to Access

Mode Prompt

EXEC

top command from any mode

#

adapter

scope adapter command from EXEC mode

/adapter #

chassis

scope chassis command from EXEC mode

/chassis #

Ethernet server

scope eth-server command from EXEC mode

/eth-server #

Ethernet uplink

scope eth-uplink command from EXEC mode

/eth-uplink #

fabric-interconnect

scope fabric-interconnect command from EXEC mode

/fabric-interconnect #

Fibre Channel uplink

scope fc-uplink command from EXEC mode

/fc-uplink #

firmware

scope firmware command from EXEC mode

/firmware #

Host Ethernet interface

scope host-eth-if command from EXEC mode

/host-eth-if #

Host Fibre Channel interface

scope host-fc-if command from EXEC mode

/host-fc-if #

monitoring

scope monitoring command from EXEC mode

/monitoring #

organization

scope org command from EXEC mode

/org #

security

scope security command from EXEC mode

/security #

server

scope server command from EXEC mode

/server #

service-profile

scope service-profile command from EXEC mode

/service-profile #

system

scope system command from EXEC mode

/system #

virtual HBA

scope vhba command from EXEC mode

/vhba #

virtual NIC

scope vnic command from EXEC mode

/vnic #

Object Commands

Four general commands are available for object management:
  • create object
  • delete object
  • enter object
  • scope object

You can use the scope command with any managed object, whether a permanent object or a user-instantiated object. The other commands allow you to create and manage user-instantiated objects. For every create object command, a corresponding delete object and enter object command exists.

In the management of user-instantiated objects, the behavior of these commands depends on whether the object exists, as described in the following tables:
Table 2 Command behavior if the object does not exist
Command Behavior

create object

The object is created and its configuration mode, if applicable, is entered.

delete object

An error message is generated.

enter object

The object is created and its configuration mode, if applicable, is entered.

scope object

An error message is generated.

Table 3 Command behavior if the object exists
Command Behavior

create object

An error message is generated.

delete object

The object is deleted.

enter object

The configuration mode, if applicable, of the object is entered.

scope object

The configuration mode of the object is entered.

Complete a Command

You can use the Tab key in any mode to complete a command. Partially typing a command name and pressing Tab causes the command to be displayed in full or to the point where another keyword must be chosen or an argument value must be entered.

Command History

The CLI stores all commands used in the current session. You can step through the previously used commands by using the Up Arrow or Down Arrow keys. The Up Arrow key steps to the previous command in the history, and the Down Arrow key steps to the next command in the history. If you get to the end of the history, pressing the Down Arrow key does nothing.

All commands in the history can be entered again by simply stepping through the history to recall the desired command and pressing Enter. The command is entered as if you had manually typed it. You can also recall a command and change it before you press Enter.

Committing, Discarding, and Viewing Pending Commands

When you enter a configuration command in the CLI, the command is not applied until you enter the commit-buffer command. Until committed, a configuration command is pending and can be discarded by entering a discard-buffer command.

You can accumulate pending changes in multiple command modes and apply them together with a single commit-buffer command. You can view the pending commands by entering the show configuration pending command in any command mode.


Note


Committing multiple commands together is not an atomic operation. If any command fails, the successful commands are applied despite the failure. Failed commands are reported in an error message.


While any commands are pending, an asterisk (*) appears before the command prompt. The asterisk disappears when you enter the commit-buffer command.

The following example shows how the prompts change during the command entry process:

switch-1# scope chassis 1
switch-1 /chassis # enable locator-led
switch-1 /chassis* # show configuration pending
 scope chassis 1
+    enable locator-led
 exit
switch-1 /chassis* # commit-buffer
switch-1 /chassis #

Online Help for the CLI

At any time, you can type the ? character to display the options available at the current state of the command syntax.

If you have not typed anything at the prompt, typing ? lists all available commands for the mode you are in. If you have partially typed a command, typing ? lists all available keywords and arguments available at your current position in the command syntax.

CLI Session Limits

Cisco UCS Manager limits the number of CLI sessions that can be active at one time to 32 total sessions. This value is not configurable.

Web Session Limits

Web session limits are used by Cisco UCS Manager to restrict the number of web sessions (both GUI and XML) permitted access to the system at any one time.

By default, the number of concurrent web sessions allowed by Cisco UCS Manager is set to the maximum value: 256.

Setting the Web Session Limit for Cisco UCS Manager from the CLI

Procedure
     Command or ActionPurpose
    Step 1UCS-A# scope system  

    Enters system mode.

     
    Step 2UCS-A /system # scope services  

    Enters system services mode.

     
    Step 3UCS-A /system/services # scope web-session-limits  

    Enters system services web session limits mode.

     
    Step 4UCS-A /system/services/web-session-limits # set total num-of-logins-total  

    The maximum number of concurrent HTTP and HTTPS sessions allowed for all users within the system.

    Enter an integer between 1 and 256.

     
    Step 5UCS-A /system/services/web-session-limits # commit-buffer  

    Commits the transaction to the system configuration.

     

    The following example sets the maximum number of HTTP and HTTPS sessions allowed by the system to 200 and commits the transaction:

    UCS-A# scope system
    UCS-A /system # scope services
    UCS-A /system/services # scope web-session-limits			
    UCS-A /system/services/web-session-limits* # set total 200
    UCS-A /system/services/web-session-limits* # commit-buffer
    UCS-A /system/services/web-session-limits # 

    Pre-Login Banner

    With a pre-login banner, when a user logs into Cisco UCS Manager GUI, Cisco UCS Manager displays the banner text in the Create Pre-Login Banner dialog box and waits until the user dismisses that dialog box before it prompts for the username and password. When a user logs into Cisco UCS Manager CLI, Cisco UCS Manager displays the banner text in a dialog box and waits for the user to dismiss that dialog box before it prompts for the password. It then repeats the banner text above the copyright block that it displays to the user.

    Creating the Pre-Login Banner

    Procedure
       Command or ActionPurpose
      Step 1UCS-A# scope security  

      Enters security mode.

       
      Step 2UCS-A /security # scope banner 

      Enters banner security mode.

       
      Step 3UCS-A /security/banner # create pre-login-banner 

      Creates a pre login banner.

       
      Step 4UCS-A /security/banner/pre-login-banner # set message 

      Specifies the message that Cisco UCS Manager displays to the user before it displays the login prompt for the Cisco UCS Manager GUI or CLI.

      You can enter any standard ASCII character in this field.

      Launches a dialog for entering the pre-login banner message text.

       
      Step 5At the prompt, type a pre-login banner message and press Enter. 

      On the line following your input, type ENDOFBUF to finish.

      Press Ctrl and C to cancel out of the set message dialog.

       
      Step 6UCS-A /security/banner/pre-login-banner # commit-buffer 

      Commits the transaction to the system configuration.

       

      The following example creates the pre-login banner:

      UCS-A# scope security
      UCS-A /security # scope banner
      UCS-A /security/banner # create pre-login-banner
      UCS-A /security/banner/pre-login-banner* # set message
      Enter lines one at a time. Enter ENDOFBUF to finish. Press ^C to abort.
      Enter prelogin banner:
      >Welcome to UCS System 1
      >ENDOFBUF
      UCS-A /security/banner/pre-login-banner* # commit-buffer
      UCS-A /security/banner/pre-login-banner #
      

      Modifying the Pre-Login Banner

      Procedure
         Command or ActionPurpose
        Step 1UCS-A# scope security  

        Enters security mode.

         
        Step 2UCS-A /security # scope banner 

        Enters banner security mode.

         
        Step 3UCS-A /security/banner # scope pre-login-banner 

        Enters pre-login-banner banner security mode.

         
        Step 4UCS-A /security/banner/pre-login-banner # set message 

        Specifies the message that Cisco UCS Manager displays to the user before it displays the login prompt for the Cisco UCS Manager GUI or CLI.

        You can enter any standard ASCII character in this field.

        Launches a dialog for entering the pre-login banner message text.

         
        Step 5At the prompt, modify the pre-login banner message and press Enter. 

        On the line following your input, type ENDOFBUF to finish.

        Press Ctrl and C to cancel out of the set message dialog.

         
        Step 6UCS-A /security/banner/pre-login-banner # commit-buffer 

        Commits the transaction to the system configuration.

         

        The following example modifies the pre-login banner:

        UCS-A# scope security
        UCS-A /security # scope banner
        UCS-A /security/banner # create pre-login-banner
        UCS-A /security/banner/pre-login-banner* # set message
        Enter lines one at a time. Enter ENDOFBUF to finish. Press ^C to abort.
        Enter prelogin banner:
        Welcome to UCS System 1
        ENDOFBUF
        UCS-A /security/banner/pre-login-banner* # commit-buffer
        UCS-A /security/banner/pre-login-banner #
        

        Deleting the Pre-Login Banner

        Procedure
           Command or ActionPurpose
          Step 1UCS-A# scope security  

          Enters security mode.

           
          Step 2UCS-A /security # scope banner 

          Enters banner security mode.

           
          Step 3UCS-A /security/banner # delete pre-login-banner 

          Deletes the pre-login banner from the system.

           
          Step 4UCS-A /security/banner # commit-buffer 

          Commits the transaction to the system configuration.

           

          The following example deletes the pre-login banner:

          UCS-A# scope security
          UCS-A /security # scope banner
          UCS-A /security/banner # delete pre-login-banner
          UCS-A /security/banner* # commit-buffer
          UCS-A /security/banner #