All component extension commands below can be done on any host under only admin role.
![]() | Note |
---|---|
please ensure that the following environment variables are set. These are used by the various clients to access Keystone.
export OS_USERNAME=admin export OS_PASSWORD=adminpassword export OS_TENANT_NAME=admin export OS_AUTH_URL=http://controlnode:5000/v2.0/
|
Settings
We will show information of nova services and quantum components first. And then we add the experiment networks and let DHCP agents host them.
Nova services
gongysh@gongysh-laptop:~$ ./git/nova/bin/nova-manage service list Binary Host Zone Status State Updated_At nova-conductor controlnode nova enabled :-) 2012-12-25 14:50:14 nova-scheduler controlnode nova enabled :-) 2012-12-25 14:50:20 nova-compute HostC nova enabled :-) 2012-12-25 14:50:21 nova-compute HostA nova enabled :-) 2012-12-25 14:50:24
Quantum components and networks
gongysh@gongysh-laptop:~$ quantum component-list +--------------------------------------+--------------------+-------+----------+-------+ | id | type | host | disabled | state | +--------------------------------------+--------------------+-------+----------+-------+ | 0970ff43-b9db-40d1-ba50-81a1d497e39d | DHCP agent | HostC | False | :-) | | 453dab7a-1e2f-8242-ac8a-42126de97e22 | open vSwitch agent | HostC | False | :-) | | 259dab7a-1f4f-4942-ac8a-04251de99e80 | open vSwitch agent | HostA | False | :-) | | 5995730c-c631-4c61-ab4c-5261a139a098 | open vSwitch agent | HostB | False | :-) | | 9b9537e7-2b20-4ecb-9c26-585f1ff44f63 | L3 agent | HostB | False | :-) | | b7b800f7-3300-47f1-a338-f41d3a3f9e83 | DHCP agent | HostA | False | :-) | | f93a9066-d7ef-4240-8dee-c6374fa3f855 | L3 agent | HostA | False | :-) | +--------------------------------------+--------------------+-------+----------+-------+ gongysh@gongysh-laptop:~$ quantum net-list +--------------------------------------+------+--------------------------------------+ | id | name | subnets | +--------------------------------------+------+--------------------------------------+ | 513089f9-977b-4ff4-992b-5ca8e0ee66cb | net2 | 344592a0-2201-425f-991c-410cb45ce24a | | a7750a12-a68e-4b92-9ff1-d72c4d84f8b9 | net1 | 4765cd7c-07ac-40fd-8dc5-ed83109ab167 | | f1323f22-48f1-4610-92b1-9e77fd50dcb8 | net3 | f4e36779-e7aa-4527-a7f7-5d99a24cb1cf | +--------------------------------------+------+--------------------------------------+ gongysh@gongysh-laptop:~$ quantum subnet-list +--------------------------------------+---------+-------------+--------------------------------------------+ | id | name | cidr | allocation_pools | +--------------------------------------+---------+-------------+--------------------------------------------+ | 344592a0-2201-425f-991c-410cb45ce24a | subnet2 | 10.0.2.0/24 | {"start": "10.0.2.2", "end": "10.0.2.254"} | | 4765cd7c-07ac-40fd-8dc5-ed83109ab167 | subnet1 | 10.0.1.0/24 | {"start": "10.0.1.2", "end": "10.0.1.254"} | | f4e36779-e7aa-4527-a7f7-5d99a24cb1cf | subnet3 | 30.0.3.0/24 | {"start": "30.0.3.2", "end": "30.0.3.254"} | +--------------------------------------+---------+-------------+--------------------------------------------+ gongysh@gongysh-laptop:~$ quantum dhcp-agent-list net1 +--------------------------------------+-------+----------+-------+ | id | host | disabled | state | +--------------------------------------+-------+----------+-------+ | 0970ff43-b9db-40d1-ba50-81a1d497e39d | HostC | False | :-) | | b7b800f7-3300-47f1-a338-f41d3a3f9e83 | HostA | False | :-) | +--------------------------------------+-------+----------+-------+ gongysh@gongysh-laptop:~$ quantum dhcp-agent-list net2 +--------------------------------------+-------+----------+-------+ | id | host | disabled | state | +--------------------------------------+-------+----------+-------+ | 0970ff43-b9db-40d1-ba50-81a1d497e39d | HostC | False | :-) | | b7b800f7-3300-47f1-a338-f41d3a3f9e83 | HostA | False | :-) | +--------------------------------------+-------+----------+-------+
'net3' is external network.
Routers and L3 agents
First we will disable the HostA's l3 agent so that it will not be chose as 'default' one. Then we will create two routers and add interfaces. After that we will enable the HostA's L3 agent and let it host a router.
Disable the HostA's L3 agent
When a router is created, we will try to schedule it to an active L3 agent. If there are many active L3 agents, we select one randomly. ( We can design more sophisiticated scheduling algorithm just like we do in nova-schedule.) The chosen L3 agent will play the 'default' role for the router. So for the sake of demo, we need to disable the HostA's L3 agent so that it is not chose as default.
gongysh@gongysh-laptop:~$ quantum component-update f93a9066-d7ef-4240-8dee-c6374fa3f855 --disable Updated component: f93a9066-d7ef-4240-8dee-c6374fa3f855 gongysh@gongysh-laptop:~$ quantum component-list -- --type 'L3 agent' +--------------------------------------+----------+-------+----------+-------+ | id | type | host | disabled | state | +--------------------------------------+----------+-------+----------+-------+ | 9b9537e7-2b20-4ecb-9c26-585f1ff44f63 | L3 agent | HostB | False | :-) | | f93a9066-d7ef-4240-8dee-c6374fa3f855 | L3 agent | HostA | True | :-) | +--------------------------------------+----------+-------+----------+-------+
Create routers, interfaces and gateway ports
We create two routers and add one interface to each of them. They have a gateway port on 'net3' too. Below are their configurations:
gongysh@gongysh-laptop:~$ quantum router-list +--------------------------------------+---------+--------------------------------------------------------+ | id | name | external_gateway_info | +--------------------------------------+---------+--------------------------------------------------------+ | 1b628356-77f0-4de7-a7e8-2a5b66ce3b41 | router1 | {"network_id": "f1323f22-48f1-4610-92b1-9e77fd50dcb8"} | | 4c4c27b2-1f78-4ba8-94ea-219d36594e98 | router2 | {"network_id": "f1323f22-48f1-4610-92b1-9e77fd50dcb8"} | +--------------------------------------+---------+--------------------------------------------------------+ gongysh@gongysh-laptop:~$ quantum router-port-list -c id -c fixed_ips router1 +--------------------------------------+---------------------------------------------------------------------------------+ | id | fixed_ips | +--------------------------------------+---------------------------------------------------------------------------------+ | 37cf2274-8f3b-49d6-9a99-894b6fa88013 | {"subnet_id": "f4e36779-e7aa-4527-a7f7-5d99a24cb1cf", "ip_address": "30.0.3.2"} | | 97532e4e-eeb8-43ca-987b-fb474e88f171 | {"subnet_id": "4765cd7c-07ac-40fd-8dc5-ed83109ab167", "ip_address": "10.0.1.1"} | +--------------------------------------+---------------------------------------------------------------------------------+ gongysh@gongysh-laptop:~$ quantum router-port-list -c id -c fixed_ips router2 +--------------------------------------+---------------------------------------------------------------------------------+ | id | fixed_ips | +--------------------------------------+---------------------------------------------------------------------------------+ | 551b992d-f55b-4be9-8cc6-9f03e32dc079 | {"subnet_id": "344592a0-2201-425f-991c-410cb45ce24a", "ip_address": "10.0.2.1"} | | b1c1d2e6-59a6-4bbe-8df8-b7d145a4cf03 | {"subnet_id": "f4e36779-e7aa-4527-a7f7-5d99a24cb1cf", "ip_address": "30.0.3.3"} | +--------------------------------------+---------------------------------------------------------------------------------+
Get HostA's L3 agent on the play
We enable HostA's L3 agent and let it host the router1.
gongysh@gongysh-laptop:~$ quantum component-update f93a9066-d7ef-4240-8dee-c6374fa3f855 --enable Updated component: f93a9066-d7ef-4240-8dee-c6374fa3f855 gongysh@gongysh-laptop:~$ quantum l3-agent-add-router f93a9066-d7ef-4240-8dee-c6374fa3f855 router1 Added router router1 to L3 agent gongysh@gongysh-laptop:~$ quantum l3-agent-list router2 +--------------------------------------+-------+----------+-------+---------+ | id | host | disabled | state | default | +--------------------------------------+-------+----------+-------+---------+ | 9b9537e7-2b20-4ecb-9c26-585f1ff44f63 | HostB | False | :-) | True | +--------------------------------------+-------+----------+-------+---------+ gongysh@gongysh-laptop:~$ quantum l3-agent-list router1 +--------------------------------------+-------+----------+-------+---------+ | id | host | disabled | state | default | +--------------------------------------+-------+----------+-------+---------+ | f93a9066-d7ef-4240-8dee-c6374fa3f855 | HostA | False | :-) | False | | 9b9537e7-2b20-4ecb-9c26-585f1ff44f63 | HostB | False | :-) | True | +--------------------------------------+-------+----------+-------+---------+
'quantum l3-agent-list <router2>' command is used to show the L3 agents hosting a given router.
Since there are two L3 agents hosting the router1, the router ports will increase compared to the router hosted by only one L3 agent. Each L3 agent will have its own set of interface ports and gateway ports. The 'default' L3 agent will take up the ones like the case where there is just one L3 agent hosting the router and other L3 agents will create new ones.
gongysh@gongysh-laptop:~$ quantum router-port-list -c id -c fixed_ips router1 +--------------------------------------+---------------------------------------------------------------------------------+ | id | fixed_ips | +--------------------------------------+---------------------------------------------------------------------------------+ | 15d29c39-cb0d-43af-9ace-10fae478ff6f | {"subnet_id": "f4e36779-e7aa-4527-a7f7-5d99a24cb1cf", "ip_address": "30.0.3.4"} | | 37cf2274-8f3b-49d6-9a99-894b6fa88013 | {"subnet_id": "f4e36779-e7aa-4527-a7f7-5d99a24cb1cf", "ip_address": "30.0.3.2"} | | 97532e4e-eeb8-43ca-987b-fb474e88f171 | {"subnet_id": "4765cd7c-07ac-40fd-8dc5-ed83109ab167", "ip_address": "10.0.1.1"} | | d005cb7e-6acc-49eb-b43f-4fdbbad27868 | {"subnet_id": "4765cd7c-07ac-40fd-8dc5-ed83109ab167", "ip_address": "10.0.1.4"} | +--------------------------------------+---------------------------------------------------------------------------------+ gongysh@gongysh-laptop:~$ quantum router-port-list -c id -c fixed_ips router2 +--------------------------------------+---------------------------------------------------------------------------------+ | id | fixed_ips | +--------------------------------------+---------------------------------------------------------------------------------+ | 551b992d-f55b-4be9-8cc6-9f03e32dc079 | {"subnet_id": "344592a0-2201-425f-991c-410cb45ce24a", "ip_address": "10.0.2.1"} | | b1c1d2e6-59a6-4bbe-8df8-b7d145a4cf03 | {"subnet_id": "f4e36779-e7aa-4527-a7f7-5d99a24cb1cf", "ip_address": "30.0.3.3"} | +--------------------------------------+---------------------------------------------------------------------------------+
Just as shown by above command output, there are two L3 agents hosting the router1, so we have two sets of interface ports and gateway ports.
Experiment VMs
We will create some VMs on each compute node and network: VMA_1 on HostA and net1, VMA_2 on HostA and net2, VMC_1 on HostC and net1, VMC_2 on HostC and net2.
Boot VMs
gongysh@gongysh-laptop:~$ nova boot --image tty --flavor 1 VMA_1 --availability-zone=nova:HostA \ --nic net-id=a7750a12-a68e-4b92-9ff1-d72c4d84f8b9 gongysh@gongysh-laptop:~$ nova boot --image tty --flavor 1 VMA_2 --availability-zone=nova:HostA \ --nic net-id=513089f9-977b-4ff4-992b-5ca8e0ee66cb gongysh@gongysh-laptop:~$ nova boot --image tty --flavor 1 VMC_1 --availability-zone=nova:HostC \ --nic net-id=a7750a12-a68e-4b92-9ff1-d72c4d84f8b9 gongysh@gongysh-laptop:~$ nova boot --image tty --flavor 1 VMC_2 --availability-zone=nova:HostC \ --nic net-id=513089f9-977b-4ff4-992b-5ca8e0ee66cb gongysh@gongysh-laptop:~$ nova list +--------------------------------------+-------+--------+---------------+ | ID | Name | Status | Networks | +--------------------------------------+-------+--------+---------------+ | 2464c6e2-9fdb-4c3a-8bc9-0ac64250b967 | VMA_1 | ACTIVE | net1=10.0.1.5 | | 0f787be5-c6f1-4e3c-b099-47b5bce05429 | VMA_2 | ACTIVE | net2=10.0.2.4 | | 41d13df4-a4d8-40fb-9a35-82a286c19c0b | VMC_1 | BUILD | net1=10.0.1.6 | | 7b340f87-f122-4461-8491-7cc0922a887f | VMC_2 | ACTIVE | net2=10.0.2.5 | +--------------------------------------+-------+--------+---------------+
After this, we can show the route tables of VMs:
gongysh@gongysh-laptop:~$ sudo ip netns exec qdhcp-513089f9-977b-4ff4-992b-5ca8e0ee66cb ssh root@10.0.2.4 The authenticity of host '10.0.2.4 (10.0.2.4)' can't be established. RSA key fingerprint is 26:77:78:06:24:ac:0e:9e:f7:7a:2e:2d:ca:8e:85:30. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.2.4' (RSA) to the list of known hosts. root@10.0.2.4's password: Chop wood, carry water. # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.2.0 * 255.255.255.0 U 0 0 0 eth0 default 10.0.2.1 0.0.0.0 UG 0 0 0 eth0
sudo ip netns exec qdhcp-a7750a12-a68e-4b92-9ff1-d72c4d84f8b9 ssh root@10.0.1.5 The authenticity of host '10.0.1.5 (10.0.1.5)' can't be established. RSA key fingerprint is 92:82:a8:1a:90:18:d2:25:3d:94:3a:d7:92:31:03:94. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.1.5' (RSA) to the list of known hosts. root@10.0.1.5's password: Chop wood, carry water. # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.1.0 * 255.255.255.0 U 0 0 0 eth0 default 10.0.1.4 0.0.0.0 UG 0 0 0 eth0
gongysh@gongysh-laptop:~$ sudo ip netns exec qdhcp-a7750a12-a68e-4b92-9ff1-d72c4d84f8b9 ssh root@10.0.1.6 The authenticity of host '10.0.1.6 (10.0.1.6)' can't be established. RSA key fingerprint is 97:84:ee:bb:7b:43:d9:1f:82:f1:0c:2c:81:32:b1:cd. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.1.6' (RSA) to the list of known hosts. root@10.0.1.6's password: Chop wood, carry water. # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.1.0 * 255.255.255.0 U 0 0 0 eth0 default 10.0.1.1 0.0.0.0 UG 0 0 0 eth0
gongysh@gongysh-laptop:~$ sudo ip netns exec qdhcp-513089f9-977b-4ff4-992b-5ca8e0ee66cb ssh root@10.0.2.5 The authenticity of host '10.0.2.5 (10.0.2.5)' can't be established. RSA key fingerprint is dc:8d:ee:6c:32:44:5b:7b:2d:a9:d0:3f:fd:18:34:4a. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.0.2.5' (RSA) to the list of known hosts. root@10.0.2.5's password: Chop wood, carry water. # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.2.0 * 255.255.255.0 U 0 0 0 eth0 default 10.0.2.1 0.0.0.0 UG 0 0 0 eth0
Comparing the route tables of VMA_1 and VMA_2, we found VMA_2 (10.0.2.4) is using default gateway IP (10.0.2.1) of subnet2, VMA_1 (10.0.1.5) is using the HostA's L3 agent's interface port IP as default gateway. VMC_1 (10.0.1.6) is using the default gateway of subnet1, and VMC_2 is also using the default gateway of subnet2. HostA's DHCP agent is giving the VMA_1 the default gateway from the L3 agent with the same host name for the VM on the same host.
Add floating IPs
Floating IPs for colocated VMs will be implemented on the colocated L3 agents.
gongysh@gongysh-laptop:~$ quantum floatingip-list +--------------------------------------+------------------+---------------------+--------------------------------------+ | id | fixed_ip_address | floating_ip_address | port_id | +--------------------------------------+------------------+---------------------+--------------------------------------+ | 07d46311-922a-4615-9681-0537b7bb59ed | 10.0.1.5 | 30.0.3.5 | 3fdc936f-a902-42b4-8c14-a28904e8ca64 | | 3adc2d9a-8db2-4205-8f26-fccb38e3675a | 10.0.1.6 | 30.0.3.6 | 81540c1d-3023-4fcf-9dbe-91ca284cca0f | +--------------------------------------+------------------+---------------------+--------------------------------------+
We can find the (30.0.3.5) for VMA_1 is implemented on HostA's L3 agent, and 30.0.3.6 for VMC_1 is implemented on HostC's L3 agent. VMA_1 is a colocated VM, however VMC_1 is not.