Your first VM
Create a first VM on the all-in-one host from Install. Horizon can do the same (Horizon guide); this page uses the CLI, which is easy to reproduce.
Become root and load the admin credentials:
sudo -i. /etc/hagistack/admin-openrcRun the following commands in this root shell.
12. Check the image and the flavor
Section titled “12. Check the image and the flavor”openstack image listopenstack flavor listExpected result (example): the image cirros-0.6.3-x86_64 is active, and the flavor m1.tiny (RAM 256, Disk 1, VCPUs 1) is listed.
+--------------------------------------+---------------------+--------+| ID | Name | Status |+--------------------------------------+---------------------+--------+| 3f0c... | cirros-0.6.3-x86_64 | active |+--------------------------------------+---------------------+--------+13. Create a VM
Section titled “13. Create a VM”openstack server create --flavor m1.tiny --image cirros-0.6.3-x86_64 \ --network hagistack-tenant --key-name hagistack-key --wait demo1- What it does: creates the VM
demo1on the tenant network and injects the public key ofhagistack-keythrough the metadata service.--waitwaits until it is up. - Security group: without
--security-group, the project’sdefaultgroup is used. HAGISTACK has added SSH and ICMP rules to the admin project’sdefaultgroup.
14. Check that the VM is ACTIVE
Section titled “14. Check that the VM is ACTIVE”openstack server listopenstack server show demo1 -c status -c addressesExpected result: status is ACTIVE, and addresses shows hagistack-tenant=10.10.10.x.
If it is ERROR, see Troubleshooting.
The boot log (including cloud-init’s output):
openstack console log show demo115. Assign a floating IP
Section titled “15. Assign a floating IP”openstack floating ip create hagistack-provideropenstack server add floating ip demo1 FLOATING_IP- Replace
FLOATING_IPwith thefloating_ip_addressprinted by the first command (for example198.51.100.150). - Expected result:
openstack server show demo1 -c addressesshows both the tenant address and the floating IP.
16. Check the security group
Section titled “16. Check the security group”SG=$(openstack security group list --project admin -f value -c ID -c Name | awk '$2=="default"{print $1}')openstack security group rule list "$SG"Every project has a group named default, so a name alone is ambiguous. Look up the ID of the admin project’s default group first (HAGISTACK adds its rules the same way).
Expected result: ingress rules for tcp 22:22 and for icmp.
17. Log in to the VM with SSH
Section titled “17. Log in to the VM with SSH”The CirrOS user is cirros, and the key is /etc/hagistack/hagistack-key. There are two ways in.
Method A: the tenant address, from the metadata namespace
Section titled “Method A: the tenant address, from the metadata namespace”The host that runs the VM (the same host on all-in-one) has an OVN metadata namespace for the tenant network. SSH to the VM’s tenant address from there:
NETID=$(openstack network show hagistack-tenant -f value -c id)ip netns exec ovnmeta-$NETID ssh -i /etc/hagistack/hagistack-key cirros@TENANT_IPTENANT_IP is the 10.10.10.x address from step 14. This is how the all-in-one acceptance test (s66r5c) logged in.
Method B: the floating IP, from the host
Section titled “Method B: the floating IP, from the host”Give the host’s br-ex the provider gateway address; this host then reaches the floating IPs.
198.51.100.1/24 is an example: use your --provider-gateway and the prefix of your --provider-cidr.
ip addr add 198.51.100.1/24 dev br-exip link set br-ex upssh -i /etc/hagistack/hagistack-key cirros@FLOATING_IPThis is how the controller + compute acceptance test (s66r5d) logged in.
The ip addr add setting is lost at a reboot. It is not a production way to provide external access.
Expected result: you log in as cirros without a password and get a $ prompt. In the VM, curl http://169.254.169.254/latest/meta-data/instance-id returns the instance ID from the metadata service.
18. Stop, start and delete the VM
Section titled “18. Stop, start and delete the VM”openstack server stop demo1openstack server show demo1 -c status # SHUTOFFopenstack server start demo1openstack server show demo1 -c status # ACTIVEopenstack server delete --wait demo1The floating IP stays after the VM is deleted. Release it when you no longer need it:
openstack floating ip listopenstack floating ip delete FLOATING_IPRead next
Section titled “Read next”- Horizon guide: the same tasks in the browser
- Add a compute node: add a second host
- OpenStack CLI guide: users, images and networks