from uuid import uuid4
from copy import deepcopy
import logging
+from random import randrange
__author__ = "Alfonso Tierno"
__date__ = "2020-04-20"
config={}, persistent_info={}):
super().__init__(uuid, name, tenant_id, tenant_name, url, url_admin, user, passwd, log_level,
config, persistent_info)
- self.logger = logging.getLogger('openmano.vim.dummy')
+ self.logger = logging.getLogger('ro.vim.dummy')
if log_level:
self.logger.setLevel(getattr(logging, log_level))
self.nets = {
"vim_interface_id": str(iface_index),
"vim_net_id": iface["net_id"],
}
+ if iface.get("type") in ("SR-IOV", "PCI-PASSTHROUGH") and self.config.get("sdn-port-mapping"):
+ compute_index = randrange(len(self.config["sdn-port-mapping"]))
+ port_index = randrange(len(self.config["sdn-port-mapping"][compute_index]["ports"]))
+ interface["compute_node"] = self.config["sdn-port-mapping"][compute_index]["compute_node"]
+ interface["pci"] = self.config["sdn-port-mapping"][compute_index]["ports"][port_index]["pci"]
+
interfaces.append(interface)
vm = {
"id": vm_id,