Merge pull request #9940 from hashicorp/fix_9936
skip slot 7 in disk creation so we don't use reserved slot
This commit is contained in:
commit
f28cabb162
|
@ -45,8 +45,13 @@ func (s *StepCreateDisks) Run(ctx context.Context, state multistep.StateBag) mul
|
|||
}
|
||||
// Additional disks
|
||||
if len(s.AdditionalDiskSize) > 0 {
|
||||
incrementer := 1
|
||||
for i, diskSize := range s.AdditionalDiskSize {
|
||||
path := filepath.Join(*s.OutputDir, fmt.Sprintf("%s-%d.vmdk", s.DiskName, i+1))
|
||||
// scsi slot 7 is reserved, so we skip it.
|
||||
if i+incrementer == 7 {
|
||||
incrementer = 2
|
||||
}
|
||||
path := filepath.Join(*s.OutputDir, fmt.Sprintf("%s-%d.vmdk", s.DiskName, i+incrementer))
|
||||
diskFullPaths = append(diskFullPaths, path)
|
||||
size := fmt.Sprintf("%dM", uint64(diskSize))
|
||||
diskSizes = append(diskSizes, size)
|
||||
|
|
|
@ -107,9 +107,14 @@ func (s *stepCreateVMX) Run(ctx context.Context, state multistep.StateBag) multi
|
|||
|
||||
// Mount extra vmdks we created earlier.
|
||||
if len(config.AdditionalDiskSize) > 0 {
|
||||
incrementer := 1
|
||||
for i := range config.AdditionalDiskSize {
|
||||
// slot 7 is special and reserved, so we need to skip that index.
|
||||
if i+1 == 7 {
|
||||
incrementer = 2
|
||||
}
|
||||
ictx.Data = &additionalDiskTemplateData{
|
||||
DiskNumber: i + 1,
|
||||
DiskNumber: i + incrementer,
|
||||
DiskName: config.DiskName,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue