本文整理汇总了C#中XenAPI.VM类的典型用法代码示例。如果您正苦于以下问题:C# VM类的具体用法?C# VM怎么用?C# VM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VM类属于XenAPI命名空间,在下文中一共展示了VM类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:RevertToSnapshotCommand.cs
示例2: VNCPasswordDialog
public VNCPasswordDialog(Exception error, VM vm)
: base(vm.Connection)
{
InitializeComponent();
Icon = Properties.Resources.AppIcon;
passwordFailure1.Visible = error is VNCAuthenticationException || error is CryptographicException;
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:VNCPasswordDialog.cs
示例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();
}
开发者ID:ushamandya,项目名称:xenadmin,代码行数:25,代码来源:MoveVMDialog.cs
示例4: Execute
private void Execute(VM snapshot)
{
if (snapshot != null)
{
new ExportVMCommand(MainWindowCommandInterface, new SelectedItem(snapshot, snapshot.Connection, null, null)).Execute();
}
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:ExportSnapshotAsTemplateCommand.cs
示例5: VMProblem
protected VMProblem(Check check, VM vm)
: base(check)
{
_vm = vm;
ResidentOn = VM.Connection.Resolve(VM.resident_on);
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:VMProblem.cs
示例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;
}
}
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:29,代码来源:Page_CopyBiosStrings.cs
示例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);
}
开发者ID:ushamandya,项目名称:xenadmin,代码行数:7,代码来源:CrossPoolCopyVMCommand.cs
示例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;
}
开发者ID:ushamandya,项目名称:xenadmin,代码行数:7,代码来源:SetVMOtherConfigAction.cs
示例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);
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:VMSnapshotRevertAction.cs
示例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;
}
开发者ID:ushamandya,项目名称:xenadmin,代码行数:7,代码来源:ChangeVCPUSettingsAction.cs
示例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;
}
开发者ID:huizh,项目名称:xenadmin,代码行数:25,代码来源:HVMBootAction.cs
示例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;
}
开发者ID:ushamandya,项目名称:xenadmin,代码行数:7,代码来源:RevertDialog.cs
示例13: UpdateVIFCommand
public UpdateVIFCommand(IMainWindow mainWindow, VM vm, VIF vif, Proxy_VIF proxyVIF)
: base(mainWindow, vm)
{
_vm = vm;
_vif = vif;
_proxyVIF = proxyVIF;
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:UpdateVIFCommand.cs
示例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;
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:GpuAssignAction.cs
示例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
}
开发者ID:huizh,项目名称:xenadmin,代码行数:30,代码来源:ChangeMemorySettingsAction.cs
示例16: Run
protected override void Run()
{
// get the VM from the cache again, to check its vCPU fields before trying to change them
m_VM = Connection.Resolve(new XenRef<VM>(m_VM.opaque_ref));
if (m_VM == null) // VM has disappeared
return;
if (m_VM.power_state == vm_power_state.Running) // if the VM is running, we can only change the vCPUs number, not the max.
{
if (m_VM.VCPUs_at_startup > m_VCPUs_at_startup) // reducing VCPU_at_startup is not allowed for live VMs
{
throw new Exception(string.Format(Messages.VM_VCPU_CANNOT_UNPLUG_LIVE, m_VM.VCPUs_at_startup));
}
VM.set_VCPUs_number_live(Session, m_VM.opaque_ref, m_VCPUs_at_startup);
return;
}
if (m_VM.VCPUs_at_startup > m_VCPUs_at_startup) // reducing VCPUs_at_startup: we need to change this value first, and then the VCPUs_max
{
VM.set_VCPUs_at_startup(Session, m_VM.opaque_ref, m_VCPUs_at_startup);
VM.set_VCPUs_max(Session, m_VM.opaque_ref, m_VCPUs_max);
}
else // increasing VCPUs_at_startup: we need to change the VCPUs_max first
{
VM.set_VCPUs_max(Session, m_VM.opaque_ref, m_VCPUs_max);
VM.set_VCPUs_at_startup(Session, m_VM.opaque_ref, m_VCPUs_at_startup);
}
}
开发者ID:ushamandya,项目名称:xenadmin,代码行数:28,代码来源:ChangeVCPUSettingsAction.cs
示例17: CreateVIFAction
public CreateVIFAction(VM vm, Proxy_VIF proxyVIF)
: base(vm.Connection, String.Format(Messages.ACTION_VIF_CREATING_TITLE, vm.Name))
{
_proxyVIF = proxyVIF;
VM = vm;
XmlRpcMethods.ForEach( method => ApiMethodsToRoleCheck.Add( method ) );
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:CreateVIFAction.cs
示例18: PageLoaded
public override void PageLoaded(PageLoadedDirection direction)
{
base.PageLoaded(direction);
VM template = SelectedTemplate;
bool installMethodIsNetwork = SelectedInstallMethod == InstallMethod.Network;
if (template == Template && InstallMethodIsNetwork == installMethodIsNetwork)
return;
Template = template;
InstallMethodIsNetwork = installMethodIsNetwork;
if ((!Template.DefaultTemplate && !Template.HasAtLeastOneDisk)
|| (Template.IsHVM && InstallMethodIsNetwork)) // CA-46213 The default should be "diskless" if the install method is "boot from network"
{
DisklessVMRadioButton.Checked = true;
}
else
DisksRadioButton.Checked = true;
DisksGridView.Rows.Clear();
LoadDisks();
UpdateEnablement();
UpdateCloneCheckboxEnablement(true);
DisksGridView.Select();
}
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:25,代码来源:Page_Storage.cs
示例19: HAUnprotectVMAction
public HAUnprotectVMAction(VM vm)
: base(vm.Connection, string.Format(Messages.ACTION_HA_UNPROTECT_VM_TITLE, Helpers.GetName(vm),
Helpers.RestartPriorityI18n(XenAPI.VM.HA_Restart_Priority.DoNotRestart)), Messages.ACTION_HA_UNPROTECT_VM_DESCRIPTION)
{
VM = vm;
}
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:7,代码来源:HAUnprotectVMAction.cs
示例20: SetVMOtherConfigAction
public SetVMOtherConfigAction(IXenConnection connection, VM vm, string key, string val)
: base(connection, "Set VM other_config", true)
{
VM = vm;
Key = key;
Val = val;
}
开发者ID:huizh,项目名称:xenadmin,代码行数:7,代码来源:SetVMOtherConfigAction.cs
注:本文中的XenAPI.VM类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论