本文整理汇总了C#中XenAPI.VM类的典型用法代码示例。如果您正苦于以下问题:C# VM类的具体用法?C# VM怎么用?C# VM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VM类属于XenAPI命名空间,在下文中一共展示了VM类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RevertToSnapshotCommand
public RevertToSnapshotCommand(IMainWindow mainWindow, IEnumerable<SelectedItem> selection, VM snapshot)
: base(mainWindow, selection)
{
Util.ThrowIfParameterNull(snapshot, "snapshot");
_snapshot = snapshot;
_VM = _snapshot.Connection.Resolve(_snapshot.snapshot_of);
}
示例2: VNCPasswordDialog
public VNCPasswordDialog(Exception error, VM vm)
: base(vm.Connection)
{
InitializeComponent();
Icon = Properties.Resources.AppIcon;
passwordFailure1.Visible = error is VNCAuthenticationException || error is CryptographicException;
}
示例3: 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();
}
示例4: Execute
private void Execute(VM snapshot)
{
if (snapshot != null)
{
new ExportVMCommand(MainWindowCommandInterface, new SelectedItem(snapshot, snapshot.Connection, null, null)).Execute();
}
}
示例5: VMProblem
protected VMProblem(Check check, VM vm)
: base(check)
{
_vm = vm;
ResidentOn = VM.Connection.Resolve(VM.resident_on);
}
示例6: PageLoaded
public override void PageLoaded(PageLoadedDirection direction)
{
base.PageLoaded(direction);
VM template = SelectedTemplate;
if (!template.Equals(_template))
{
_template = template;
ServersGridView.Rows.Clear();
if (Helpers.MidnightRideOrGreater(Connection) && template.DefaultTemplate)
{
List<Host> hosts = new List<Host>(Connection.Cache.Hosts);
hosts.Sort();
foreach (Host host in hosts)
{
ServerGridRow row = new ServerGridRow(host, false);
ServersGridView.Rows.Add(row);
if (host == _affinity)
{
row.Selected = true;
}
}
}
ServersGridView.Enabled = template.DefaultTemplate;
}
}
示例7: CanExecute
public static new bool CanExecute(VM vm, Host preSelectedHost)
{
if (vm == null || !vm.is_a_template || vm.DefaultTemplate || vm.Locked)
return false;
return CrossPoolMigrateCommand.CanExecute(vm, preSelectedHost);
}
示例8: SetVMOtherConfigAction
public SetVMOtherConfigAction(IXenConnection connection, VM vm, string key, string val)
: base(connection, Messages.ACTION_SET_VM_OTHER_CONFIG_TITLE, true)
{
VM = vm;
Key = key;
Val = val;
}
示例9: VMSnapshotRevertAction
public VMSnapshotRevertAction(VM snapshot)
: base(snapshot.Connection, String.Format(Messages.ACTION_VM_REVERT_SNAPSHOT_TITLE, snapshot.Name))
{
this.VM = Connection.Resolve<VM>(snapshot.snapshot_of);
this.m_Snapshot = snapshot;
Description = String.Format(Messages.VM_REVERTING, m_Snapshot.Name);
}
示例10: ChangeVCPUSettingsAction
public ChangeVCPUSettingsAction(VM vm, long VCPUs_max, long VCPUs_at_startup)
: base(vm.Connection, "", true)
{
m_VM = vm;
m_VCPUs_max = VCPUs_max;
m_VCPUs_at_startup = VCPUs_at_startup;
}
示例11: Run
protected override void Run()
{
Description = Messages.STARTING_IN_RECOVERY_MODE;
string oldPolicy = VM.HVM_boot_policy;
string oldOrder = VM.BootOrder;
vmCopy = (VM)VM.Clone();
vmCopy.HVM_boot_policy = "BIOS order";
vmCopy.BootOrder = "DN";
VM.Locked = true;
vmCopy.SaveChanges(Session);
VM.Locked = false;
XenAPI.VM.start(Session, VM.opaque_ref, false, false);
vmCopy.HVM_boot_policy = oldPolicy;
vmCopy.BootOrder = oldOrder;
VM.Locked = true;
vmCopy.SaveChanges(Session);
VM.Locked = false;
Description = Messages.STARTED_IN_RECOVERY_MODE;
}
示例12: RevertDialog
public RevertDialog(VM vm,string snapshotName)
{
InitializeComponent();
this.questionLabel.Text = string.Format(questionLabel.Text, snapshotName.Ellipsise(40));
this.takeSnapshotBeforeCheckBox.Enabled = vm.allowed_operations.Contains(vm_operations.snapshot);
this.takeSnapshotBeforeCheckBox.Checked = this.takeSnapshotBeforeCheckBox.Enabled;
}
示例13: UpdateVIFCommand
public UpdateVIFCommand(IMainWindow mainWindow, VM vm, VIF vif, Proxy_VIF proxyVIF)
: base(mainWindow, vm)
{
_vm = vm;
_vif = vif;
_proxyVIF = proxyVIF;
}
示例14: GpuAssignAction
public GpuAssignAction(VM vm, GPU_group gpu_group, VGPU_type vgpuType)
: base(vm.Connection, "Set GPU", true)
{
this.vm = vm;
this.gpu_group = gpu_group;
this.vgpuType = vgpuType;
}
示例15: ChangeMemorySettingsAction
public ChangeMemorySettingsAction(VM vm, string title,
long static_min, long dynamic_min, long dynamic_max, long static_max, Action<VM, bool> warningDialogHAInvalidConfig, Action<VMStartAbstractAction, Failure> startDiagnosticForm, bool suppressHistory)
: base(vm.Connection, title, suppressHistory)
{
_warningDialogHAInvalidConfig = warningDialogHAInvalidConfig;
_startDiagnosticForm = startDiagnosticForm;
VM = vm;
this.static_min = static_min;
this.dynamic_min = dynamic_min;
this.dynamic_max = dynamic_max;
this.static_max = static_max;
#region RBAC Dependencies
if (staticChanged)
ApiMethodsToRoleCheck.Add("vm.set_memory_limits");
else
ApiMethodsToRoleCheck.Add("vm.set_memory_dynamic_range");
if (needReboot)
{
if (VM.allowed_operations.Contains(XenAPI.vm_operations.clean_shutdown))
ApiMethodsToRoleCheck.Add("vm.clean_shutdown");
else
ApiMethodsToRoleCheck.Add("vm.hard_shutdown");
ApiMethodsToRoleCheck.Add("vm.start_on");
}
#endregion
}