-
Notifications
You must be signed in to change notification settings - Fork 292
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
Add experimental options for vm-type and use-rosetta #4063
Conversation
b00c6f3
to
4f4d8e8
Compare
3b30797
to
f822bf7
Compare
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.
Looks good as far as I can tell. We may want to consider the use of the new code from #4036, as mentioned in my comment.
I tested kubernetes reset and port changes, and things look alright there. However, I can't test the openVZ stuff since I don't have a mac. I've asked on team-rancher-desktop if someone else can test this part of the changes. We should probably wait to merge until that has been done.
} | ||
|
||
protected checkVMType(mergedSettings: Settings, currentValue: string, desiredValue: string, errors: string[], fqname: string): boolean { | ||
if (desiredValue === VMType.VZ && parseInt(os.release()) < 22) { |
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.
If the k8smanager.del() function needs the VM to be stopped, it can do it by itself (and already did/does). Signed-off-by: Jan Dubois <[email protected]>
We may still need to download even when adminAccess is true (if the user declines to enter the admin password when needed), but if we already know that we are not even going to ask, then there is no need to generate a lima.yaml that references networks that are not (yet) defined in _config/networks.yaml. Signed-off-by: Jan Dubois <[email protected]>
Otherwise it will get stripped from limactl.ventura, breaking vz support. Signed-off-by: Jan Dubois <[email protected]>
Also mount-type=virtiofs Signed-off-by: Jan Dubois <[email protected]>
This will allow us to reuse the implementation for other binaries in the future. Signed-off-by: Jan Dubois <[email protected]>
When starting VZ mode VM because it doesn't support qcow2. Need to convert to a temporary file because in-place conversion drop the partition table (so does not really convert at all). Signed-off-by: Jan Dubois <[email protected]>
Signed-off-by: Jan Dubois <[email protected]>
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.
Sorry I didn't find these things on the first review. I don't think any of them are showstoppers though - I'll leave it up to you if you want to merge or not.
pkg/rancher-desktop/backend/lima.ts
Outdated
} | ||
|
||
protected convertToRaw(fileName: string): Promise<void> { | ||
return (async() => { |
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.
This doesn't need to be in an IIFE:
protected async convertToRaw(fileName: string): Promise<void> {
const rawFileName = `${ fileName }.raw`;
await this.spawnWithCapture(LimaBackend.qemuImg, 'convert', fileName, rawFileName);
await fs.promises.unlink(fileName);
await fs.promises.rename(rawFileName, fileName);
}
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.
I don't know, but given that the other methods are all wrapped like this, I guess it can't hurt.
Signed-off-by: Jan Dubois <[email protected]>
type: | ||
type: string | ||
enum: ['qemu', 'vz'] | ||
x-rd-platforms: ['darwin'] |
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.
nit; for consistency we should just remove the quotes: [darwin]
Signed-off-by: Jan Dubois <[email protected]>
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.
Reviewed the last commit and it looks fine, only left a small comment that can be addressed in future PRs too.
Signed-off-by: Jan Dubois <[email protected]>
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.
Signed-off-by: Jan Dubois <[email protected]>
Add
experimental.virtualMachine.type
andexperimental.virtualMachine.useRosetta
options for use on macOS 13 (Ventura).The persistent volume will be converted from QCOW2 to RAW format the first time the vm type is set to
vz
. It is possible to switch back toqemu
while keeping the disk in RAW format.Shutting down a
vz
VM takes an additional 3 minutes due to a crash in the bindings: lima-vm/lima#1381. Contrary to the Lima bug description, the delay is not always limited to the first stopping of the VM.Fixes #3944