Ask Your Question
0

Nova Detach/Attach Interface via Dashboard

asked 2015-08-17 05:41:35 -0500

Black-Pixel gravatar image

updated 2015-08-17 05:51:41 -0500

Is there any way to perform the following operations from the dashboard (Horizon)?

nova interface-detach demo-intance1 demo-net-port-id
nova interface-attach --net-id demo-net2-id demo-instance1

I could not find anything but I thought something essential like this has to work somehow. The scenario is that I want to move an instance from one network to another.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-08-17 08:16:05 -0500

dbaxps gravatar image

Schema bellow is addressing your question, but works only via CLI ( I guess so )

# nova interface-list CirrOSDev034
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
| Port State | Port ID                              | Net ID                               | IP addresses | MAC Addr          |
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
| ACTIVE     | e4226317-117e-44ac-b4a0-fb4ebc61a528 | cdbcae12-3bfa-4690-a653-e7541fc16b77 | 50.0.0.13    | fa:16:3e:a2:32:0b |
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
[root@fedora22wks ~(keystone_demo)]# nova interface-detach CirrOSDev034 e4226317-117e-44ac-b4a0-fb4ebc61a528

Causes loozing floating IP


[root@fedora22wks ~(keystone_demo)]# neutron net-list
+--------------------------------------+-------------+-----------------------------------------------------+
| id                                   | name        | subnets                                             |
+--------------------------------------+-------------+-----------------------------------------------------+
| ee4a48e9-2209-41df-8b57-cdfa3a4d23a8 | private_net | 1afe4413-ca33-4f4f-a3db-d4fcd43c6160 30.0.0.0/24    |
| cdbcae12-3bfa-4690-a653-e7541fc16b77 | demo_net    | 7de660f0-09aa-4e4c-9cc3-4e3386304814 50.0.0.0/24    |
| f7715d67-072b-4830-bf94-c6ef0fe6d81c | public      | 248eae76-7411-42de-baed-f24b775afdd9 192.168.1.0/24 |
| e42fb9de-8b36-4765-8b5b-7263310e5fe6 | private     | f141a1a3-75b2-4a67-82d3-0378acc0f94f 10.0.0.0/24    |
+--------------------------------------+-------------+-----------------------------------------------------+

Assigning new floating IP


[root@fedora22wks ~(keystone_demo)]# nova interface-attach --net-id ee4a48e9-2209-41df-8b57-cdfa3a4d23a8   ed311233-c17a-48bd-bc6e-14954504251c

[root@fedora22wks ~(keystone_demo)]# nova interface-list CirrOSDev034
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
| Port State | Port ID                              | Net ID                               | IP addresses | MAC Addr          |
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+
| ACTIVE     | d3df134c-803d-41d3-a504-eb68122a40ce | ee4a48e9-2209-41df-8b57-cdfa3a4d23a8 | 30.0.0.11    | fa:16:3e:2f:31:af |
+------------+--------------------------------------+--------------------------------------+--------------+-------------------+

[root@fedora22wks ~(keystone_demo)]# nova list
+--------------------------------------+----------------+---------+------------+-------------+-----------------------------------+
| ID                                   | Name           | Status  | Task State | Power State | Networks                          |
+--------------------------------------+----------------+---------+------------+-------------+-----------------------------------+
| f96949ab-71cf-4cbf-8d7b-41426dd4d706 | CentOSVM71     | SHUTOFF | -          | Shutdown    | demo_net=50.0.0.14, 192.168.1.154 |
| ed311233-c17a-48bd-bc6e-14954504251c | CirrOSDev034   | ACTIVE  | -          | Running     | private_net=30.0.0.11             |
| df74f0f9-e53e-4f84-999f-85e361c18cf3 | VF22Dev        | ACTIVE  | -          | Running     | demo_net=50.0.0.12, 192.168.1.152 |
| 06609a4b-ad20-402c-a8b7-fc068a939791 | WindowsSRV2012 | SHUTOFF | -          | Shutdown    | demo_net=50.0.0.15                |
+--------------------------------------+----------------+---------+------------+-------------+-----------------------------------+
[root@fedora22wks ~(keystone_demo)]# neutron port-list --device-id ed311233-c17a-48bd-bc6e-14954504251c
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                        |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------+
| d3df134c-803d-41d3-a504-eb68122a40ce |      | fa:16:3e:2f:31:af | {"subnet_id": "1afe4413-ca33-4f4f-a3db-d4fcd43c6160", "ip_address": "30.0.0.11"} |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------------+
[root@fedora22wks ~(keystone_demo)]#  neutron floatingip-create public
Created a new floatingip:
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| fixed_ip_address    |                                      |
| floating_ip_address | 192.168.1.158                        |
| floating_network_id | f7715d67-072b-4830-bf94-c6ef0fe6d81c |
| id                  | 363748e5-480d-4470-a9e3-0db1217a0fdc |
| port_id             |                                      |
| router_id           |                                      |
| status              | DOWN                                 |
| tenant_id           | 5ab51a14a8c946dc8028e9f5c4757b87     |
+---------------------+--------------------------------------+
[root@fedora22wks ~(keystone_demo)]# neutron floatingip-associate 363748e5-480d-4470-a9e3-0db1217a0fdc d3df134c-803d-41d3-a504-eb68122a40ce

 [root@fedora22wks ~(keystone_demo)]# nova stop  CirrOSDev034

 [root@fedora22wks ~(keystone_demo)]# nova start  CirrOSDev034

[root@fedora22wks ~(keystone_demo)] # ping 192.168.1.158
PING 192.168.1.158 (192.168.1.158) 56(84) bytes of data.
64 bytes from 192.168.1.158: icmp_seq=1 ttl=63 time=0.382 ms
64 bytes from 192.168.1.158: icmp_seq=2 ttl=63 time=0.203 ms
64 bytes from 192.168.1.158: icmp_seq=3 ttl=63 time=0.202 ms
64 bytes from 192.168.1.158: icmp_seq=4 ttl=63 time=0.139 ms
64 bytes from 192.168.1.158: icmp_seq=5 ttl=63 time=0.181 ms
64 bytes from 192.168.1.158: icmp_seq=6 ttl=63 time=0.188 ms
64 bytes from 192.168.1.158: icmp_seq=7 ttl=63 time=0.544 ms
^C
--- 192.168.1.158 ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 5999ms
rtt min/avg/max/mdev = 0.139/0.262/0.544/0.136 ms
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-08-17 05:41:35 -0500

Seen: 6,842 times

Last updated: Aug 17 '15