logging.getLogger('urllib3').setLevel(logging.WARNING)
logging.getLogger('keystoneauth').setLevel(logging.WARNING)
logging.getLogger('novaclient').setLevel(logging.WARNING)
- self.logger = logging.getLogger('openmano.vim.openstack')
+ self.logger = logging.getLogger('ro.vim.openstack')
# allow security_groups to be a list or a single string
if isinstance(self.config.get('security_groups'), str):
# ###### VIO Specific Changes #########
if self.vim_type == "VIO":
- self.logger = logging.getLogger('openmano.vim.vio')
+ self.logger = logging.getLogger('ro.vim.vio')
if log_level:
self.logger.setLevel(getattr(logging, log_level))
type: 'virtual', 'PCI-PASSTHROUGH'('PF'), 'SR-IOV'('VF'), 'VFnotShared'
vim_id: filled/added by this function
floating_ip: True/False (or it can be None)
+ port_security: True/False
'cloud_config': (optional) dictionary with:
'key-pairs': (optional) list of strings with the public key to be inserted to the default user
'users': (optional) list of users to be inserted, each item is a dict with:
# is dropped.
# As a workaround we wait until the VM is active and then disable the port-security
if net.get("port_security") is False and not self.config.get("no_port_security_extension"):
- no_secured_ports.append(new_port["port"]["id"])
+ no_secured_ports.append((new_port["port"]["id"], net.get("port_security_disable_strategy")))
# if metadata_vpci:
# metadata = {"pci_assignement": json.dumps(metadata_vpci)}
if no_secured_ports:
self.__wait_for_vm(server.id, 'ACTIVE')
- for port_id in no_secured_ports:
+ for port in no_secured_ports:
+ port_update = {
+ "port": {
+ "port_security_enabled": False,
+ "security_groups": None
+ }
+ }
+
+ if port[1] == "allow-address-pairs":
+ port_update = {
+ "port": {
+ "allowed_address_pairs": [
+ {
+ "ip_address": "0.0.0.0/0"
+ }
+ ]
+ }
+ }
+
try:
- self.neutron.update_port(port_id,
- {"port": {"port_security_enabled": False, "security_groups": None}})
+ self.neutron.update_port(port[0], port_update)
except Exception:
- raise vimconn.VimConnException("It was not possible to disable port security for port {}".format(
- port_id))
+ raise vimconn.VimConnException(
+ "It was not possible to disable port security for port {}"
+ .format(port[0])
+ )
+
# print "DONE :-)", server
# pool_id = None
else:
vm['status'] = "OTHER"
vm['error_msg'] = "VIM status reported " + vm_vim['status']
-
+ vm_vim.pop("OS-EXT-SRV-ATTR:user_data", None)
+ vm_vim.pop("user_data", None)
vm['vim_info'] = self.serialize(vm_vim)
vm["interfaces"] = []