X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=vimconn.py;h=e6e042154198aece5328a239c1b52d68eef5c7c0;hb=12b1f745438a7fcccb397cf189b1a21938e25dbd;hp=b06f04ea064c2c99ceca8757d27dcd44a81477e9;hpb=ae4a8d1771650d4016cb4e910b61670bb2478390;p=osm%2FRO.git diff --git a/vimconn.py b/vimconn.py index b06f04ea..e6e04215 100644 --- a/vimconn.py +++ b/vimconn.py @@ -92,7 +92,7 @@ class vimconnector(): self.user = user self.passwd = passwd self.config = config - self.logger = logging.getLogger('mano.vim') + self.logger = logging.getLogger('openmano.vim') self.logger.setLevel( getattr(logging, log_level) ) if not self.url_admin: #try to use normal url self.url_admin = self.url @@ -160,9 +160,11 @@ class vimconnector(): ''' raise vimconnNotImplemented( "Should have implemented this" ) - def new_network(self,net_name, net_type, shared=False): + def new_network(self,net_name, net_type, ip_profile=None, shared=False): '''Adds a tenant network to VIM - net_type can be 'bridge','data'.'ptp'. TODO: this need to be revised + net_name is the name + net_type can be 'bridge','data'.'ptp'. TODO: this need to be revised + ip_profile is a dict containing the IP parameters of the network shared is a boolean Returns the network identifier''' raise vimconnNotImplemented( "Should have implemented this" ) @@ -269,7 +271,7 @@ class vimconnector(): ''' raise vimconnNotImplemented( "Should have implemented this" ) - def new_vminstance(self,name,description,start,image_id,flavor_id,net_list): + def new_vminstance(self,name,description,start,image_id,flavor_id,net_list,cloud_config=None): '''Adds a VM instance to VIM Params: start: indicates if VM must start or boot in pause mode. Ignored @@ -283,6 +285,10 @@ class vimconnector(): use: 'data', 'bridge', 'mgmt' type: 'virtual', 'PF', 'VF', 'VFnotShared' vim_id: filled/added by this function + cloud_config: can be a text script to be passed directly to cloud-init, + or an object to inject users and ssh keys with format: + key-pairs: [] list of keys to install to the default user + users: [{ name, key-pairs: []}] list of users to add with their key-pair #TODO ip, security groups Returns >=0, the instance identifier <0, error_text