Now that you've deployed OpenStack from my previous post, it's time to configure OpenStack so that we can use it. This will be a short post showing you the commands necessary to create a functional external network for VM's to reach, along with users, local networking, updating security groups, creating flavors and images. It sounds like a lot, but it's easy to do with the CLI.
Lets begin with setting up the external network and admin networking. The subnet-range, 10.245.126.0, are the ip addresses that are floating and will be assigned. Be sure to set the DNS (1.1.1.1 is Cloudflares DNS over TLS, 8.8.8.8 is google's DNS). Notice that the DNS addresses do not need to match between the external and internal network. The DNS listed in the internal network is the DNS that will be imported into the VM's. Without this address, DNS lookup's will fail, so be sure to specify an address.
# Create External Network and external subnet openstack network create --project admin --external --provider-network-type flat --provider-physical-network physnet1 openstack subnet create --project admin --subnet-range 10.245.126.0/24 --allocation-pool start=10.245.126.10,end=10.245.126.200 --dns-nameserver 1.1.1.1 --no-dhcp --gateway 10.245.126.254 public_subnet # Create admin private internal network and subnet openstack network create --project admin private openstack subnet create --project admin --subnet-range 192.168.100.0/24 --dns-nameserver 8.8.8.8 --network private private_subnet # Link the private subnet and external subnet so VM's can be assigned floating IP's. openstack router create --enable --project admin pub-router openstack router set pub-router --external-gateway public openstack router add subnet pub-router private_subnet Next you can create some default flavors for VM's. These were the flavors created in Newton, since Mitaka, default flavors haven't been included. The disk sizes are in Gb's, ram in Mb. openstack flavor create --id 1 --disk 1 --vcpus 1 --public --ram 512 m1.tiny openstack flavor create --id 2 --disk 20 --vcpus 1 --public --ram 2048 m1.small openstack flavor create --id 3 --disk 40 --vcpus 2 --public --ram 4096 m1.medium openstack flavor create --id 4 --disk 80 --vcpus 4 --public --ram 8192 m1.large openstack flavor create --id 5 --disk 160 --vcpus 8 --public --ram 16384 m1.xlarge ​Next lets upload a Ubuntu 16.04 LTS cloud image. Ubuntu, CentOS, Fedora, and other cloud ready images can be found here. wget http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img openstack image create --public --disk-format qcow2 --file xenial-server-cloudimg-amd64-disk1.img Ubuntu-16.04 Lastly, lets update the security group policy. Here we will only update 2 settings: SSH and IPMI (pinging) openstack security group rule create --proto icmp --project admin default openstack security group rule create --proto tcp --project admin --dst-port 22 default And finally we are going to create a VM! First create a keypair if you don't have one already. Then spinup a VM, allocate a floating IP, and associate it to the VM so you can log into it. export INSTANCE_NAME=tmp openstack --insecure keypair create tmp_keypair > ~/tmp_keypair chmod 600 ~/tmp_keypair openstack server create --key-name tmp_keypair --image Ubuntu-16.04 --flavor m1.small --network private $INSTANCE_NAME export FLOATING_IP=$(openstack floating ip create public |grep floating_ip_address | awk '{print $4}') openstack server add floating ip $INSTANCE_NAME "$FLOATING_IP" Here you have it. A few commands to get you fully setup to use OpenStack. Please check out Part 1, Deploying OpenStack using Kolla, where you learned how to deploy OpenStack using docker containers. This method is one of the fastest ways to deploy production grade, secure, OpenStack in minutes. Your comment will be posted after it is approved.
Leave a Reply. |
AuthorJames Benson is an IT professional. Archives
August 2022
Categories
All
|