Ejemplo n.º 1
0
 def verify_host_remotefx_capability(self):
     synth_3d_video_pool = self._conn.Msvm_Synth3dVideoPool()[0]
     if not synth_3d_video_pool.IsGpuCapable:
         raise exceptions.HyperVRemoteFXException(
             _("To enable RemoteFX on Hyper-V at least one GPU supporting "
               "DirectX 11 is required."))
     if not synth_3d_video_pool.IsSlatCapable:
         raise exceptions.HyperVRemoteFXException(
             _("To enable RemoteFX on Hyper-V it is required that the host "
               "GPUs support SLAT."))
Ejemplo n.º 2
0
 def _validate_remotefx_params(self, monitor_count, max_resolution,
                               vram_bytes=None):
     super(VMUtils10, self)._validate_remotefx_params(monitor_count,
                                                      max_resolution)
     if vram_bytes not in self._remotefx_vram_vals:
         raise exceptions.HyperVRemoteFXException(
             _("Unsuported RemoteFX VRAM value: %(requested_value)s."
               "The supported VRAM values are: %(supported_values)s") %
             {'requested_value': vram_bytes,
              'supported_values': self._remotefx_vram_vals})
Ejemplo n.º 3
0
    def _validate_remotefx_params(self,
                                  monitor_count,
                                  max_resolution,
                                  vram_bytes=None):
        max_res_value = self._remote_fx_res_map.get(max_resolution)
        if max_res_value is None:
            raise exceptions.HyperVRemoteFXException(
                _("Unsupported RemoteFX resolution: %s") % max_resolution)

        if monitor_count > self._remotefx_max_monitors_map[max_resolution]:
            raise exceptions.HyperVRemoteFXException(
                _("Unsuported RemoteFX monitor count: %(count)s for "
                  "this resolution %(res)s. Hyper-V supports a maximum "
                  "of %(max_monitors)s monitors for this resolution.") % {
                      'count': monitor_count,
                      'res': max_resolution,
                      'max_monitors':
                      self._remotefx_max_monitors_map[max_resolution]
                  })
Ejemplo n.º 4
0
    def enable_remotefx_video_adapter(self,
                                      vm_name,
                                      monitor_count,
                                      max_resolution,
                                      vram_bytes=None):
        vm = self._lookup_vm_check(vm_name, as_vssd=False)

        self._validate_remotefx_params(monitor_count,
                                       max_resolution,
                                       vram_bytes=vram_bytes)

        rasds = _wqlutils.get_element_associated_class(
            self._compat_conn,
            self._CIM_RES_ALLOC_SETTING_DATA_CLASS,
            element_uuid=vm.Name)
        if [
                r for r in rasds
                if r.ResourceSubType == self._SYNTH_3D_DISP_CTRL_RES_SUB_TYPE
        ]:
            raise exceptions.HyperVRemoteFXException(
                _("RemoteFX is already configured for this VM"))

        synth_disp_ctrl_res_list = [
            r for r in rasds
            if r.ResourceSubType == self._SYNTH_DISP_CTRL_RES_SUB_TYPE
        ]
        if synth_disp_ctrl_res_list:
            self._jobutils.remove_virt_resource(synth_disp_ctrl_res_list[0])

        max_res_value = self._remote_fx_res_map.get(max_resolution)
        self._add_3d_display_controller(vm, monitor_count, max_res_value,
                                        vram_bytes)
        if self._vm_has_s3_controller(vm.ElementName):
            s3_disp_ctrl_res = [
                r for r in rasds
                if r.ResourceSubType == self._S3_DISP_CTRL_RES_SUB_TYPE
            ][0]
            s3_disp_ctrl_res.Address = self._DISP_CTRL_ADDRESS_DX_11
            self._jobutils.modify_virt_resource(s3_disp_ctrl_res)