4.12.0
This commit is contained in:
@@ -252,6 +252,7 @@ func flattenComputeList(computes *compute.ListComputes) []map[string]interface{}
|
||||
"hot_resize": compute.HotResize,
|
||||
"network_interface_naming": compute.NetworkInterfaceNaming,
|
||||
"zone_id": compute.ZoneID,
|
||||
"weight": compute.Weight,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
@@ -265,7 +266,6 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
|
||||
temp := map[string]interface{}{
|
||||
"disk_name": bootDisk.Name,
|
||||
"disk_id": bootDisk.ID,
|
||||
"disk_type": bootDisk.Type,
|
||||
"sep_id": bootDisk.SepID,
|
||||
"shareable": bootDisk.Shareable,
|
||||
"size_max": bootDisk.SizeMax,
|
||||
@@ -279,6 +279,16 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
|
||||
"to_clean": bootDisk.ToClean,
|
||||
"cache": bootDisk.Cache,
|
||||
"blk_discard": bootDisk.BLKDiscard,
|
||||
"block_size": bootDisk.BlockSize,
|
||||
"bus_number": bootDisk.BusNumber,
|
||||
"provision": bootDisk.Provision,
|
||||
"pci_slot": bootDisk.PCISlot,
|
||||
"created_time": bootDisk.CreatedTime,
|
||||
"created_by": bootDisk.CreatedBy,
|
||||
"deleted_by": bootDisk.DeletedBy,
|
||||
"deleted_time": bootDisk.DeletedTime,
|
||||
"updated_time": bootDisk.UpdatedTime,
|
||||
"devicename": bootDisk.DeviceName,
|
||||
}
|
||||
|
||||
res = append(res, temp)
|
||||
@@ -315,7 +325,9 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
|
||||
"devicename": disk.DeviceName,
|
||||
"disk_name": disk.Name,
|
||||
"disk_id": disk.ID,
|
||||
"disk_type": disk.Type,
|
||||
"independent": disk.Independent,
|
||||
"pci_slot": disk.PCISlot,
|
||||
"bus_number": disk.BusNumber,
|
||||
"sep_id": disk.SepID,
|
||||
"shareable": disk.Shareable,
|
||||
"size_max": disk.SizeMax,
|
||||
@@ -335,6 +347,8 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex
|
||||
"permanently": pernamentlyValue,
|
||||
"cache": disk.Cache,
|
||||
"blk_discard": disk.BLKDiscard,
|
||||
"block_size": disk.BlockSize,
|
||||
"provision": disk.Provision,
|
||||
"iotune": flattenIotune(disk.IOTune),
|
||||
}
|
||||
res = append(res, temp)
|
||||
@@ -375,10 +389,23 @@ func flattenNetworkWeight(networks []interface{}, netID uint64, netType string)
|
||||
return 0
|
||||
}
|
||||
|
||||
func findBootDisk(disks compute.ListComputeDisks) *compute.ItemComputeDisk {
|
||||
func isBootDisk(diskConv map[string]interface{}, chipset string) bool {
|
||||
if chipset == "i440fx" {
|
||||
return diskConv["pci_slot"].(int) == 6
|
||||
}
|
||||
return diskConv["bus_number"].(int) == 6
|
||||
}
|
||||
|
||||
func findBootDisk(disks compute.ListComputeDisks, chipset string) *compute.ItemComputeDisk {
|
||||
for _, disk := range disks {
|
||||
if disk.Type == "B" {
|
||||
return &disk
|
||||
if chipset == "i440fx" {
|
||||
if disk.PCISlot == 6 {
|
||||
return &disk
|
||||
}
|
||||
} else {
|
||||
if disk.BusNumber == 6 {
|
||||
return &disk
|
||||
}
|
||||
}
|
||||
}
|
||||
return &compute.ItemComputeDisk{}
|
||||
@@ -393,7 +420,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
|
||||
log.Debugf("flattenCompute: ID %d, RG ID %d", computeRec.ID, computeRec.RGID)
|
||||
|
||||
devices, _ := json.Marshal(computeRec.Devices)
|
||||
bootDisk := findBootDisk(computeRec.Disks)
|
||||
bootDisk := findBootDisk(computeRec.Disks, computeRec.Chipset)
|
||||
|
||||
//check extraDisks, ipa_type, is,
|
||||
d.SetId(strconv.FormatUint(computeRec.ID, 10))
|
||||
@@ -480,6 +507,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute, pc
|
||||
d.Set("cpu_pin", computeRec.CPUPin)
|
||||
d.Set("numa_affinity", computeRec.NumaAffinity)
|
||||
d.Set("hp_backed", computeRec.HPBacked)
|
||||
d.Set("weight", computeRec.Weight)
|
||||
|
||||
d.Set("enabled", false)
|
||||
if computeRec.Status == status.Enabled {
|
||||
@@ -586,6 +614,7 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
|
||||
"acl": string(acl),
|
||||
"account_id": disk.AccountID,
|
||||
"blk_discard": disk.BLKDiscard,
|
||||
"block_size": disk.BlockSize,
|
||||
"boot_partition": disk.BootPartition,
|
||||
"bus_number": disk.BusNumber,
|
||||
"created_time": disk.CreatedTime,
|
||||
@@ -603,6 +632,7 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
|
||||
"image_id": disk.ImageID,
|
||||
"images": disk.Images,
|
||||
"iotune": flattenIotune(disk.IOTune),
|
||||
"independent": disk.Independent,
|
||||
"iqn": disk.IQN,
|
||||
"login": disk.Login,
|
||||
"milestones": disk.Milestones,
|
||||
@@ -627,8 +657,8 @@ func flattenListComputeDisks(disks compute.ListComputeDisks) []map[string]interf
|
||||
"status": disk.Status,
|
||||
"storage_policy_id": disk.StoragePolicyID,
|
||||
"tech_status": disk.TechStatus,
|
||||
"type": disk.Type,
|
||||
"to_clean": disk.ToClean,
|
||||
"provision": disk.Provision,
|
||||
"updated_time": disk.UpdatedTime,
|
||||
}
|
||||
res = append(res, temp)
|
||||
@@ -755,6 +785,7 @@ func flattenDataCompute(d *schema.ResourceData, computeRec compute.RecordCompute
|
||||
d.Set("zone_id", computeRec.ZoneID)
|
||||
d.Set("loader_meta_iso", flattenLoaderMetaIso(computeRec.LoaderMetaIso))
|
||||
d.Set("os_version", computeRec.OSVersion)
|
||||
d.Set("weight", computeRec.Weight)
|
||||
}
|
||||
|
||||
func flattenPCI(pciList compute.ListPCIDevices) []uint64 {
|
||||
|
||||
Reference in New Issue
Block a user