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
diff --git a/lib/ironic b/lib/ironic
index 979420f..0e29e8c 100644
--- a/lib/ironic
+++ b/lib/ironic
@@ -315,8 +315,13 @@
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 @@
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 {