def create_port(self, args): """ Return the a dict with information of the blade on which a dynamic vnic is available """ LOG.debug("create_port() called\n") least_reserved_blade_dict = self._get_least_reserved_blade() if not least_reserved_blade_dict: raise cexc.NoMoreNics() ucsm_ip = least_reserved_blade_dict[const.LEAST_RSVD_BLADE_UCSM] device_params = {const.DEVICE_IP: [ucsm_ip], const.UCS_INVENTORY: self, const.LEAST_RSVD_BLADE_DICT:\ least_reserved_blade_dict} return device_params
def create_multiport(self, args): """ Create multiple ports for a VM """ LOG.debug("create_ports() called\n") tenant_id = args[0] ports_num = args[2] least_reserved_blade_dict = self._get_least_reserved_blade(ports_num) if not least_reserved_blade_dict: raise cexc.NoMoreNics() ucsm_ip = least_reserved_blade_dict[const.LEAST_RSVD_BLADE_UCSM] device_params = {const.DEVICE_IP: [ucsm_ip], const.UCS_INVENTORY: self, const.LEAST_RSVD_BLADE_DICT:\ least_reserved_blade_dict} return device_params