Browse code

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

Alexander Gordeev authored on 2014/04/03 21:17:58
Showing 1 changed files
... ...
@@ -315,8 +315,13 @@ function enroll_vms {
315 315
     IRONIC_NET_ID=$(neutron net-list | grep private | get_field 1)
316 316
     local idx=0
317 317
 
318
-    # work around; need to know what netns neutron uses for private network
319
-    neutron port-create private
318
+    # work around; need to know what netns neutron uses for private network.
319
+    # Without knowing how to interconnect the networks, PXE won't work properly
320
+    # for fake baremetal instances. The network should be configured prior all
321
+    # the instances operation. If we don't do this, the first port creation
322
+    # only happens in the middle of fake baremetal instance's spawning by nova,
323
+    # so we'll end up with unbootable fake baremetal VM due to broken PXE.
324
+    PORT_ID=$(neutron port-create private | grep " id " | get_field 2)
320 325
 
321 326
     while read MAC; do
322 327
 
... ...
@@ -357,6 +362,10 @@ function enroll_vms {
357 357
 
358 358
     sudo ovs-vsctl -- --if-exists del-port ovs-tap1 -- add-port br-int ovs-tap1 tag=$TAG_ID
359 359
     sudo ovs-vsctl -- --if-exists del-port brbm-tap1 -- add-port $IRONIC_VM_NETWORK_BRIDGE brbm-tap1
360
+
361
+    # Remove the port needed only for workaround. For additional info read the
362
+    # comment at the beginning of this function
363
+    neutron port-delete $PORT_ID
360 364
 }
361 365
 
362 366
 function configure_tftpd {