From 1ab92d9f228326eb469ab9c9b466089347752e95 Mon Sep 17 00:00:00 2001 From: Alexander Gordeev Date: Thu, 3 Apr 2014 16:17:58 +0400 Subject: [PATCH] Delete unused neutron port For purpose of creating fake baremetal nodes environment for ironic functional/integration testing the unused neutron port to be created. Adding the removal part and helpful comments. Change-Id: I855ba1dbbf13f343d513ba387716996d6e4c20a6 --- lib/ironic | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/ironic b/lib/ironic index 979420f2cb..0e29e8c0ed 100644 --- a/lib/ironic +++ b/lib/ironic @@ -315,8 +315,13 @@ function enroll_vms { IRONIC_NET_ID=$(neutron net-list | grep private | get_field 1) local idx=0 - # work around; need to know what netns neutron uses for private network - neutron port-create private + # work around; need to know what netns neutron uses for private network. + # Without knowing how to interconnect the networks, PXE won't work properly + # for fake baremetal instances. The network should be configured prior all + # the instances operation. If we don't do this, the first port creation + # only happens in the middle of fake baremetal instance's spawning by nova, + # so we'll end up with unbootable fake baremetal VM due to broken PXE. + PORT_ID=$(neutron port-create private | grep " id " | get_field 2) while read MAC; do @@ -357,6 +362,10 @@ function enroll_vms { sudo ovs-vsctl -- --if-exists del-port ovs-tap1 -- add-port br-int ovs-tap1 tag=$TAG_ID sudo ovs-vsctl -- --if-exists del-port brbm-tap1 -- add-port $IRONIC_VM_NETWORK_BRIDGE brbm-tap1 + + # Remove the port needed only for workaround. For additional info read the + # comment at the beginning of this function + neutron port-delete $PORT_ID } function configure_tftpd {