Skip to content

blockcim config and plugin initialization changes - #13469

Merged
samuelkarp merged 2 commits into
containerd:mainfrom
anmaxvl:blockcim-pull-fix
Jul 14, 2026
Merged

samuelkarp merged 2 commits into
containerd:mainfrom
anmaxvl:blockcim-pull-fix

Conversation

@anmaxvl

@anmaxvl anmaxvl commented May 22, 2026 •

Copy link
Copy Markdown
Contributor

This change updates an incorrect default config value for the block CIM
snapshotter. The ntfsFormat should always be false for the block CIM
snapshotter. If the scratch needs to be formatted with NTFS, a format
option named WithNTFSFormat can be provided.

Original PR: #12439

Switch block CIM snapshotter and diff plugin init checks from
IsBlockCimSupported() to IsBlockCimWriteSupported() to allow plugins
to load when the CimWriter.dll is available, even on OS builds
without native block CIM support.

Copilot AI review requested due to automatic review settings May 22, 2026 17:50
@github-project-automation github-project-automation Bot moved this to Needs Triage in Pull Request Review May 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adjusts Block CIM feature gating on Windows and changes scratch VHD creation defaults to avoid NTFS formatting unless explicitly requested.

Changes:

  • Default scratch VHD creation now skips NTFS formatting unless WithNTFSFormat() is provided.
  • Base differencing scratch VHD creation explicitly requests NTFS formatting.
  • Block CIM snapshotter/differ plugin checks updated to IsBlockCimWriteSupported().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
plugins/snapshots/windows/cimfs.go Changes default scratch VHD formatting behavior and makes base VHD formatting explicit.
plugins/snapshots/windows/block_cimfs.go Updates Block CIM support gate to require write support.
plugins/diff/windows/cimfs.go Updates Block CIM support gate in diff plugin to require write support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 84 to 89
func defaultScratchCreationOptions() *scratchCreationOptions {
return &scratchCreationOptions{
ntfsFormat: true,
ntfsFormat: false,
sizeInBytes: defaultScratchVHDSizeInBytes,
}
}
Comment thread plugins/diff/windows/cimfs.go Resolved
Copilot AI review requested due to automatic review settings May 22, 2026 17:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment on lines 84 to 89
func defaultScratchCreationOptions() *scratchCreationOptions {
return &scratchCreationOptions{
ntfsFormat: true,
ntfsFormat: false,
sizeInBytes: defaultScratchVHDSizeInBytes,
}
}
Comment thread plugins/diff/windows/cimfs.go Resolved
@anmaxvl anmaxvl changed the title Blockcim pull fix blockcim config and plugin initialization changes May 22, 2026
@anmaxvl
anmaxvl force-pushed the blockcim-pull-fix branch from 6a1bc1b to 22615f6 Compare May 23, 2026 03:36
Copilot AI review requested due to automatic review settings May 23, 2026 05:52
@anmaxvl
anmaxvl force-pushed the blockcim-pull-fix branch from 22615f6 to 9c375b4 Compare May 23, 2026 05:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment on lines 85 to 88
return &scratchCreationOptions{
ntfsFormat: true,
ntfsFormat: false,
sizeInBytes: defaultScratchVHDSizeInBytes,
}
Comment on lines 422 to 426
if !baseVHDExists {
if err = createScratchVHD(ctx, baseVHDPath); err != nil {
if err = createScratchVHD(ctx, baseVHDPath, WithNTFSFormat()); err != nil {
return fmt.Errorf("failed to create base vhd: %w", err)
}
}
Comment on lines +99 to +100
if !cimfs.IsBlockCimWriteSupported() {
return nil, fmt.Errorf("host OS doesn't support writable block CIMs: %w", plugin.ErrSkipPlugin)
ambarve and others added 2 commits June 25, 2026 00:51
This change updates an incorrect default config value for the block CIM
snapshotter. The `ntfsFormat` should always be false for the block CIM
snapshotter. If the scratch needs to be formatted with NTFS, a format
option named `WithNTFSFormat` can be provided.

Signed-off-by: Amit Barve <[email protected]>
Switch block CIM snapshotter and diff plugin init checks from
IsBlockCimSupported() to IsBlockCimWriteSupported() to allow plugins
to load when the CimWriter.dll is available, even on OS builds
without native block CIM support.

Signed-off-by: Maksim An <[email protected]>
@anmaxvl
anmaxvl force-pushed the blockcim-pull-fix branch from 9c375b4 to 5ae5d99 Compare June 25, 2026 07:51
@anmaxvl

anmaxvl commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@kiashok , do you know who looks at Windows PRs now? 😄 @apurv15 ?

@anmaxvl

anmaxvl commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@thaJeztah maybe?

@anmaxvl

anmaxvl commented Jun 29, 2026

Copy link
Copy Markdown
Contributor Author

@cpuguy83 ?

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both changes look reasonable to me, though I'd defer to the author on intent.

Commit 1 (ntfsFormat default true → false) seems to address a real issue: with the old true default, the UnformattedScratch paths (block_cimfs.go:116 and :373) appear to have been getting NTFS-formatted despite the config name and docs suggesting they shouldn't be. Flipping the default to false and adding the explicit WithNTFSFormat() on the cimfs base VHD looks like it preserves the formatted path while fixing the unformatted ones — at least that's how I read the three call sites.

Commit 2 (IsBlockCimSupported() → IsBlockCimWriteSupported()) seems aligned with the pull scenario, and it's consistent with how hcsshim's own writer gates itself. That part feels sound.

One thing I'd want confirmed rather than assume: gating snapshotter init on write support means mount support is no longer guaranteed at init time. On a host with CimWriter but an older OS, mounting would presumably fail later at runtime instead of being skipped up front. That may well be the intended trade-off for pull, but it might be worth a sanity check.


This review was produced by Claude Opus 4.8.

@cpuguy83 cpuguy83 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM given assumptions in my review comment are good.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Jul 14, 2026
@samuelkarp
samuelkarp added this pull request to the merge queue Jul 14, 2026
Merged via the queue into containerd:main with commit 4a5b073 Jul 14, 2026
87 of 88 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants