X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fvimconn.py;h=bdfcb150e97db5c8965cf1abd67e5205532849e3;hb=00e3df7ab3391d92299ab439d7517f8cb9f47a81;hp=1f6c4d1ef5703540aac2dc62fd3397816716773d;hpb=0a1437e0b473edfddbf8b9e269495121c2fcb188;p=osm%2FRO.git diff --git a/osm_ro/vimconn.py b/osm_ro/vimconn.py index 1f6c4d1e..bdfcb150 100644 --- a/osm_ro/vimconn.py +++ b/osm_ro/vimconn.py @@ -33,6 +33,7 @@ import paramiko import socket import StringIO import yaml +import sys from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText @@ -486,9 +487,9 @@ class vimconnector(): the VLAN tag to be used. In case net_id is provided, the internal network vlan is used for tagging VF 'type': (mandatory) can be one of: 'virtual', in this case always connected to a network of type 'net_type=bridge' - 'PF' (passthrough): depending on VIM capabilities it can be connected to a data/ptp network ot it + 'PCI-PASSTHROUGH' or 'PF' (passthrough): depending on VIM capabilities it can be connected to a data/ptp network ot it can created unconnected - 'VF' (SRIOV with VLAN tag): same as PF for network connectivity. + 'SR-IOV' or 'VF' (SRIOV with VLAN tag): same as PF for network connectivity. 'VFnotShared'(SRIOV without VLAN tag) same as PF for network connectivity. VF where no other VFs are allocated on the same physical NIC 'bw': (optional) only for PF/VF/VFnotShared. Minimal Bandwidth required for the interface in GBPS @@ -518,7 +519,11 @@ class vimconnector(): availability_zone_index: Index of availability_zone_list to use for this this VM. None if not AV required availability_zone_list: list of availability zones given by user in the VNFD descriptor. Ignore if availability_zone_index is None - Returns the instance identifier or raises an exception on error + Returns a tuple with the instance identifier and created_items or raises an exception on error + created_items can be None or a dictionary where this method can include key-values that will be passed to + the method delete_vminstance and action_vminstance. Can be used to store created ports, volumes, etc. + Format is vimconnector dependent, but do not use nested dictionaries and a value of None should be the same + as not present. """ raise vimconnNotImplemented( "Should have implemented this" ) @@ -526,9 +531,14 @@ class vimconnector(): """Returns the VM instance information from VIM""" raise vimconnNotImplemented( "Should have implemented this" ) - def delete_vminstance(self, vm_id): - """Removes a VM instance from VIM - Returns the instance identifier""" + def delete_vminstance(self, vm_id, created_items=None): + """ + Removes a VM instance from VIM and each associate elements + :param vm_id: VIM identifier of the VM, provided by method new_vminstance + :param created_items: dictionary with extra items to be deleted. provided by method new_vminstance and/or method + action_vminstance + :return: None or the same vm_id. Raises an exception on fail + """ raise vimconnNotImplemented( "Should have implemented this" ) def refresh_vms_status(self, vm_list): @@ -559,9 +569,18 @@ class vimconnector(): """ raise vimconnNotImplemented( "Should have implemented this" ) - def action_vminstance(self, vm_id, action_dict): - """Send and action over a VM instance from VIM - Returns the vm_id if the action was successfully sent to the VIM""" + def action_vminstance(self, vm_id, action_dict, created_items={}): + """ + Send and action over a VM instance. Returns created_items if the action was successfully sent to the VIM. + created_items is a dictionary with items that + :param vm_id: VIM identifier of the VM, provided by method new_vminstance + :param action_dict: dictionary with the action to perform + :param created_items: provided by method new_vminstance is a dictionary with key-values that will be passed to + the method delete_vminstance. Can be used to store created ports, volumes, etc. Format is vimconnector + dependent, but do not use nested dictionaries and a value of None should be the same as not present. This + method can modify this value + :return: None, or a console dict + """ raise vimconnNotImplemented( "Should have implemented this" ) def get_vminstance_console(self, vm_id, console_type="vnc"):