I think the port should not be deleted when the interface is detched,if the port is created independently.

Asked by skywalker

Hi:

I created a port,attached the interface to a VM,and then detached the interface from the VM.I found that the port was deleted.

I think the port should not be deleted when the interface is detched,if the port is created independently.

Thank you.

Revision history for this message
Keith Tobin (keith-tobin) said :
#1

I would also post this in the quantum quantum section.

Revision history for this message
skywalker (sunzuohua) said :
#2

I view the codes.

In the method nova.compute.manager.ComputeManager.detach_interface(),the method nova.network.quantumv2.api.API.deallocate_port_for_instance() is called where the port is deleted.

def deallocate_port_for_instance(self, context, instance, port_id,
                                     conductor_api=None):
        try:
            quantumv2.get_client(context).delete_port(port_id)
        except Exception as ex:
            LOG.exception(_("Failed to delete quantum port %(port_id)s ") %
                          locals())

This may be the problem.

Revision history for this message
Armando Migliaccio (armando-migliaccio) said :
#3

Currently there is no distinction between a port created explicitly by a user or admin and a port created by the infrastructure (in this case Nova), so all ports are equal and disposed of when the resource that is using it is destroyed (in this case a VM).

I think it is fair to create a bug report and mark the bug as wishlist or opinion to see what people think about this particular issue.

Revision history for this message
Armando Migliaccio (armando-migliaccio) said :
#4

I believe the bug reports above are somewhat related to the issue we are seeing here, i.e. the port gets deleted when the VM is destroyed.

Revision history for this message
Armando Migliaccio (armando-migliaccio) said :
#5

They just help provide a little more context.

Can you help with this problem?

Provide an answer of your own, or ask skywalker for more information if necessary.

To post a message you must log in.