当前位置: 首页>>代码示例>>C#>>正文


C# VM.Home方法代码示例

本文整理汇总了C#中XenAPI.VM.Home方法的典型用法代码示例。如果您正苦于以下问题:C# VM.Home方法的具体用法?C# VM.Home怎么用?C# VM.Home使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XenAPI.VM的用法示例。


在下文中一共展示了VM.Home方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VMDestroyAction

 public VMDestroyAction(VM vm, List<VBD> deleteDisks, List<VM> deleteSnapshots)
     : base(vm.Connection, String.Format(Messages.ACTION_VM_DESTROYING_TITLE, vm.Name, vm.Home() == null ? Helpers.GetName(vm.Connection) : Helpers.GetName(vm.Home())))
 {
     VM = vm;
     Host = vm.Home();
     Pool = Helpers.GetPoolOfOne(vm.Connection);
     _deleteDisks = deleteDisks;
     _deleteSnapshots = deleteSnapshots;
 }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:9,代码来源:VMDestroyAction.cs

示例2: MoveVMDialog

        public MoveVMDialog(VM vm)
        {
            InitializeComponent();
            this.vm = vm;
            srPicker1.ItemSelectionNotNull += srPicker1_ItemSelectionNotNull;
            srPicker1.ItemSelectionNull += srPicker1_ItemSelectionNull;
            srPicker1.DoubleClickOnRow += srPicker1_DoubleClickOnRow;
            srPicker1.SrHint.Visible = false;
            Host affinity = vm.Home();
            srPicker1.Usage = SrPicker.SRPickerType.MoveOrCopy;
            //this has to be set after ImportTemplate, otherwise the usage will be reset to VM
            var vdis = (from VBD vbd in vm.Connection.ResolveAll(vm.VBDs)
                                           where vbd.IsOwner
                                           let vdi = vm.Connection.Resolve(vbd.VDI)
                                           where vdi != null
                                           select vdi).ToArray();
            srPicker1.SetExistingVDIs(vdis);
            srPicker1.Connection = vm.Connection;
            srPicker1.DiskSize = vm.TotalVMSize;
            srPicker1.SetAffinity(affinity);
            srPicker1.srListBox.Invalidate();
            srPicker1.selectDefaultSROrAny();

            EnableMoveButton();
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:25,代码来源:MoveVMDialog.cs

示例3: VMShutdownAction

 protected VMShutdownAction(VM vm,string title)
     : base(vm.Connection, title)
 {
     this.Description = Messages.ACTION_PREPARING;
     this.VM = vm;
     this.Host = vm.Home();
     this.Pool = Core.Helpers.GetPool(vm.Connection);
 }
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:8,代码来源:VMShutdownAction.cs

示例4: VMToTemplateAction

 public VMToTemplateAction(VM vm)
     : base(vm.Connection, string.Format(Messages.ACTION_VM_TEMPLATIZING_TITLE, vm.Name))
 {
     this.Description = Messages.ACTION_PREPARING;
     this.VM = vm;
     this.Host = vm.Home();
     this.Pool = Core.Helpers.GetPool(vm.Connection);
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:8,代码来源:VMToTemplateAction.cs

示例5: CopyVMDialog

        public CopyVMDialog(VM vm)
        {
            InitializeComponent();
            this.MinimumSize = this.Size;
            IsRealVm = !vm.is_a_template;
            TheVM = vm;
            srPicker1.Usage = SrPicker.SRPickerType.MoveOrCopy;
            srPicker1.ItemSelectionNotNull += srPicker1_ItemSelectionNotNull;
            srPicker1.ItemSelectionNull += srPicker1_ItemSelectionNull;
            Host affinity = TheVM.Home();
            srPicker1.Connection = TheVM.Connection;
            srPicker1.DiskSize = vm.TotalVMSize;
            srPicker1.SrHint.Text = IsRealVm ? Messages.COPY_VM_SELECT_SR : Messages.COPY_TEMPLATE_SELECT_SR;
            srPicker1.SetAffinity(affinity);
            Pool pool = Helpers.GetPoolOfOne(vm.Connection);
            if (pool != null)
                srPicker1.DefaultSR = vm.Connection.Resolve(pool.default_SR);

            NameTextBox.Text = GetDefaultCopyName(TheVM);

            Text = IsRealVm ? Messages.COPY_VM : Messages.COPY_TEMPLATE;

            bool allow_copy = !vm.is_a_template || vm.allowed_operations.Contains(vm_operations.copy);

            CopyRadioButton.Enabled = allow_copy && vm.HasAtLeastOneDisk;
            FastClonePanel.Enabled = !allow_copy || vm.AnyDiskFastClonable || !vm.HasAtLeastOneDisk;
            if (!FastClonePanel.Enabled)
            {
                CloneRadioButton.Checked = false;
            }
            toolTipContainer1.SetToolTip(Messages.FAST_CLONE_UNAVAILABLE);
            if (vm.is_a_template && !(vm.AnyDiskFastClonable || allow_copy))
            {
                CloneRadioButton.Text = Messages.COPY_VM_CLONE_TEMPLATE_SLOW;
                FastCloneDescription.Text = Messages.COPY_VM_SLOW_CLONE_DESCRIPTION;
            }
            else
            {
                FastCloneDescription.Text = !vm.is_a_template ? Messages.COPY_VM_FAST_CLONE_DESCRIPTION : Messages.COPY_TEMPLATE_FAST_CLONE_DESCRIPTION;
            }

            if (!CloneRadioButton.Enabled)
                CopyRadioButton.Checked = true;

            if (vm.DescriptionType != VM.VmDescriptionType.None)
                DescriptionTextBox.Text = vm.Description;

            srPicker1.srListBox.Invalidate();
            srPicker1.selectDefaultSROrAny();
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:50,代码来源:CopyVMDialog.cs

示例6: VMCloneAction

 public VMCloneAction(VM vm, string name, string description)
     : base(vm.Connection, string.Format(Messages.CREATEVM_CLONE, name, vm.Name))
 {
     this.Description = Messages.ACTION_PREPARING;
     this.VM = vm;
     this.Host = vm.Home();
     this.Pool = Core.Helpers.GetPool(vm.Connection);
     if (vm.is_a_template)
         this.Template = vm;
     _cloneName = name;
     _cloneDescription = description;
     ApiMethodsToRoleCheck.AddRange(Role.CommonSessionApiList);
     ApiMethodsToRoleCheck.AddRange(Role.CommonTaskApiList);
     ApiMethodsToRoleCheck.Add("vm.clone");
     ApiMethodsToRoleCheck.Add("vm.set_name_description");
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:16,代码来源:VMCloneAction.cs

示例7: VMRebootAction

 public VMRebootAction(VM vm)
     : base(vm.Connection, string.Format(Messages.ACTION_VM_REBOOTING_TITLE, vm.Name, vm.Home() == null ? Helpers.GetName(vm.Connection) : vm.Home().Name))
 {
     this.Description = Messages.ACTION_PREPARING;
     this.VM = vm;
     this.Host = vm.Home();
     this.Pool = Core.Helpers.GetPool(vm.Connection);
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:8,代码来源:VMRebootAction.cs

示例8: VMWanted

 private bool VMWanted(VM vm, Host host)
 {
     return vm.is_a_real_vm && vm.Show(Properties.Settings.Default.ShowHiddenVMs) && vm.Home() == host;
 }
开发者ID:robhoes,项目名称:xenadmin,代码行数:4,代码来源:BallooningPage.cs

示例9: VmCpuFeaturesIncompatibleWithHost

        public static bool VmCpuFeaturesIncompatibleWithHost(Host targetHost, VM vm)
        {
            // check the CPU feature compatibility for Dundee and higher hosts
            if (!Helpers.DundeeOrGreater(targetHost))
                return false;

            Host home = vm.Home();
            if (home != null && !Helpers.DundeeOrGreater(home))
                return false;

            if (home == null && !Helpers.DundeeOrGreater(vm.Connection))
                return false;

            // only for running or suspended VMs
            if (vm.power_state != vm_power_state.Running && vm.power_state != vm_power_state.Suspended)
                return false;

            if (vm.last_boot_CPU_flags == null || !vm.last_boot_CPU_flags.ContainsKey("vendor") || !vm.last_boot_CPU_flags.ContainsKey("features")
                || targetHost.cpu_info == null || !targetHost.cpu_info.ContainsKey("vendor"))
                return false;

            if (vm.last_boot_CPU_flags["vendor"] != targetHost.cpu_info["vendor"])
                return true;

            if (vm.IsHVM && targetHost.cpu_info.ContainsKey("features_hvm"))
                return PoolJoinRules.FewerFeatures(targetHost.cpu_info["features_hvm"], vm.last_boot_CPU_flags["features"]);

            if (!vm.IsHVM && targetHost.cpu_info.ContainsKey("features_pv"))
                return PoolJoinRules.FewerFeatures(targetHost.cpu_info["features_pv"], vm.last_boot_CPU_flags["features"]);

            return false;
        }
开发者ID:kc284,项目名称:xenadmin,代码行数:32,代码来源:VMOperationHostCommand.cs

示例10: CanExecute

 protected override bool CanExecute(VM vm)
 {
     if (vm != null && !vm.is_a_template && !vm.Locked)
     {
         if (vm.power_state == vm_power_state.Running && HelpersGUI.HasRunningTasks(vm))
         {
             return true;
         }
         else
         {
             return vm.allowed_operations != null && vm.allowed_operations.Contains(vm_operations.hard_reboot) && EnabledTargetExists(vm.Home(), vm.Connection);
         }
     }
     return false;
 }
开发者ID:kc284,项目名称:xenadmin,代码行数:15,代码来源:ForceVMRebootCommand.cs

示例11: NewDiskDialog

 public NewDiskDialog(IXenConnection connection, VM vm)
     : this(connection, vm, null, vm.Home(), true, 0, new List<VDI>())
 {
 }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:4,代码来源:NewDiskDialog.cs

示例12: VMCleanShutdown

 public VMCleanShutdown(VM vm)
     : base(vm, string.Format(Messages.ACTION_VM_SHUTTING_DOWN_TITLE, vm.Name, vm.Home() == null ? Helpers.GetName(vm.Connection) : vm.Home().Name))
 {
 }
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:4,代码来源:VMShutdownAction.cs

示例13: VMStartAbstractAction

 protected VMStartAbstractAction(VM vm, string title, Action<VM, bool> warningDialogHAInvalidConfig, Action<VMStartAbstractAction, Failure> startDiagnosisForm)
     : base(vm.Connection, title)
 {
     this.Description = Messages.ACTION_PREPARING;
     this.VM = vm;
     _WarningDialogHAInvalidConfig = warningDialogHAInvalidConfig;
     _StartDiagnosisForm = startDiagnosisForm;
     this.Host = vm.Home();
     this.Pool = Core.Helpers.GetPool(vm.Connection);
     AddCommonAPIMethodsToRoleCheck();
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:11,代码来源:VMStartAction.cs


注:本文中的XenAPI.VM.Home方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。