コード例 #1
0
        public VStorageObject CreateDisk(VslmCreateSpec spec)
        {
            VStorageObject result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim65);
                ManagedObjectReference taskReference = this.CreateDisk_Task(spec);
                result = (VStorageObject)this.Client.WaitForTask(taskReference);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }
コード例 #2
0
        public ManagedObjectReference CreateDisk_Task(VslmCreateSpec spec)
        {
            ManagedObjectReference result;

            try
            {
                VersionUtils.RequiresVersion(this.Client, VimVersion.Vim65);
                CreateDiskRequestType createDiskRequestType = new CreateDiskRequestType();
                createDiskRequestType._this = (VimApi_65.ManagedObjectReference)VIConvert.ToWsdlType(this.MoRef);
                createDiskRequestType.spec  = (VimApi_65.VslmCreateSpec)VIConvert.ToWsdlType(spec);
                result = (ManagedObjectReference)VIConvert.ToVim(this.VimServiceProxy.CreateDisk_Task(new CreateDisk_TaskRequest(createDiskRequestType)).CreateDisk_TaskResponse.returnval);
            }
            catch (FaultException ex)
            {
                throw FaultUtility.HandleFault(ex);
            }
            return(result);
        }