Launching an Instance using CLI
Attention
These instructions may or may not apply to current openstack release. User help command to check current options.
1. Check available flavors
Flavor is a a template for default infrastructure, i.e., hardware details like RAM, storage etc
[root@openstack ~(keystone_admin)]# nova flavor-list
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1 | m1.tiny | 512 | 1 | 0 | | 1 | 1.0 | True |
| 2 | m1.small | 2048 | 20 | 0 | | 1 | 1.0 | True |
| 3 | m1.medium | 4096 | 40 | 0 | | 2 | 1.0 | True |
| 3f407ea9-1847-4a9e-a121-2c50b86122e2 | MyFlavour | 1024 | 10 | 0 | | 1 | 1.0 | True |
| 4 | m1.large | 8192 | 80 | 0 | | 4 | 1.0 | True |
| 5 | m1.xlarge | 16384 | 160 | 0 | | 8 | 1.0 | True |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
[root@openstack ~(keystone_admin)]#
2. Check the available images
Using nova
[root@openstack ~(keystone_admin)]# nova image-list
+--------------------------------------+--------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+--------+--------+--------+
| 2bb36409-d9a5-4f5d-8f7f-439de610c0d2 | cirros | ACTIVE | |
| 2348f760-a822-4887-aa4a-8d94b0aa65f4 | fedora | ACTIVE | |
+--------------------------------------+--------+--------+--------+
[root@openstack ~(keystone_admin)]#
Using glance
[root@openstack ~(keystone_admin)]# glance image-list
+--------------------------------------+--------+
| ID | Name |
+--------------------------------------+--------+
| 2bb36409-d9a5-4f5d-8f7f-439de610c0d2 | cirros |
| 2348f760-a822-4887-aa4a-8d94b0aa65f4 | fedora |
+--------------------------------------+--------+
[root@openstack ~(keystone_admin)]#
3. Check the available security group
[root@openstack ~(keystone_admin)]# openstack security group list
+--------------------------------------+-----------+------------------------+
| ID | Name | Description |
+--------------------------------------+-----------+------------------------+
| 0bbc087f-12f1-43d0-9e4d-76822d3a6390 | SecGroup1 | Security Group |
| 1cfb2716-a2da-4f51-89d8-a6159ffe26ed | default | Default security group |
+--------------------------------------+-----------+------------------------+
[root@openstack ~(keystone_admin)]#
4. Check available networks
Using nova
[root@openstack ~(keystone_admin)]# nova net-list
+--------------------------------------+-----------+------+
| ID | Label | CIDR |
+--------------------------------------+-----------+------+
| 2d29c827-9f8a-41e8-86ea-2463ec09c3d3 | MyNetwork | None |
| cbb9fd71-0253-4b97-8546-f7153902c0e7 | public | None |
| 250e5ca6-f553-44e2-9bde-a839b34c903e | private | None |
+--------------------------------------+-----------+------+
[root@openstack ~(keystone_admin)]#
Using neutron
[root@openstack ~(keystone_admin)]# neutron net-list
+--------------------------------------+-----------+------------------------------------------------------+
| id | name | subnets |
+--------------------------------------+-----------+------------------------------------------------------+
| 2d29c827-9f8a-41e8-86ea-2463ec09c3d3 | MyNetwork | 8c693020-4686-4994-b0ef-c8348fbd6ac7 10.0.0.0/24 |
| cbb9fd71-0253-4b97-8546-f7153902c0e7 | public | 98c171b5-0336-473f-ba60-cb4f16d72db9 172.24.4.224/28 |
| 250e5ca6-f553-44e2-9bde-a839b34c903e | private | abd30fee-a356-4dc2-8590-1f9e3b507ecc 10.0.0.0/24 |
+--------------------------------------+-----------+------------------------------------------------------+
[root@openstack ~(keystone_admin)]#
5. Check the available key pairs
[root@openstack ~(keystone_admin)]#
[root@openstack ~(keystone_admin)]# nova keypair-list
+------+-------------------------------------------------+
| Name | Fingerprint |
+------+-------------------------------------------------+
| Key1 | b9:05:3f:49:07:aa:11:62:70:4b:9a:3f:f8:65:9e:20 |
+------+-------------------------------------------------+
[root@openstack ~(keystone_admin)]#
6. Create the server
[root@openstack ~(keystone_admin)]# nova boot --flavor m1.tiny --image cirros --key-name Key1 --security-group SecGroup1 --nic net-id=2d29c827-9f8a-41e8-86ea-2463ec09c3d3 MyNewNovaServer_1
+--------------------------------------+-----------------------------------------------+
| Property | Value |
+--------------------------------------+-----------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | |
| OS-EXT-SRV-ATTR:host | - |
| OS-EXT-SRV-ATTR:hypervisor_hostname | - |
| OS-EXT-SRV-ATTR:instance_name | instance-00000006 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | 7hChwHVFnYBu |
| config_drive | |
| created | 2016-11-14T09:36:02Z |
| flavor | m1.tiny (1) |
| hostId | |
| id | 251466f5-ac3d-4a56-8d71-2a3983a83abb |
| image | cirros (2bb36409-d9a5-4f5d-8f7f-439de610c0d2) |
| key_name | Key1 |
| metadata | {} |
| name | MyNewNovaServer_1 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | SecGroup1 |
| status | BUILD |
| tenant_id | 42f2da6272634a3ab0366c430ad35eb1 |
| updated | 2016-11-14T09:36:02Z |
| user_id | 6d79da1826bc425db705a453cafa7f7a |
+--------------------------------------+-----------------------------------------------+
[root@openstack ~(keystone_admin)]#