give temp data disks lun suffix
This commit is contained in:
parent
4c96847683
commit
aa8250bcc8
|
@ -84,8 +84,6 @@ func (s *StepCreateNewDiskset) Run(ctx context.Context, state multistep.StateBag
|
|||
futures := []Future{{osDisk, f}}
|
||||
|
||||
if s.SourceImageResourceID != "" {
|
||||
datadiskSuffix := 0 // initialize
|
||||
|
||||
// retrieve image to see if there are any datadisks
|
||||
imageID, err := client.ParseResourceID(s.SourceImageResourceID)
|
||||
if err != nil {
|
||||
|
@ -108,8 +106,7 @@ func (s *StepCreateNewDiskset) Run(ctx context.Context, state multistep.StateBag
|
|||
if ddi.Lun == nil {
|
||||
return errorMessage("unexpected: lun is null for data disk # %d", i)
|
||||
}
|
||||
datadiskID, err := client.ParseResourceID(fmt.Sprintf("%s%d", s.DataDiskIDPrefix, datadiskSuffix))
|
||||
datadiskSuffix++
|
||||
datadiskID, err := client.ParseResourceID(fmt.Sprintf("%s%d", s.DataDiskIDPrefix, *ddi.Lun))
|
||||
if err != nil {
|
||||
return errorMessage("unable to construct resource id for datadisk: %v", err)
|
||||
}
|
||||
|
|
|
@ -165,9 +165,9 @@ func TestStepCreateNewDisk_Run(t *testing.T) {
|
|||
want: multistep.ActionContinue,
|
||||
verifyDiskset: &Diskset{
|
||||
-1: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryOSDiskName"),
|
||||
3: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryDataDisk-2"),
|
||||
5: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryDataDisk-0"),
|
||||
9: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryDataDisk-1"),
|
||||
3: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryDataDisk-3"),
|
||||
5: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryDataDisk-5"),
|
||||
9: resource("/subscriptions/SubscriptionID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/disks/TemporaryDataDisk-9"),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue