← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1441419] [NEW] port 'binding:host_id' can't be removed when VM is deleted

 

Public bug reported:

reproduce this problem:
1. create a neutron port
2. use this port to boot a VM
3. delete this VM
4. we can see port still exist, but the 'binding:host_id' can't be removed

the reason is that in _unbind_ports, when it update the port, it set
'port_req_body['port']['binding:host_id'] = None', but for neutron, when
update the port, if the attribute is None, it will not change

    def _unbind_ports(self, context, ports,
                      neutron, port_client=None):

        port_binding = self._has_port_binding_extension(context,
                            refresh_cache=True, neutron=neutron)
        if port_client is None:
            # Requires admin creds to set port bindings
            port_client = (neutron if not port_binding else
                           get_client(context, admin=True))
        for port_id in ports:
            port_req_body = {'port': {'device_id': '', 'device_owner': ''}}
            if port_binding:
                port_req_body['port']['binding:host_id'] = None

** Affects: nova
     Importance: Undecided
     Assignee: shihanzhang (shihanzhang)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => shihanzhang (shihanzhang)

-- 
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/1441419

Title:
  port 'binding:host_id' can't be removed when VM is deleted

Status in OpenStack Compute (Nova):
  New

Bug description:
  reproduce this problem:
  1. create a neutron port
  2. use this port to boot a VM
  3. delete this VM
  4. we can see port still exist, but the 'binding:host_id' can't be removed

  the reason is that in _unbind_ports, when it update the port, it set
  'port_req_body['port']['binding:host_id'] = None', but for neutron,
  when update the port, if the attribute is None, it will not change

      def _unbind_ports(self, context, ports,
                        neutron, port_client=None):

          port_binding = self._has_port_binding_extension(context,
                              refresh_cache=True, neutron=neutron)
          if port_client is None:
              # Requires admin creds to set port bindings
              port_client = (neutron if not port_binding else
                             get_client(context, admin=True))
          for port_id in ports:
              port_req_body = {'port': {'device_id': '', 'device_owner': ''}}
              if port_binding:
                  port_req_body['port']['binding:host_id'] = None

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


Follow ups

References