Skip to content

Commit

Permalink
Update CreateDisk() - Specify Zone when Creating a Disk
Browse files Browse the repository at this point in the history
  • Loading branch information
innodreamer committed Apr 17, 2024
1 parent 42f768b commit 54773ee
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (diskHandler *NhnCloudDiskHandler) CreateDisk(diskReqInfo irs.DiskInfo) (ir
return irs.DiskInfo{}, newErr
}

if strings.EqualFold(diskHandler.RegionInfo.Zone, "") {
if strings.EqualFold(diskReqInfo.Zone, "") {
newErr := fmt.Errorf("Invalid Zone Info!!")
cblogger.Error(newErr.Error())
LoggingError(callLogInfo, newErr)
Expand Down Expand Up @@ -91,7 +91,7 @@ func (diskHandler *NhnCloudDiskHandler) CreateDisk(diskReqInfo irs.DiskInfo) (ir
start := call.Start()
create0pts := volumes.CreateOpts{
Size: reqDiskSizeInt,
AvailabilityZone: diskHandler.RegionInfo.Zone,
AvailabilityZone: diskReqInfo.Zone,
Name: diskReqInfo.IId.NameId,
VolumeType: reqDiskType,
}
Expand Down Expand Up @@ -579,6 +579,7 @@ func (diskHandler *NhnCloudDiskHandler) mappingDiskInfo(volume volumes.Volume) (
IId: irs.IID{
SystemId: volume.ID,
},
Zone: volume.AvailabilityZone,
DiskSize: strconv.Itoa(volume.Size),
Status: convertDiskStatus(volume.Status),
CreatedTime: volume.CreatedAt,
Expand Down Expand Up @@ -613,7 +614,7 @@ func (diskHandler *NhnCloudDiskHandler) mappingDiskInfo(volume volumes.Volume) (
}

keyValueList := []irs.KeyValue{
{Key: "AvailabilityZone", Value: volume.AvailabilityZone},
// {Key: "AvailabilityZone", Value: volume.AvailabilityZone},
{Key: "IsBootable", Value: volume.Bootable},
{Key: "IsMultiattached", Value: strconv.FormatBool(volume.Multiattach)},
{Key: "IsEncrypted", Value: strconv.FormatBool(volume.Encrypted)},
Expand Down

0 comments on commit 54773ee

Please sign in to comment.