Пример #1
0
 private ManagementPath GetDiskDriveOnScsiController(ComputerSystem vm, string addrOnController)
 {
     VirtualSystemSettingData vmSettings = GetVmSettings(vm);
     var wmiObjCollection = GetResourceAllocationSettings(vmSettings);
     foreach (ResourceAllocationSettingData wmiObj in wmiObjCollection)
     {
         if (wmiObj.ResourceSubType == HARDDISK_DRIVE)
         {
             ResourceAllocationSettingData parent = new ResourceAllocationSettingData(new ManagementObject(wmiObj.Parent));
             if (parent.ResourceSubType == SCSI_CONTROLLER && wmiObj.AddressOnParent == addrOnController)
             {
                 return wmiObj.Path;
             }
         }
     }
     return null;
 }
 public ResourceAllocationSettingData(System.Management.ManagementScope mgmtScope, string keyInstanceID)
 {
     this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(ResourceAllocationSettingData.ConstructPath(keyInstanceID)), null);
 }