Skip to content

Commit

Permalink
providers/azure: add support for azure gen2 VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
sohankunkerkar committed Jun 25, 2021
1 parent 3e9e891 commit c75b6cb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion internal/providers/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ func FetchFromOvfDevice(f *resource.Fetcher, ovfFsTypes []string) (types.Config,
logger := f.Logger
logger.Debug("waiting for config DVD...")

waitForCdrom(logger, devicePath)
device, err := execUtil.GetUdfBlockDevices()
if err != nil {
logger.Debug("falling back to gen1 settings")
} else if len(device) > 0 {
for _, dev := range device {
devicePath = dev
waitForCdrom(logger, devicePath)
}
}

waitForCdrom(logger, devicePath)
fsType, err := checkOvfFsType(logger, devicePath, ovfFsTypes)
if err != nil {
return types.Config{}, report.Report{}, err
Expand Down Expand Up @@ -108,8 +117,13 @@ func FetchFromOvfDevice(f *resource.Fetcher, ovfFsTypes []string) (types.Config,
}

func waitForCdrom(logger *log.Logger, devicePath string) {
s := 10
for !isCdromPresent(logger, devicePath) {
if s == 0 {
break
}
time.Sleep(time.Second)
s--
}
}

Expand Down

0 comments on commit c75b6cb

Please sign in to comment.