Skip to content

Commit bcfd4f6

Browse files
committed
add EVD support for LCOW
Signed-off-by: Maksim An <[email protected]>
1 parent 512dd27 commit bcfd4f6

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

internal/hcsoci/resources_lcow.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func allocateLinuxResources(ctx context.Context, coi *createOptionsInternal, r *
6161
case MountTypeBind:
6262
case MountTypePhysicalDisk:
6363
case MountTypeVirtualDisk:
64+
case MountTypeExtensibleVirtualDisk:
6465
default:
6566
// Unknown mount type
6667
continue
@@ -129,6 +130,25 @@ func allocateLinuxResources(ctx context.Context, coi *createOptionsInternal, r *
129130
mt = "bind"
130131
}
131132
coi.Spec.Mounts[i].Type = mt
133+
} else if mount.Type == MountTypeExtensibleVirtualDisk {
134+
l.Debug("hcsshim::allocateLinuxResources Hot-adding ExtensbleVirtualDisk")
135+
scsiMount, err := coi.HostingSystem.SCSIManager.AddExtensibleVirtualDisk(
136+
ctx,
137+
hostPath,
138+
readOnly,
139+
"",
140+
&scsi.MountConfig{Options: mount.Options, BlockDev: isBlockDev},
141+
)
142+
if err != nil {
143+
return fmt.Errorf("adding Extensible virtual disk mount %+v: %w", mount, err)
144+
}
145+
r.Add(scsiMount)
146+
uvmPathForFile = scsiMount.GuestPath()
147+
mt := "none"
148+
if isBlockDev {
149+
mt = "bind"
150+
}
151+
coi.Spec.Mounts[i].Type = mt
132152
} else if strings.HasPrefix(mount.Source, guestpath.SandboxMountPrefix) || strings.HasPrefix(mount.Source, guestpath.UVMMountPrefix) {
133153
// Mounts that map to a path in UVM are specified with a 'sandbox://' or 'uvm://' prefix.
134154
// examples:

internal/uvm/scsi/manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ func (m *Manager) AddExtensibleVirtualDisk(
256256
options: mc.Options,
257257
ensureFilesystem: mc.EnsureFilesystem,
258258
filesystem: mc.Filesystem,
259+
blockDev: mc.BlockDev,
259260
}
260261
}
261262
return m.add(ctx,

0 commit comments

Comments
 (0)