← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1201964] Re: virtual power driver fails silently when MAC not found

 

** Changed in: nova
       Status: Fix Committed => Fix Released

** Changed in: nova
    Milestone: None => havana-3

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1201964

Title:
  virtual power driver fails silently when MAC not found

Status in Ironic (Bare Metal Provisioning):
  Triaged
Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  When an invalid or not present MAC address is supplied to the virtual
  (ssh) power driver, any attempt to turn that node on just silently
  fails. This makes debugging much harder, because the only exception
  logged comes from the baremetal driver, namely, just that it failed to
  power on the target node. The issue is visible - with some eyestrain -
  only if one enables DEBUG mode. It would be better if there was a
  clear exception saying *why* it failed to power on -- eg, that there
  is no such MAC address.

  An example of how the code misbehaves currently can be seen here. If
  the node's MAC can't be found, _check_for_node() returns '', so
  is_power_on() returns False indicating the power is off, rather than
  an indication that the node doesn't exist.

  142     def _check_for_node(self):
  143         LOG.debug("Looking up Name for Mac address %s." % self._mac_addresses)
  144         self._matched_name = ''
  145         full_node_list = self._get_full_node_list()
  146 
  147         for node in full_node_list:
  148             cmd = self._vp_cmd.get_node_macs.replace('{_NodeName_}', node)
  149             mac_address_list = self._run_command(cmd)
  150 
  151             for mac in mac_address_list:
  152                 if _normalize_mac(mac) in self._mac_addresses:
  153                     self._matched_name = ('"%s"' % node)
  154                     break
  155         return self._matched_name
  ...
  193     def is_power_on(self):                                                                   
  194         LOG.debug("Checking if %s is running" % self._node_name)                             
  195                                                                                              
  196         if not self._check_for_node():                                                       
  197             return False                                                                     
  198                                                                                              
  199         cmd = self._vp_cmd.list_running_cmd                                                  
  200         running_node_list = self._run_command(cmd)                                           
  201                                                                                              
  202         for node in running_node_list:                                                       
  203             if self._matched_name in node:                                                   
  204                 return True                                                                  
  205         return False

To manage notifications about this bug go to:
https://bugs.launchpad.net/ironic/+bug/1201964/+subscriptions