Create Subnets & Instance via GUI & CLI
How to Create Subnets & Instance via GUI & CLI
- Create Network dclessons-Network1 and subnet dclessons-subnet1 with subnet 18.104.22.168/24 via GUI
- Create Network dclessons-Network2 and subnet dclessons-subnet2 with subnet 22.214.171.124/24 via CLI
- Create a nova instance with flavor m1.tiny with instance name dclessons-instance1, use image cirros with VM name dclessons-vm1
- Create port name dclessons-port1 and attach it to network dclessons-Network2.
- Now Associate the port created above to instance created dclessons-instance1 and verify.
Login to OpenStack Horizon dashboard.
- On left menu , click on Project | Network | Networks.
- Now click on the + Create Network button. Provide the details for network name and subnet with subnet details as follows.
Once Network and subnets are created for dclessons-Network1 and dclessons-subnet1, it will be visible on dashboard
Now if want to get more details for network you created the click on dclessons-Network1 and you will get all details.
Now in order to create the second network and subnet via CLI you must have to perform the following task from CLI.Take the SSH of OpenStack and follow the below method, and to enable keystone feature for generating token for all services.
Now create the subnet with name dclessons-subnet2 and network dclessons-Network2 for 126.96.36.199/2 network.
First we will create the Network by following command:
Now Create the Subnet under Network you created.
Now verify this via CLI and GUI both to see if all are created as per given task.
Now we will create the port with command neutron port-create for network dclessons-Network2 and also verify via CLI.
When the above command is executed, Neutron allocates unique MAC-add to the port and then Neutron assign the IP address from the subnet you choose while creating the Port.
Now we will create the Instance from GUI to learn and will associate the port we created to it. The specification of Instance is given below.
nova instance with flavor m1.tiny with instance name dclessons-instance1, use image cirros. But before doing that note down the port-id of the port you created which is :
To verify use the following command to verify :
To verify via GUI , Log in to the Horizon dashboard and navigate to Network Topology
Now to launch the VM instance we created , move the mouse pointer over the icon representing the instance and click on Open Console as shown here:
Provide the credential , which is mentioned on screen of instance and the put ifconfig , you will see that IP address 188.8.131.52 allocated to dclessons-por1 is now associated to NIC of VM and this IP 184.108.40.206 is allocated to now instance.