-
Notifications
You must be signed in to change notification settings - Fork 112
feat: make disk sizes configurable on macos #1733
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
base: main
Are you sure you want to change the base?
Changes from all commits
c746f93
3430859
1a39d3c
1ad0318
4cf43d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,16 @@ func newSettingsVMCommand( | |
| config.DefaultMemory, | ||
| "the amount of memory to dedicate to the virtual machine (restart the vm when applying this change.)", | ||
| ) | ||
| settingsVMCommand.Flags().String( | ||
| "bootdisk", | ||
| config.DefaultBootDisk, | ||
| "the amount of boot disk space (sparse) to give to the virtual machine (restart the vm when applying this change.)", | ||
| ) | ||
| settingsVMCommand.Flags().String( | ||
| "datadisk", | ||
| config.DefaultDataDisk, | ||
| "the amount of data disk space (sparse) to give to the virtual machine (restart the vm when applying this change.)", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above, warning that this cannot be lowered in the future
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does not make sense to add a warning here as this command just updates the config and does not perform the resize operation (the resizing happens on next vm start/init). |
||
| ) | ||
|
|
||
| return settingsVMCommand | ||
| } | ||
|
|
@@ -74,11 +84,23 @@ func (sva *settingsVMAction) runAdapter(cmd *cobra.Command, _ []string) error { | |
| return err | ||
| } | ||
|
|
||
| bootDisk, err := cmd.Flags().GetString("bootdisk") | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| dataDisk, err := cmd.Flags().GetString("datadisk") | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| cpusChanged := cmd.Flags().Changed("cpus") | ||
| memoryChanged := cmd.Flags().Changed("memory") | ||
| bootDiskChanged := cmd.Flags().Changed("bootdisk") | ||
| dataDiskChanged := cmd.Flags().Changed("datadisk") | ||
|
|
||
| // check if any flags were provided by the user | ||
| if !cpusChanged && !memoryChanged { | ||
| if !cpusChanged && !memoryChanged && !bootDiskChanged && !dataDiskChanged { | ||
| return cmd.Help() | ||
| } | ||
|
|
||
|
|
@@ -90,6 +112,13 @@ func (sva *settingsVMAction) runAdapter(cmd *cobra.Command, _ []string) error { | |
| opts.Memory = &memory | ||
| } | ||
|
|
||
| if bootDiskChanged { | ||
| opts.BootDisk = &bootDisk | ||
| } | ||
| if dataDiskChanged { | ||
| opts.DataDisk = &dataDisk | ||
| } | ||
|
|
||
| return sva.run(opts) | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.