|
|
Line 62: |
Line 62: |
| Creating an image from a volume allows you to download the image either for a backup or to use in virtual box. | | Creating an image from a volume allows you to download the image either for a backup or to use in virtual box. |
| {{Command|openstack image create --disk-format <format> --volume <volume_name> <image_name>}} | | {{Command|openstack image create --disk-format <format> --volume <volume_name> <image_name>}} |
| where <volume_name> can be found from the OpenStack dash board by clicking on the volume name and <image_name> is the name given to the image you are creating and <format> is the disk format (two possible values are qcow2 and vmdk). See [[OpenStack#Command Line Clients]] for more details about working with command line. This image can then be downloaded in the way described in [[OpenStack#Downloading an image into a local VirtualBox]] | | where <volume_name> can be found from the OpenStack dash board by clicking on the volume name and <image_name> is the name given to the image you are creating and <format> is the disk format (two possible values are qcow2 and vmdk). See [[OpenStack Command Line Clients]] for more details about working with command line. This image can then be downloaded in the way described in [[OpenStack#Downloading an image into a local VirtualBox]] |
| | |
| ==Command Line Clients==
| |
| The OpenStack CLI tools perform many of the actions performed by the OpenStack dashboard GUI but on the command line. They also allow more functionality above and beyond the OpenStack dashboard.
| |
| The command line clients can be used from any machine, virtual or otherwise, and only require having an internet connection and the command line clients installed. The below discussion of command line client(s), assumes that they are being used on a Linux machine. It may be possible to use them in Windows however, this has not yet been explored.
| |
| | |
| To begin, get the openstack environment setup file: On the OpenStack dashboard go to compute->Access & Security-> API Access-> Download OpenStack RC File. This file sets environment variables so that the command line client(s) know how to connect to your OpenStack project. Then source the file (you will need to provide your OpenStack password).
| |
| | |
| ===Combined OpenStack CLI ===
| |
| The OpenStack combined CLI replaces the various separate command line tools, such as nova, swift, glance, cider etc. (see [[OpenStack#Separate Command Line Clients]] for a brief overview of the older separate command line clients). See [http://docs.openstack.org/developer/python-openstackclient/ http://docs.openstack.org/developer/python-openstackclient/] for the official documentation. The rest of this section gives a very basic overview to get a user started and points out some of the commands available.
| |
| | |
| ====Installation====
| |
| If you have admin access on the machine you can do
| |
| {{command|sudo apt-get install python-dev python-pip}}
| |
| {{command|pip install python-openstackclient}}
| |
| | |
| To install on a machine without admin privileges (provided pip is already installed) use:{{command| pip install --user python-openstackclient}}
| |
| which installs to ~/.local/lib/pythonX.Y/site-packages/. By adding <code>export PYTHONPATH=${HOME}/.local/lib/python2.7/site-packages/:${PYTHONPATH}</code> to your <code>.bashrc</code> file if you are using Python major version X=2, and minor version Y=7, python can then load the OpenStack modules (see [] for information about working with the Python OpenStack API). Further adding <code>export PATH=${HOME}/.local/bin:${PATH}</code> to your .bashrc will allow you to run the OpenStack commands directly. To install a specific version of the client using pip do <code>pip install python_openstackclient==2.3.0</code>.
| |
| | |
| see [http://docs.openstack.org/cli-reference/common/cli_install_openstack_command_line_clients.html http://docs.openstack.org/cli-reference/common/cli_install_openstack_command_line_clients.html] for more details about the installation process
| |
| | |
| ====Executing commands====
| |
| The combined CLI tool can be used interactively by running
| |
| {{Command|openstack}}
| |
| and then issuing commands at the prompt. Alternatively the commands can be issued as one-offs by preceding the command with <code>openstack</code>, for example
| |
| {{Command|openstack server list}}
| |
| When running in interactive mode a list of available commands can be seen by typing <code>help</code> at the OpenStack prompt. The available commands are categorized by groups, many of the most commonly used groups are listed below (e.g. the <code>server</code> command group). A list of commands belonging to a command group can be obtained by typing <code>help <command group></code>. To get help on a particular command (e.g. options and arguments of the command) one can type <code>help <command group> <command></code>. Note that many of the available commands are available only to OpenStack administrators and will show some meaningless error message if a non-administrator tries using it. For this reason a list of available commands grouped by command groups is provided below to allow one to easily identify commands available to the average user.
| |
| | |
| =====<code>server</code> command group=====
| |
| {|-
| |
| | <code>add security group</code> || <code>migrate</code> || <code>resume</code> || <code>unlock</code>
| |
| |-
| |
| | <code>add volume</code> || <code>pause</code> || <code>set</code> || <code>unpause</code>
| |
| |-
| |
| | <code>create</code> || <code>reboot</code> || <code>shelve</code> || <code>unrescue</code>
| |
| |-
| |
| | <code>delete</code> || <code>rebuild</code> || <code>show</code> || <code>unset</code>
| |
| |-
| |
| | <code>dump create</code> || <code>remove security group</code> || <code>ssh</code> || <code>unshelve</code>
| |
| |-
| |
| | <code>image create</code> || <code>remove volume</code> || <code>start</code> ||
| |
| |-
| |
| | <code>list</code> || <code>rescue</code> || <code>stop</code>
| |
| |-
| |
| | <code>lock</code> || <code>resize</code> || <code>suspend</code>
| |
| |}
| |
| | |
| =====<code>volume</code> command group=====
| |
| {|-
| |
| |<code>create</code>||<code>set</code>
| |
| |-
| |
| |<code>delete</code>||<code>show</code>
| |
| |-
| |
| |<code>list</code>||<code>unset</code>
| |
| |}
| |
| | |
| =====<code>console</code> command group=====
| |
| {|-
| |
| |<code>log show</code>||<code>url show</code>
| |
| |}
| |
| =====<code>flavor</code> command group=====
| |
| {|-
| |
| |<code>list</code>||<code>show</code>
| |
| |}
| |
| =====<code>image</code> command group=====
| |
| {|-
| |
| |<code>create</code>||<code>save</code>|
| |
| |-
| |
| |<code>delete</code>||<code>set</code>|
| |
| |-
| |
| |<code>list</code>||<code>show</code>|
| |
| |}
| |
| =====<code>ip</code> command group=====
| |
| {|-
| |
| |<code>fixed add</code>||<code>floating list</code>
| |
| |-
| |
| |<code>fixed remove</code>||<code>floating pool list</code>
| |
| |-
| |
| |<code>floating add</code>||<code>floating remove</code>
| |
| |-
| |
| |<code>floating create</code>||<code>floating show</code>
| |
| |-
| |
| |<code>floating delete</code>
| |
| |}
| |
| | |
| =====<code>keypair</code> command group=====
| |
| {|-
| |
| |<code>create</code>||<code>list</code>
| |
| |-
| |
| |<code>delete</code>||<code>show</code>
| |
| |}
| |
| | |
| =====<code>network</code> command group=====
| |
| {|-
| |
| |<code>create</code>||<code>set</code>
| |
| |-
| |
| |<code>delete</code>||<code>show</code>
| |
| |-
| |
| |<code>list</code>||
| |
| |}
| |
| | |
| =====<code>snapshot</code> command group=====
| |
| {|-
| |
| |<code>create</code>||<code>set</code>
| |
| |-
| |
| |<code>delete</code>||<code>show</code>
| |
| |-
| |
| |<code>list</code>||<code>unset</code>
| |
| |}
| |
| | |
| =====<code>security group</code> command group=====
| |
| {|-
| |
| |<code>create</code>||<code>rule list</code>
| |
| |-
| |
| |<code>delete</code>||<code>rule show</code>
| |
| |-
| |
| |<code>list</code>||<code>set</code>
| |
| |-
| |
| |<code>rule create</code>||<code>show</code>
| |
| |-
| |
| |<code>rule delete</code>||
| |
| |}
| |
| | |
| =====<code>limits show</code>=====
| |
| | |
| | |
| <!--These two (container and object) are not widely publicized
| |
| =====container=====
| |
| {|-
| |
| |<code>create</code>||<code>set</code>
| |
| |-
| |
| |<code>delete</code>||<code>show</code>
| |
| |-
| |
| |<code>list</code>||<code>unset</code>
| |
| |-
| |
| |<code>save</code>
| |
| |}
| |
| =====object=====
| |
| {|-
| |
| |<code>create</code>||<code>show</code>
| |
| |-
| |
| |<code>delete</code>||<code>store account set</code>
| |
| |-
| |
| |<code>list</code>||<code>store account show</code>
| |
| |-
| |
| |<code>save</code>||<code>store account unset</code>
| |
| |-
| |
| |<code>set</code>||<code>unset</code>
| |
| |}
| |
| -->
| |
| | |
| ===Separate Command Line Clients===
| |
| The older version of the command line clients were separated into individual clients which operated on the various aspects of OpenStack. They are mentioned here since, as of the time of writing, not all the functionality of the older separate command line clients has been incorporated into the new combined command line clients and one may find them useful in addition to the newer combined command line client.<!--
| |
| | |
| <ol>
| |
| <li>
| |
| Get the openstack environment setup file: On the OpenStack dashboard go to compute->Access & Security-> API Access-> Download OpenStack RC File. This file sets environment variables so that the command line clients know how to connect to your OpenStack project.</li>
| |
| <li>source the file (you will need to provide your OpenStack password)</li>
| |
| <li>install the nova client:{{Command|sudo apt-get install python-novaclient}}this client is used for managing images, instances, and flavors (i.e. the "compute" tab on horizon dashboard). (e.g. run the command {{Command|nova list}}, which lists all the instances currently setup)</li>
| |
| <li>install keystone client:{{Command|sudo apt-get install python-keystoneclient}}this client creates and manages users, tenants, roles, endpoints, and credentials. (e.g. run the command {{Command|keystone catalog}})</li>
| |
| <li>install neutron client:{{Command|sudo apt-get install python-neutronclient}} this client manages networks</li>
| |
| <li>install swift client:{{Command|sudo apt-get install python-swiftclient}} This client is used for managing the OpenStack object storage.</li>
| |
| <li>install heat client:{{Command|sudo apt-get install python-heatclient}} This client is used for automating cluster creation.</li>
| |
| </ol>-->
| |
|
| |
|
| ==Accessing a VM with Multiple Users== | | ==Accessing a VM with Multiple Users== |