From c927940e0a6f14574035b1d8bbf26b4efd9f1456 Mon Sep 17 00:00:00 2001 From: Maksim An Date: Thu, 6 Nov 2025 02:45:35 -0800 Subject: [PATCH] add EVD support for LCOW Add handling of Extensible Virtual Disks mounts for LCOW. Prior to this change, EVDs were supported only for WCOW. The expectation is that the EVD will be presented to container as a block device. Signed-off-by: Maksim An --- internal/hcsoci/resources_lcow.go | 20 ++++++++++++++++++++ internal/uvm/scsi/manager.go | 1 + 2 files changed, 21 insertions(+) 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,