-
Notifications
You must be signed in to change notification settings - Fork 145
feat: Add disk image format selection with ASIF support #1094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8453203 to
b7f0c5e
Compare
- Use .uncached caching mode for ASIF disks to avoid Virtualization framework compatibility issues - Improve caching mode selection logic for better maintainability - Fix compiler warning by changing var to let for attachment variable This resolves VM startup failures when using ASIF disk format by ensuring proper disk attachment configuration.
fkorotkov
commented
Jun 15, 2025
Change from 'brew install --cask goreleaser-pro' to 'brew install --cask goreleaser/tap/goreleaser-pro' for proper installation from the official goreleaser tap.
- Remove .vscode/launch.json from repository - Add .vscode/ to .gitignore to prevent VS Code settings from being tracked
- Add support for resizing ASIF disk images using diskutil image resize - Detect disk format from VM config and route to appropriate resize method - Use diskutil image info to get current ASIF disk size and validate resize - Remove restriction that prevented ASIF disk resizing in Set command - Add FailedToResizeDisk error case for proper error handling - Maintain backward compatibility with raw disk resizing - Add comprehensive size validation to prevent data loss
fkorotkov
added a commit
to cirruslabs/packer-plugin-tart
that referenced
this pull request
Jun 15, 2025
Add support for --disk-format argument to specify disk image format when creating VMs with from_ipsw or from_iso. Changes: - Add DiskFormat field to Config struct with validation - Support 'raw' (default) and 'asif' disk formats - Pass --disk-format argument to tart create command - Update HCL2 specification for new field - Add comprehensive documentation - Include example configuration demonstrating usage ASIF (Apple Sparse Image Format) provides better performance but requires macOS 15+ for usage and macOS 26+ for creation. Implements support for cirruslabs/tart#1094
edigaryev
reviewed
Jun 17, 2025
| try diskFileHandle.close() | ||
| } | ||
|
|
||
| private func resizeASIFDisk(_ sizeGB: UInt16) throws { |
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be logical to move this function and functions below to DiskImageFormat instead now that we have it.
edigaryev
reviewed
Jun 17, 2025
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
- Rename testFormatArgument to testCaseInsensitivity for clarity - Remove redundant 'raw' and 'invalid' test cases already covered in testFormatFromString - Remove testFormatDescriptions test as it's not very useful Addresses review comment: #1094 (comment)
- Remove canCreate property since it's the same as isSupported - Remove description property entirely as it's not used - Fix displayName for RAW format (remove UDIF reference) - Remove checkDiskutilASIFSupport helper function Addresses review comments: - #1094 (comment) - #1094 (comment) - #1094 (comment)
- Simplify ArgumentParser help text to let it show possible values automatically - Remove canCreate validation since property was removed - Simplify error message for unsupported disk formats Addresses review comment: #1094 (comment)
- Add validation to ensure ASIF disk format is supported on current system - Check disk format compatibility before attempting to run VM Addresses review comment: #1094 (comment)
- Add diskFormatLabelAnnotation constant in Manifest.swift - Use org.cirruslabs.tart.disk.format namespace for consistency - Use variable shadowing instead of new variable name for labels Addresses review comment: #1094 (comment)
- Remove .uncached caching mode for ASIF disks - Use default caching logic for all disk formats - Testing shows .cached mode works fine on macOS 26.0 Addresses review comment: #1094 (comment)
- Use guard let instead of nested if let for better readability - Reduce nesting in resizeASIFDisk function - Improve error handling flow Addresses review comment: #1094 (comment)
edigaryev
reviewed
Jun 19, 2025
edigaryev
reviewed
Jun 19, 2025
Collaborator
|
@fkorotkov please take a look at the review comments once more. Some of them were not addressed, for example, #1094 (comment). |
edigaryev
approved these changes
Jun 19, 2025
fkorotkov
added a commit
to cirruslabs/packer-plugin-tart
that referenced
this pull request
Sep 11, 2025
Add support for --disk-format argument to specify disk image format when creating VMs with from_ipsw or from_iso. Changes: - Add DiskFormat field to Config struct with validation - Support 'raw' (default) and 'asif' disk formats - Pass --disk-format argument to tart create command - Update HCL2 specification for new field - Add comprehensive documentation - Include example configuration demonstrating usage ASIF (Apple Sparse Image Format) provides better performance but requires macOS 15+ for usage and macOS 26+ for creation. Implements support for cirruslabs/tart#1094
edigaryev
added a commit
to cirruslabs/packer-plugin-tart
that referenced
this pull request
Sep 16, 2025
* feat: Add disk_format support for tart create command Add support for --disk-format argument to specify disk image format when creating VMs with from_ipsw or from_iso. Changes: - Add DiskFormat field to Config struct with validation - Support 'raw' (default) and 'asif' disk formats - Pass --disk-format argument to tart create command - Update HCL2 specification for new field - Add comprehensive documentation - Include example configuration demonstrating usage ASIF (Apple Sparse Image Format) provides better performance but requires macOS 15+ for usage and macOS 26+ for creation. Implements support for cirruslabs/tart#1094 * fix: Skip disk resizing for ASIF disks ASIF disks should not be resized using file truncation or in-guest partition resizing. Instead, they should be resized using diskutil on the host (handled by tart set --disk-size command). Changes: - Skip growDisk() operation for ASIF disks in step_disk_file_prepare.go - Skip in-guest partition resizing for ASIF disks in step_disk_resize.go - Add informative messages explaining why resizing is skipped This prevents errors when trying to resize ASIF disk images and ensures proper disk management for the ASIF format. * Update docs/builders/tart.mdx Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com> * resize a VM via `tart set` * review comments * Fix import errors (#203) * ASIF support PR improvements (#204) * $ make generate * Don't forget to set statekey.DiskChanged --------- Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com> Co-authored-by: Brian Michel <brian.michel@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Used http://augmentcode.com/ to generate the following in 3 prompts. See each commit.
This adds support ASIF (Apple Sparse Image Format) provides better performance on macOS 26 Tahoe and later systems while maintaining compatibility with existing RAW disk workflows.
In addition each VM config now has a metadata about the format and
tart set --disk-size Nwill usediskutilsto resize which is reflected in the VM (no need to SSH and run the extra step inside of the guest).