From 9434eebb85ac053a7a59ebb9d730058bc6f3a363 Mon Sep 17 00:00:00 2001 From: sousaedu Date: Mon, 22 Nov 2021 14:09:15 +0000 Subject: [PATCH] Fix bug 1805 - adding swap disks Change-Id: I447a1da59d1efdd9209950a185b819e32c696012 Signed-off-by: sousaedu --- NG-RO/osm_ng_ro/ns.py | 5 +++++ .../osm_rovim_openstack/vimconn_openstack.py | 3 +++ .../notes/fix_bug_1805-8239712f72e96634.yaml | 20 +++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 releasenotes/notes/fix_bug_1805-8239712f72e96634.yaml diff --git a/NG-RO/osm_ng_ro/ns.py b/NG-RO/osm_ng_ro/ns.py index d42433ba..f943c2a8 100644 --- a/NG-RO/osm_ng_ro/ns.py +++ b/NG-RO/osm_ng_ro/ns.py @@ -563,6 +563,11 @@ class Ns(object): flavor_data["ephemeral"] = int( storage.get("size-of-storage", 0) ) + elif ( + storage.get("type-of-storage") + == "etsi-nfv-descriptors:swap-storage" + ): + flavor_data["swap"] = int(storage.get("size-of-storage", 0)) if target_flavor.get("guest-epa"): extended = {} diff --git a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py index 297e14be..4869da16 100644 --- a/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py +++ b/RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py @@ -1178,6 +1178,7 @@ class vimconnector(vimconn.VimConnector): flavor_dict["vcpus"], flavor_dict["disk"], flavor_dict.get("ephemeral", 0), + flavor_dict.get("swap", 0), ) # numa=None extended = flavor_dict.get("extended", {}) @@ -1202,6 +1203,7 @@ class vimconnector(vimconn.VimConnector): flavor.vcpus, flavor.disk, flavor.ephemeral, + flavor.swap, ) if flavor_data == flavor_target: return flavor.id @@ -1357,6 +1359,7 @@ class vimconnector(vimconn.VimConnector): vcpus=vcpus, disk=flavor_data.get("disk", 0), ephemeral=flavor_data.get("ephemeral", 0), + swap=flavor_data.get("swap", 0), is_public=flavor_data.get("is_public", True), ) # add metadata diff --git a/releasenotes/notes/fix_bug_1805-8239712f72e96634.yaml b/releasenotes/notes/fix_bug_1805-8239712f72e96634.yaml new file mode 100644 index 00000000..5a3fcd79 --- /dev/null +++ b/releasenotes/notes/fix_bug_1805-8239712f72e96634.yaml @@ -0,0 +1,20 @@ +####################################################################################### +# 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. +####################################################################################### +--- +fixes: + - | + Fixing bug 1805 - this fix allows for the creation of swap disks. -- 2.17.1