diff --git a/internal/hcsoci/resources_lcow.go b/internal/hcsoci/resources_lcow.go index af1486802f..3da1180683 100644 --- a/internal/hcsoci/resources_lcow.go +++ b/internal/hcsoci/resources_lcow.go @@ -61,6 +61,7 @@ func allocateLinuxResources(ctx context.Context, coi *createOptionsInternal, r * case MountTypeBind: case MountTypePhysicalDisk: case MountTypeVirtualDisk: + case MountTypeExtensibleVirtualDisk: default: // Unknown mount type continue @@ -129,6 +130,25 @@ func allocateLinuxResources(ctx context.Context, coi *createOptionsInternal, r * mt = "bind" } coi.Spec.Mounts[i].Type = mt + } else if mount.Type == MountTypeExtensibleVirtualDisk { + l.Debug("hcsshim::allocateLinuxResources Hot-adding ExtensbleVirtualDisk") + scsiMount, err := coi.HostingSystem.SCSIManager.AddExtensibleVirtualDisk( + ctx, + hostPath, + readOnly, + "", + &scsi.MountConfig{Options: mount.Options, BlockDev: isBlockDev}, + ) + if err != nil { + return fmt.Errorf("adding Extensible virtual disk mount %+v: %w", mount, err) + } + r.Add(scsiMount) + uvmPathForFile = scsiMount.GuestPath() + mt := "none" + if isBlockDev { + mt = "bind" + } + coi.Spec.Mounts[i].Type = mt } else if strings.HasPrefix(mount.Source, guestpath.SandboxMountPrefix) || strings.HasPrefix(mount.Source, guestpath.SandboxTmpfsMountPrefix) || strings.HasPrefix(mount.Source, guestpath.UVMMountPrefix) { diff --git a/internal/uvm/scsi/manager.go b/internal/uvm/scsi/manager.go index 272ea9c992..37f379ce00 100644 --- a/internal/uvm/scsi/manager.go +++ b/internal/uvm/scsi/manager.go @@ -260,6 +260,7 @@ func (m *Manager) AddExtensibleVirtualDisk( options: mc.Options, ensureFilesystem: mc.EnsureFilesystem, filesystem: mc.Filesystem, + blockDev: mc.BlockDev, } } return m.add(ctx,