Command-line interface

This section describes the vSwitch Controller CLI commands. You can access the CLI locally from the text console of the Controller VM in XenCenter. To access the CLI remotely, use an SSH client application and connect to the controller VM hostname or IP address on port 22.

During a CLI session you can get help with CLI commands in either of the following ways:

  • Type help and then press Enter.

  • Enter part of a command followed by a space and question mark (?), and then press Enter.

The interface supports completion of the command argument when you press the Tab key. Generally, you can abbreviate commands to the shortest, unique string at each level to reduce typing. You can access the command history within the current session is available by pressing the Arrow keys.

To terminate the current CLI session

Run the command: exit

To halt the vSwitch Controller

Run the command: halt controller

This command halts the vSwitch Controller appliance by gracefully shutting down the Controller.

To get information on commands

Run the command: help

To upgrade or downgrade the existing version of the Controller

Run the command: install controller software-update scp-format-remote-filename

This command securely copies a controller update file from the specified remote location and installs that version in place of the existing version.

This command can be used to install software versions that are both upgrades and downgrades. Upgrades automatically migrate the configuration to the new version. Downgrades revert to the most recent compatible configuration snapshot or an empty configuration when no compatible snapshot exists.

To ping a specified remote system

Run the command: ping name-or-IP-address [count]

This command sends ICMP echo requests to the remote system identified by name-or-IP-address and waits for replies. If no count is specified, requests are sent once per second until interrupted with Ctrl-C. If a count is specified, that number of pings are sent.

To restart the Controller

Run the command: restart controller appliance

This command shuts down and restarts the entire controller appliance.

This command is primarily for troubleshooting. Generally, the halt command is used to power off the controller appliance.

To restart the Controller daemon

Run the command: restart controller daemon

This command shuts down and restarts the processes that implement the controller functions.

This command is primarily for troubleshooting.

To set the hostname of the controller appliance

Run the command: set controller hostname hostname

This command sets the hostname of the controller appliance.

If the provided hostname contains one or more period characters (“.”), the hostname of the appliance is set to the string before the first period. The domain name of the appliance will be set to the string after the first period.

To set the IP address of the Controller management interface via DHCP

Run the command: set controller management-interface config dhcp

This command sets the Controller management interface IP address using DHCP. If DHCP is configured, resource pools cannot be set to Fail-Safe mode.

This command takes effect when executed, so remote access to the CLI may be lost if the address changes.

To set a static IP address for the Controller management interface

Run the command:

set controller management-interface config static
                            IP-address
                        netmask
                        gateway-IP
                            [dns-server-IP]
                            [dns-server-IP2
                        dns-search]]`

This command sets a static IP address for the Controller management interface. The DNS configuration information is optional. The ability to specify a DNS search path requires the specification of two DNS servers.

This command takes effect when executed so remote access to the CLI may be lost if the address changes.

To display the current Controller hostname

Run the command: show controller hostname

To display a summary of the current configuration and status of the management interface

Run the command: show controller management-interface

To display configuration values for the management interface

Run the command: show controller management-interface config

To display the current default gateway for the Controller

Run the command: show controller management-interface default-gateway

To display the current DNS configuration for the Controller

Run the command: show controller management-interface dns-server

To display the current IP address of the Controller management interface

Run the command: show controller management-interface ip-address

To display the current netmask of the Controller management interface

Run the command: show controller management-interface netmask

To display the software version of the Controller

Run the command: show controller version