[1] FLOW OF A VM ---------------- 0. List different Nova flavors $ nova flavor-list 1. Boot a guest with flavor 1 (i.e. 512 MB memory, and a small disk) $ GLANCE_IMG=$(glance image-list | grep "cirros\ " | awk '{print $2;}') $ nova boot --flavor 1 \ --image $GLANCE_IMG cirr-guest1 2. Ensure it's active: $ nova list And also check in the instance's serial console log, if it *really* acquired DHCP lease: $ nova console-log cirr-guest1 [...] Starting network... udhcpc (v1.20.1) started Sending discover... Sending select for 12.0.0.2... Lease of 12.0.0.2 obtained, lease time 120 deleting routers route: SIOCDELRT: No such process adding dns 192.169.142.1 cirros-ds 'net' up at 13.34 [...] 3. Try SSHing using private IP via namespace # List namespaces $ ip netns qdhcp-c538ce2e-0d90-49a8-a1e4-219745d6079b qrouter-f2df2518-78cb-4ad2-917c-3c1b0e994de7 # Reach internet from the router namespace: $ ip netns exec qrouter-f2df2518-78cb-4ad2-917c-3c1b0e994de7 ping google.com # SSH into the private IP via the router namespace $ ip netns exec qrouter-f2df2518-78cb-4ad2-917c-3c1b0e994de7 ssh cirros@12.0.0.2 4. Create a Floating IP on the "external" network, and list: $ neutron floatingip-create ext $ neutron floatingip-list 5. Pull Nova guest ID, Floating IP ID and the VM port ID into an environment variables : $ NOVA_GUEST_ID=$(nova list | grep cirr-guest1 | awk '{print $2;}') $ FLOATINGIP_ID=$(neutron floatingip-list | grep 192.169.142.11 | awk '{print $2}') $ VM_PORT_ID=$(neutron port-list --device-id $NOVA_GUEST_ID | grep ip_address | awk '{print $2;}') 6. Associate Floating and Fixed IP (this will take a little bit of time); and do a couple of 'list' operations: === # Associate: $ neutron floatingip-associate $FLOATINGIP_ID $VM_PORT_ID # List the Floating IP addresses to see mapping: $ neutron floatingip-list # List Nova instances: $ nova list $ ping 192.169.142.11 PING 192.169.142.11 (192.169.142.11) 56(84) bytes of data. 64 bytes from 192.169.142.11: icmp_seq=1 ttl=63 time=13.2 ms 64 bytes from 192.169.142.11: icmp_seq=2 ttl=63 time=1.50 ms === 7. SSH into the instance via its floating IP ID === $ ssh cirros@192.169.142.11 $ sudo -i # shows only the Fixed IP $ ifconfig -a === Some commands to run ~~~~~~~~~~~~~~~~~~~~ $ neutron net-list $ neutron subnet-list # List namespaces(DHCP namespace, Router namespace) $ ip netns [2] BOOT FROM SNAPSHOT ----------------------- Create a snapshot of a running instance: $ nova image-create cirr-guest2 snap1-of-cirr-guest2 List in Glance, to see if it shows up: $ glance image-list Boot via this image: $ nova boot --flavor 1 --image 4cdc2f39-2c64-4145-8011-3c0bb58ff05f vm3 [3] NEUTRON TENANT NETWORKS CREATION ------------------------------------ 1. Source the admin tenant credentials, and pull the SERVICES tenant info into a variable $ . keystonerc_admin 2. Create a tenant $ keystone tenant-create --name demo1 $ keystone user-create --name tuser1 --pass fedora $ keystone user-role-add --user tuser1 --role user --tenant demo1 3. Create an RC file for this user and source the credentials: $ cat >> ~/keystonerc_tuser1 <