public static bool CheckServerState(VMForPCSettingsName control, string connString, string connName, int serviceId) { var ws = new VirtualizationServerForPrivateCloud(); ServiceProviderProxy.Init(ws, serviceId); return ws.CheckServerState(control, connString, connName); }
private static VirtualizationServerForPrivateCloud GetVirtualizationProxy(int serviceId) { var ws = new VirtualizationServerForPrivateCloud(); ServiceProviderProxy.Init(ws, serviceId); return ws; }
private static bool JobCompleted(VirtualizationServerForPrivateCloud vs, ConcreteJob job) { TaskManager.IndicatorMaximum = 100; bool jobCompleted = true; while (job.JobState == ConcreteJobState.Starting || job.JobState == ConcreteJobState.Running) { System.Threading.Thread.Sleep(1000); VMInfo vm = vs.GetVirtualMachine(job.Id); TaskManager.IndicatorCurrent = 50; if (vm.State == job.TargetState) { job.JobState = ConcreteJobState.Completed; } else if(vm.ProvisioningStatus == VirtualMachineProvisioningStatus.Error) { job.JobState = ConcreteJobState.Exception; } } if (job.JobState != ConcreteJobState.Completed) { jobCompleted = false; } TaskManager.IndicatorCurrent = 0; // reset indicator return jobCompleted; }
public static VirtualSwitch[] GetExternalSwitches(int serviceId, string computerName) { var vs = new VirtualizationServerForPrivateCloud(); ServiceProviderProxy.Init(vs, serviceId); return vs.GetExternalSwitches(computerName); }