115cf068a6d48cdf8b0d20a3c5a779bb8120aa9b
Currently, when attaching neutron pre-existing port to an instance, if the attach failed, it will also be deleted in Neutron side due to bad judgement of the who created the port by reading not up-to-date info_cache. The workflow starts at: https://github.com/openstack/nova/blob/9ed0d6114/nova/network/neutronv2/api.py#L881 ordered_ports and preexisting_port_ids are the same when attaching a preexisting port to an instance and it calls https://github.com/openstack/nova/blob/9ed0d6114/nova/network/base_api.py#L246 which calls back into the neutronv2 api code https://github.com/openstack/nova/blob/9ed0d6114/nova/network/neutronv2/api.py#L1274 and at this point, compute_utils.refresh_info_cache_for_instance(context, instance) won't have the newly attached port in it(see debug log: http://paste.openstack.org/show/613232/) because _build_network_info_model() is going to process it. The instance obj in memoryt with old info_cache will be used at rollback process and causing the miss-judging. This patch fixed it by updating instance.info_cache to the new ic after it is created. Co-Authored-By: huangtianhua@huawei.com Change-Id: Ib323b74d4ea1e874b476ab5addfc6bc79cb7c751 closes-bug: #1645175
========================
Team and repository tags
========================
.. image:: https://governance.openstack.org/badges/nova.svg
:target: https://governance.openstack.org/reference/tags/index.html
.. Change things from this point on
OpenStack Nova
==============
OpenStack Nova provides a cloud computing fabric controller,
supporting a wide variety of compute technologies, including:
libvirt (KVM, Xen, LXC and more), Hyper-V, VMware, XenServer
and OpenStack Ironic.
OpenStack Nova is distributed under the terms of the Apache
License, Version 2.0. The full terms and conditions of this
license are detailed in the LICENSE file.
API
---
To learn how to use Nova's API, consult the documentation
available online at:
https://developer.openstack.org/api-guide/compute/
https://developer.openstack.org/api-ref/compute/
For more information on OpenStack APIs, SDKs and CLIs,
please see:
https://www.openstack.org/appdev/
https://developer.openstack.org/
Operators
---------
To learn how to deploy and configure OpenStack Nova, consult the
documentation available online at:
https://docs.openstack.org
For information about the different compute (hypervisor) drivers
supported by Nova, please read:
https://docs.openstack.org/developer/nova/feature_classification.html
In the unfortunate event that bugs are discovered, they should
be reported to the appropriate bug tracker. If you obtained
the software from a 3rd party operating system vendor, it is
often wise to use their own bug tracker for reporting problems.
In all other cases use the master OpenStack bug tracker,
available at:
https://bugs.launchpad.net/nova
Developers
----------
For information on how to contribute to Nova, please see the
contents of the CONTRIBUTING.rst.
Any new code must follow the development guidelines detailed
in the HACKING.rst file, and pass all unit tests.
Further developer focused documentation is available at:
https://docs.openstack.org/developer/nova/
Description
Languages
Python
97.5%
Smarty
2.3%
Shell
0.2%