Fix bug 2092 to update params of delete_vminstance in all VIM connectors
[osm/RO.git] / RO-plugin / osm_ro_plugin / vimconn.py
index b2ba979..bb06037 100644 (file)
@@ -661,7 +661,7 @@ class VimConnector:
         """Returns the VM instance information from VIM"""
         raise VimConnNotImplemented("Should have implemented this")
 
-    def delete_vminstance(self, vm_id, created_items=None):
+    def delete_vminstance(self, vm_id, created_items=None, volumes_to_hold=None):
         """
         Removes a VM instance from VIM and its associated elements
         :param vm_id: VIM identifier of the VM, provided by method new_vminstance
@@ -757,6 +757,11 @@ class VimConnector:
                 "chmod 644 ~/.ssh/authorized_keys",
                 "chmod 700 ~/.ssh/",
             }
+
+            logging.basicConfig(
+                format="%(asctime)s %(levelname)s %(name)s %(filename)s:%(lineno)s %(message)s"
+            )
+            logging.getLogger("paramiko").setLevel(logging.DEBUG)
             client = paramiko.SSHClient()
 
             try:
@@ -766,8 +771,14 @@ class VimConnector:
                     pkey = None
 
                 client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
+
                 client.connect(
-                    ip_addr, username=user, password=password, pkey=pkey, timeout=30
+                    ip_addr,
+                    username=user,
+                    password=password,
+                    pkey=pkey,
+                    timeout=30,
+                    auth_timeout=60,
                 )
 
                 for command in commands:
@@ -1087,6 +1098,15 @@ class VimConnector:
         """
         raise VimConnNotImplemented("Should have implemented this")
 
+    def resize_instance(self, vm_id, flavor_id=None):
+        """
+        resize a vdu
+        param:
+            vm_id: ID of an instance
+            flavor_id: flavor_id to resize the vdu to
+        """
+        raise VimConnNotImplemented("Should have implemented this")
+
     # NOT USED METHODS in current version. Deprecated
     @deprecated
     def host_vim2gui(self, host, server_dict):