Skip to content

Commit

Permalink
Baremetal ensures node is off before powering on
Browse files Browse the repository at this point in the history
During spawn(), ensure that a node is really off before trying to turn
it on. This fixes bug 1178919, in which a node that had previously
gotten stuck in a power-on state (eg, in the BIOS screen) would fail to
spawn() because the baremetal driver would send a power-on request, the
BMC would ignore it, and then baremetal driver would wait indefinitely
for a DHCP request.

Change-Id: Ie73e6ab488abe99c70ad3d149d702577941056d1
  • Loading branch information
AevaOnline committed Jul 7, 2013
1 parent 57236a4 commit 58fe97e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nova/tests/virt/baremetal/test_driver.py
Expand Up @@ -226,6 +226,7 @@ def test_spawn_fails_to_cleanup(self):

self.mox.StubOutWithMock(fake.FakePowerManager, 'activate_node')
self.mox.StubOutWithMock(fake.FakePowerManager, 'deactivate_node')
fake.FakePowerManager.deactivate_node().AndReturn(None)
fake.FakePowerManager.activate_node().AndRaise(test.TestingException)
fake.FakePowerManager.deactivate_node().AndRaise(test.TestingException)
self.mox.ReplayAll()
Expand All @@ -250,6 +251,7 @@ def test_destroy_fails(self):
node = self._create_node()

self.mox.StubOutWithMock(fake.FakePowerManager, 'deactivate_node')
fake.FakePowerManager.deactivate_node().AndReturn(None)
fake.FakePowerManager.deactivate_node().AndRaise(test.TestingException)
self.mox.ReplayAll()

Expand Down
3 changes: 3 additions & 0 deletions nova/virt/baremetal/driver.py
Expand Up @@ -250,6 +250,9 @@ def spawn(self, context, instance, image_meta, injected_files,
)
self.driver.activate_bootloader(context, node, instance,
network_info=network_info)
# NOTE(deva): ensure node is really off before we turn it on
# fixes bug https://code.launchpad.net/bugs/1178919
self.power_off(instance, node)
self.power_on(context, instance, network_info, block_device_info,
node)
self.driver.activate_node(context, node, instance)
Expand Down

0 comments on commit 58fe97e

Please sign in to comment.