Here are Some Important Python-Novaclient Commands Mainly For HP Cloud, Which Uses OpenStack. Python-Novaclient is More Powerful Than GUI Tools. If you need to setup the Python-Novaclient, you should read our guide for getting started with HP Cloud. On GUI dashboard, there is a file named OpenStack RC file. From that file, you can configure your local computer’s client.
Important Python-Novaclient Commands (HP Cloud OpenStack)
We are taking that, you have already installed the Python-Novaclient Agent. The usage pattern is :
1 2 | nova <subcommand> nova <subcommand> <subcommand> |
and so on, Help is always available by running nova subcommand help
. As we have set the password on .rc
file (.zshrc
or .bashrc
) file, running commands will not ask for the password. As on any OpenStack based IaaS, we are limited as client, we can check our allowed maximum limit by running this command :
---
1 | nova absolute-limits |
This will return this kind of “photograph” :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ➜ ~ nova absolute-limits +-------------------------+-------+ | Name | Value | +-------------------------+-------+ | maxServerMeta | 50 | | maxPersonality | 5 | | maxImageMeta | 50 | | maxPersonalitySize | 10240 | | maxTotalRAMSize | 15360 | | maxSecurityGroupRules | 20 | | maxTotalKeypairs | 100 | | totalRAMUsed | 7168 | | maxSecurityGroups | 10 | | totalFloatingIpsUsed | 0 | | totalInstancesUsed | 3 | | totalSecurityGroupsUsed | 1 | | maxTotalFloatingIps | 10 | | maxTotalInstances | 40 | | totalCoresUsed | 5 | | maxTotalCores | -1 | +-------------------------+-------+ ➜ ~ |
We can not show the real output for many commands, this is a safe, real example. You can run the command nova help boot
to get all the useful commands and here is the full command to save the huge list as a text file named nova_help_boot.txt
and open it on nano :
1 | nova help boot > nova_help_boot.txt && nano nova_help_boot.txt |
Not all the commands will work on Rackspace, HP Cloud etc. These are OpenStack commands, the vendors can limit. If you run this command, you’ll get the list of running instances :
1 | nova list --status active |
Right now, I need not to login to HP Cloud to create a snapshot of this server where from you are reading this guide, I can run this command after changing the values to real one :
1 2 3 | nova image-create <server> <backup> # <server> is the name of the instance # <backup> is any name you will use |
nova image-list
and nova flavor-list
are important variables to create instances on the fly. Again, a practical modification of the first command is :
1 | nova image-list > HP-images.txt && nano HP-images.txt |
We can create an instance by running this command :
1 | nova boot --<flavor ID> --<image ID> <server name> |
Server Name is the instance we type on web GUI. We can delete the instance by running nova delete server name
command. Easy. This will not work on HP Cloud :
1 | nova root-password <server name> |
You will get all the commands on OpenStack’s official website :
1 | http://docs.openstack.org/cli-reference/content/novaclient_commands.html |
or you can simply wget
the pdf file, it is around 400 paged eBook :
1 | wget http://docs.openstack.org/cli-reference/cli-reference.pdf |
Yeah, on IaaS; you are limited by many stuffs, the next level up is Software Defined Data Center, which will give you more resources.