Absolutely! There are 3 ways to interact with OpenStack.
In this lab, we are going to walk through some of the activities that we did in the previous labs via the CLIs.
When you see a CLI command starting with openstack, the command is part of the Unified CLI.
When you see a CLI command that starts with a project name like nova, these are the individual CLIs.
You can read more about the OpenStack CLIs at: https://docs.openstack.org/user-guide/common/cli-overview.html
In order to complete this lab, you will need an SSH client.
On Linux or Mac, you can just use your favorite terminal.
On Windows, you will need to download putty if you don't already have it. This is an exe file that does not need to be installed. Just run.
On Linux or Mac, in your terminal, ssh to 192.168.1.77 on port 22
$ ssh studentX@192.168.1.77
If on Windows, run putty, enter 192.168.1.77 as the host and 22 as the port.
You will get asked if you are sure you want to connect. Type yes and hit enter.
Login with your studentX credentials.
Source your studentXrc file
$ source studentXrc
Verify that you are connected by running nova list
$ openstack server list
You should see the two instances you created in the previous lab.
First we'll download the image using curl
$ curl -o ~/cirros035.qcow2 http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
Upload the cirros test image to glance
$ glance image-create --name studentX-cirros035 --disk-format qcow2 --container-format bare --visibility private --file ~/cirros035.qcow2
You will now see two images in your glance image list prefixed with studentX-cirros
Run openstack image list (or glance image-list) to see the available images
$ openstack image list
Run the following command to see the existing flavors
$ openstack flavor list
List the existing floating IP addresses
openstack floating ip list
First create the network
$ openstack network create private-b
Then let's create the private-b subnet
$ openstack subnet create --network private-b --subnet-range 172.16.1.0/24 --dns-nameserver 192.168.0.6 private-b-subnet
List the Neutron Networks and Subnets
$ openstack network list $ openstack subnet list
First we need to get the network UUID for private-b network
$ openstack network list
Note that your Network UUID will be unique. In this example the value is: ad8293a8-fe01-4a83-a461-af663853c1f4
Run the following command to boot a nova instance using the m1.tiny flavor, and the newest cirros image that we uploaded earlier in this lab.
We will also attach it to the new private-b network
$ openstack server create --image studentX-cirros035 --flavor m1.tiny --key-name studentX --nic net-id=Your-Network-UUID-Here studentX-instance-cli-1
You can watch nova list to see it go through the provisioning process and become active
$ watch openstack server list
We have now gone through some of the same excercises that we accomplished in Horizon, using strictly the CLIs. The flexibility with which we can interact with OpenStack is a tremendous benefit.
What if we could now take all of these manual steps we've gone through and put them into a template that does them all for us, the same way, every time?
We can do this with Heat. That will be our next lab.