Sets the hdc disk interface for this QEMU VM.

        :param hdc_disk_interface: QEMU hdc disk interface
11208
def hdc_disk_interface(self, hdc_disk_interface):
        

        self._hdc_disk_interface = hdc_disk_interface
        log.info('QEMU VM "{name}" [{id}] has set the QEMU hdc disk interface to {interface}'.format(name=self._name,
                                                                                                     id=self._id,
                                                                                                     interface=self._hdc_disk_interface))
1083360
def set_deplyment_vcenter_params(vcenter_resource_model, deploy_params):
        
        # Override attributes
        deploy_params.vm_cluster = deploy_params.vm_cluster or vcenter_resource_model.vm_cluster
        deploy_params.vm_storage = deploy_params.vm_storage or vcenter_resource_model.vm_storage
        deploy_params.vm_resource_pool = deploy_params.vm_resource_pool or vcenter_resource_model.vm_resource_pool
        deploy_params.vm_location = deploy_params.vm_location or vcenter_resource_model.vm_location
        deploy_params.default_datacenter = vcenter_resource_model.default_datacenter

        if not deploy_params.vm_cluster:
            raise ValueError('VM Cluster is empty')
        if not deploy_params.vm_storage:
            raise ValueError('VM Storage is empty')
        if not deploy_params.vm_location:
            raise ValueError('VM Location is empty')
        if not deploy_params.default_datacenter:
            raise ValueError('Default Datacenter attribute on VMWare vCenter is empty')

        deploy_params.vm_location = VMLocation.combine([deploy_params.default_datacenter, deploy_params.vm_location])
865558
def cdrom_image(self, cdrom_image):
        
        self._cdrom_image = self.manager.get_abs_image_path(cdrom_image)
        log.info('QEMU VM "{name}" [{id}] has set the QEMU cdrom image path to {cdrom_image}'.format(name=self._name,
                                                                                                     id=self._id,
                                                                                                     cdrom_image=self._cdrom_image))
340794
def boot_priority(self, boot_priority):
        

        self._boot_priority = boot_priority
        log.info('QEMU VM "{name}" [{id}] has set the boot priority to {boot_priority}'.format(name=self._name,
                                                                                               id=self._id,
                                                                                               boot_priority=self._boot_priority))
1140244
def load_hdu(self, hdu):
        
        image = AstroImage.AstroImage(logger=self.logger)
        image.load_hdu(hdu)

        self.set_image(image)
843497
def setup_logical_port_connectivity(self, context, port_db,
                                        hosting_device_id):
        
        hosting_port = port_db.hosting_info.hosting_port
        if hosting_port:
            try:
                self._dev_mgr.svc_vm_mgr.interface_attach(hosting_device_id,
                                                          hosting_port.id)
                LOG.debug("Setup logical port completed for port:%s",
                          port_db.id)
            except nova_exc.Conflict as e:
                # VM is still in vm_state building
                LOG.debug("Failed to attach interface - spawn thread "
                          "error %(error)s", {'error': str(e)})
                self._gt_pool.spawn_n(self._attach_hosting_port,
                                      hosting_device_id, hosting_port.id)
            except Exception as e:
                LOG.error("Failed to attach interface mapped to port:"
                          "%(p_id)s on hosting device:%(hd_id)s due to "
                          "error %(error)s", {'p_id': hosting_port.id,
                                              'hd_id': hosting_device_id,
                                              'error': str(e)})
830609
def kernel_image(self, kernel_image):
        

        kernel_image = self.manager.get_abs_image_path(kernel_image)
        log.info('QEMU VM "{name}" [{id}] has set the QEMU kernel image path to {kernel_image}'.format(name=self._name,
                                                                                                       id=self._id,
                                                                                                       kernel_image=kernel_image))
        self._kernel_image = kernel_image
790435
def enable_i2c(self):
        
        config = self._interface_configuration(CONFIG_QUERY)
        return config == CONFIG_GPIO_I2C or config == CONFIG_SPI_I2C
1072231
def ssh_interface(vm_):
    '''
    
    '''
    ret = config.get_cloud_config_value(
        'ssh_interface', vm_, __opts__, default='public_ips',
        search_global=False
    )
    if ret not in ('public_ips', 'private_ips'):
        log.warning(
            'Invalid ssh_interface: %s. '
            'Allowed options are ("public_ips", "private_ips"). '
            'Defaulting to "public_ips".', ret
        )
        ret = 'public_ips'
    return ret
897914
def set_dvs_network_resource_management_enabled(dvs_ref, enabled):
    '''
    
    '''
    dvs_name = get_managed_object_name(dvs_ref)
    log.trace('Setting network resource management enable to %s on '
              'dvs \'%s\'', enabled, dvs_name)
    try:
        dvs_ref.EnableNetworkResourceManagement(enable=enabled)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
859586
def hda_disk_interface(self, hda_disk_interface):
        

        self._hda_disk_interface = hda_disk_interface
        log.info('QEMU VM "{name}" [{id}] has set the QEMU hda disk interface to {interface}'.format(name=self._name,
                                                                                                     id=self._id,
                                                                                                     interface=self._hda_disk_interface))
804449
def bios_image(self, bios_image):
        
        self._bios_image = self.manager.get_abs_image_path(bios_image)
        log.info('QEMU VM "{name}" [{id}] has set the QEMU bios image path to {bios_image}'.format(name=self._name,
                                                                                                   id=self._id,
                                                                                                   bios_image=self._bios_image))
103206
def build_interface(iface, iface_type, enabled, **settings):
    '''
    
    '''
    if __grains__['lsb_distrib_id'] == 'nilrt':
        raise salt.exceptions.CommandExecutionError('Not supported in this version.')
    if iface_type != 'eth':
        raise salt.exceptions.CommandExecutionError('Interface type not supported: {0}:'.format(iface_type))

    if 'proto' not in settings or settings['proto'] == 'dhcp':  # default protocol type used is dhcp
        set_dhcp_linklocal_all(iface)
    elif settings['proto'] != 'static':
        exc_msg = 'Protocol type: {0} is not supported'.format(settings['proto'])
        raise salt.exceptions.CommandExecutionError(exc_msg)
    else:
        address = settings['ipaddr']
        netmask = settings['netmask']
        gateway = settings['gateway']
        dns = []
        for key, val in six.iteritems(settings):
            if 'dns' in key or 'domain' in key:
                dns += val
        set_static_all(iface, address, netmask, gateway, dns)

    if enabled:
        up(iface)

    return get_interface(iface)
893186
def set_transform_interface_params(spec, input_features, output_features, are_optional = False):
    
    input_features = _fm.process_or_validate_features(input_features)
    output_features = _fm.process_or_validate_features(output_features)

    # Add input and output features
    for (fname, ftype) in input_features:
        input_ = spec.description.input.add()
        input_.name = fname
        datatypes._set_datatype(input_.type, ftype)
        if are_optional:
            input_.type.isOptional = are_optional

    for (fname, ftype) in output_features:
        output_ = spec.description.output.add()
        output_.name = fname
        datatypes._set_datatype(output_.type, ftype)

    return spec
269982
async def SetFilesystemInfo(self, filesystems):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='StorageProvisioner',
                   request='SetFilesystemInfo',
                   version=3,
                   params=_params)
        _params['filesystems'] = filesystems
        reply = await self.rpc(msg)
        return reply
1361574
def set_ilo_ipv4_dhcp(manager_id: 1, ethernet_interface: 1)
      new_action = {
        'Oem' => {
          'Hp' => {
            'DHCPv4' => {
              'Enabled' => true,
              'UseDNSServers' => true,
              'UseDomainName' => true,
              'UseGateway' => true,
              'UseNTPServers' => true,
              'UseStaticRoutes' => true,
              'UseWINSServers' => true
            }
          }
        }
      }
      response = rest_patch("/redfish/v1/Managers/#{manager_id}/EthernetInterfaces/#{ethernet_interface}/", body: new_action)
      response_handler(response)
      true
    end
447121
def set_essid(interface, essid):
    
    interface = _get_bytes(interface)
    essid = _get_bytes(essid)

    wrq = ffi.new('struct iwreq*')

    with iwlib_socket() as sock:
        if essid.lower() in (b'off', b'any'):
            wrq.u.essid.flags = 0
            essid = b''
        elif essid.lower() == b'on':
            buf = ffi.new('char []', iwlib.IW_ESSID_MAX_SIZE+1)
            wrq.u.essid.pointer = buf
            wrq.u.essid.length = iwlib.IW_ESSID_MAX_SIZE + 1
            wrq.u.essid.flags = 0
            if iwlib.iw_get_ext(sock, interface, iwlib.SIOCGIWESSID, wrq) < 0:
                raise ValueError("Error retrieving previous ESSID: %s" % (os.strerror(ffi.errno)))
            wrq.u.essid.flags = 1
        elif len(essid) > iwlib.IW_ESSID_MAX_SIZE:
            raise ValueError("ESSID '%s' is longer than the maximum %d" % (essid, iwlib.IW_ESSID_MAX_SIZE))
        else:
            wrq.u.essid.pointer = ffi.new_handle(essid)
            wrq.u.essid.length = len(essid)
            wrq.u.essid.flags = 1

        if iwlib.iw_get_kernel_we_version() < 21:
            wrq.u.essid.length += 1

        if iwlib.iw_set_ext(sock, interface, iwlib.SIOCSIWESSID, wrq) < 0:
            errno = ffi.errno
            strerror = "Couldn't set essid on device '%s': %s" % (interface.decode('utf8'), os.strerror(errno))
            raise OSError(errno, strerror)