Create Subnets & Instance via GUI & CLI

Create Subnets & Instance via GUI & CLI

Posted on Jan 13, 2020 (0)

How to Create Subnets & Instance via GUI & CLI


  • Create Network dclessons-Network1 and subnet dclessons-subnet1 with subnet via GUI
  • Create Network dclessons-Network2 and subnet dclessons-subnet2 with subnet 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.

[root@localhost ~]# source keystonerc_admin
[root@localhost ~(keystone_admin)]#

Now create the subnet with name dclessons-subnet2 and network dclessons-Network2 for 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 :

dclessons-port1 : 58332ec9-b0fa-430b-b55b-48fd45fdd253
nova boot --flavour m1.tiny --image cirros --nic port-id=58332ec9-b0fa-430b-b55b-48fd45fdd253 dclessons-vm1

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 allocated to dclessons-por1 is now associated to NIC of VM and this IP is allocated to now instance.


    You are will be the first.


Please login here to comment.