Esempio n. 1
0
 public void EnterMaintenanceMode(int timeout, bool?evacuatePoweredOffVms, HostMaintenanceSpec maintenanceSpec)
 {
     try
     {
         ManagedObjectReference taskReference = this.EnterMaintenanceMode_Task(timeout, evacuatePoweredOffVms, maintenanceSpec);
         this.Client.WaitForTask(taskReference);
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
 }
Esempio n. 2
0
 public void EvacuateVsanNode(HostMaintenanceSpec maintenanceSpec, int timeout)
 {
     try
     {
         VersionUtils.RequiresVersion(this.Client, VimVersion.Vim60);
         ManagedObjectReference taskReference = this.EvacuateVsanNode_Task(maintenanceSpec, timeout);
         this.Client.WaitForTask(taskReference);
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
 }
Esempio n. 3
0
 public VsanHostDiskResult[] RemoveDisk(HostScsiDisk[] disk, HostMaintenanceSpec maintenanceSpec, int?timeout)
 {
     VsanHostDiskResult[] result;
     try
     {
         VersionUtils.RequiresVersion(this.Client, VimVersion.Vim55);
         ManagedObjectReference taskReference = this.RemoveDisk_Task(disk, maintenanceSpec, timeout);
         result = (VsanHostDiskResult[])this.Client.WaitForTask(taskReference);
     }
     catch (FaultException ex)
     {
         throw FaultUtility.HandleFault(ex);
     }
     return(result);
 }
Esempio n. 4
0
        public ManagedObjectReference EvacuateVsanNode_Task(HostMaintenanceSpec maintenanceSpec, int timeout)
        {
            ManagedObjectReference result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim60);
                EvacuateVsanNodeRequestType evacuateVsanNodeRequestType = new EvacuateVsanNodeRequestType();
                evacuateVsanNodeRequestType._this           = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                evacuateVsanNodeRequestType.maintenanceSpec = (VimApi_65.HostMaintenanceSpec)VIConvert.ToWsdlType(maintenanceSpec);
                evacuateVsanNodeRequestType.timeout         = timeout;
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.EvacuateVsanNode_Task(new EvacuateVsanNode_TaskRequest(evacuateVsanNodeRequestType)).EvacuateVsanNode_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Esempio n. 5
0
        public ManagedObjectReference RemoveDisk_Task(HostScsiDisk[] disk, HostMaintenanceSpec maintenanceSpec, int?timeout)
        {
            ManagedObjectReference result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim55);
                RemoveDiskRequestType removeDiskRequestType = new RemoveDiskRequestType();
                removeDiskRequestType._this            = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                removeDiskRequestType.disk             = (VimApi_65.HostScsiDisk[])VIConvert.ToWsdlType(disk);
                removeDiskRequestType.maintenanceSpec  = (VimApi_65.HostMaintenanceSpec)VIConvert.ToWsdlType(maintenanceSpec);
                removeDiskRequestType.timeout          = timeout.GetValueOrDefault();
                removeDiskRequestType.timeoutSpecified = timeout.HasValue;
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.RemoveDisk_Task(new RemoveDisk_TaskRequest(removeDiskRequestType)).RemoveDisk_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
Esempio n. 6
0
        public ManagedObjectReference EnterMaintenanceMode_Task(int timeout, bool?evacuatePoweredOffVms, HostMaintenanceSpec maintenanceSpec)
        {
            ManagedObjectReference result;

            try
            {
                EnterMaintenanceModeRequestType enterMaintenanceModeRequestType = new EnterMaintenanceModeRequestType();
                enterMaintenanceModeRequestType._this   = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                enterMaintenanceModeRequestType.timeout = timeout;
                enterMaintenanceModeRequestType.evacuatePoweredOffVms          = evacuatePoweredOffVms.GetValueOrDefault();
                enterMaintenanceModeRequestType.evacuatePoweredOffVmsSpecified = evacuatePoweredOffVms.HasValue;
                enterMaintenanceModeRequestType.maintenanceSpec = (VimApi_65.HostMaintenanceSpec)VIConvert.ToWsdlType(maintenanceSpec);
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.EnterMaintenanceMode_Task(new EnterMaintenanceMode_TaskRequest(enterMaintenanceModeRequestType)).EnterMaintenanceMode_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }