EMAIL SUPPORT

dclessons@dclessons.com

LOCATION

NZ

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

Task:

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

Solution:

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 40.40.40.0/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 :

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


Comment

    You are will be the first.

LEAVE A COMMENT

Please login here to comment.