As admin user
1. Create Flavors as required
. admin-openrc
openstack flavor create m1.nano --ram 512 --vcpus 1 --disk 10
openstack flavor create m1.micro --ram 1024 --vcpus 1 --disk 10
openstack flavor create m1.mini --ram 1024 --vcpus 2 --disk 10
openstack flavor create m1.small --ram 2048 --vcpus 2 --disk 20
openstack flavor create m1.medium --ram 4096 --vcpus 2 --disk 40
openstack flavor create m1.large --ram 8192 --vcpus 2 --disk 40
openstack flavor create m1.xlarge --ram 16384 --vcpus 8 --disk 80
2. Create a provider network “External-Network”
openstack network create --share --external --provider-physical-network provider --provider-network-type flat External-Network
3. Create a subnet associated with provider network
openstack subnet create --network External-Network --allocation-pool start=10.99.1.193,end=10.99.1.253 --dns-nameserver 10.99.0.1 --gateway 10.99.0.1 --subnet-range 10.99.0.0/16 External-Subnet
As ‘homeuser’
1. Create a network for homelab use
. user-openrc
openstack network create Internal
openstack subnet create --network Internal --dns-nameserver 10.99.0.1 --gateway 172.168.1.1 --subnet-range 172.168.1.0/24 Internal-Subnet
2. Create a router to route traffic between homelab subnet and External-Network
openstack router create Router
openstack router add subnet Router Internal-Subnet
openstack router set Router --external-gateway External-Network
3. Enable SSH and ICMP traffic – Update rule for default security group.
openstack security group rule create --remote-ip 0.0.0.0/0 --dst-port 22 --protocol tcp --ingress --ethertype ipv4 --description "Allow SSH" default
openstack security group rule create --remote-ip 0.0.0.0/0 --protocol icmp --ingress --ethertype ipv4 --description "Allow ICMP" default
Get the network id of the ‘Internal’ network and launch a VM
# openstack network list
+--------------------------------------+------------------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+------------------+--------------------------------------+
| 2c6b1d67-f608-4665-ba78-fad21831d957 | External-Network | 49e7f440-002b-4bf2-9d9a-e6ea70ccec88 |
| b5eea23f-25e2-43fc-b680-b7bb346a5a98 | Internal | a963a89e-544b-47d7-be77-2244ac792613 |
+--------------------------------------+------------------+--------------------------------------+
# openstack server create --image cirros --flavor m1.micro --nic net-id=b5eea23f-25e2-43fc-b680-b7bb346a5a98 TestVM
Login to horizon and ping external site from the console of Cirros VM. (http://controller/horizon/auth/login/)