From: aticig Date: Wed, 22 Jun 2022 19:03:37 +0000 (+0300) Subject: Find the interface ports regardless of VM's existence X-Git-Tag: v12.0.0rc1~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=36cad669a99ed1655dc39b1c37aea6197ddbab55;p=osm%2FRO.git Find the interface ports regardless of VM's existence This patch will find and delete the network interface ports regardless of VM's existence. In healing feature, when the VM is deleted manually, network interfaces ports still exist in the Openstack Cloud. If we check the network ports' presence according to vm_id, those ports are not deleted and heal operation fails. This patch will find all the ports, than deletion required interface will be deleted. Change-Id: I139559844aa148109588f70f1472ee2e07d7df67 Signed-off-by: aticig --- diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index ef5c7409..0a390412 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -2295,7 +2295,7 @@ class vimconnector(vimconn.VimConnector): try: k_item, _, k_id = k.partition(":") if k_item == "port": - port_dict = self.neutron.list_ports(device_id=vm_id) + port_dict = self.neutron.list_ports() existing_ports = [ port["id"] for port in port_dict["ports"] if port_dict ] diff --git a/releasenotes/notes/Fix_interface_port_deletion-dc3f5f5bccb9a019.yaml b/releasenotes/notes/Fix_interface_port_deletion-dc3f5f5bccb9a019.yaml new file mode 100644 index 00000000..1bfc4096 --- /dev/null +++ b/releasenotes/notes/Fix_interface_port_deletion-dc3f5f5bccb9a019.yaml @@ -0,0 +1,24 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +####################################################################################### +--- +other: + - | + This patch will find and delete the network interface ports regardless of VM's existence. + In healing feature, when the VM is deleted manually, network interfaces ports are still + exists in the Openstack Cloud. If we check the network ports' existence according to vm_id, + those ports are not deleted and heal operation fails. This patch will find all the ports, + deletion required interface will be deleted.