lima
lima copied to clipboard
vz: remove "basedisk"; rename "diffdisk"
For vz, "basedisk" is not depended by "diffdisk" after qcow2-to-raw conversion, so "basedisk" should be removed and "diffdisk" should be renamed to something else. (Maybe just "disk")
basedisk file still be needed for alpine case right ?
We can remove basedisk if we go ahead with the conversion of basedisk to rawdisk. In other case we will retain basedisk
basedisk file still be needed for alpine case right ?
Yes, but the names have always been misleading.
For Alpine basedisk is really iso and diffdisk is disk.
If you are refactoring the code and change names, then fixing it for Alpine might be good too.
The thing I worry about though are updates: we will have to migrate old Lima instances to the new naming scheme when you update Lima. And then you cannot downgrade again without renaming the files back manually (remember when colima was broken with the latest lima and you had to downgrade to get back access to your data?).
And at what point could we drop the migration code to update old instances from the Lima codebase?
So I'm not sure if the benefit of renaming is worth the effort and potential issues.
Existing instances will have to use old names, only new instances will use the new layout
Removing/renaming "basedisk" will break the workaround that I did for nerdctl-full
commit 4efb676b52e68349bb934c0d31d8a00110218399
It will need some other workaround or placeholder file, to know if instance is created.
// Check if the instance has been created (the base disk already exists)
created := false
baseDisk := filepath.Join(inst.Dir, filenames.BaseDisk)
if _, err := os.Stat(baseDisk); err == nil {
created = true
}
See also: Hyrum's Law
Another weird corner case was VirtualBox, that relies on file extensions to work
I used some symlinks as a workaround, in order to keep backwards compatibility...
basedisk -> basedisk.img
basedisk -> basedisk.iso