lima icon indicating copy to clipboard operation
lima copied to clipboard

vz: remove "basedisk"; rename "diffdisk"

Open AkihiroSuda opened this issue 2 years ago • 18 comments

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")

AkihiroSuda avatar Aug 01 '23 23:08 AkihiroSuda

basedisk file still be needed for alpine case right ?

balajiv113 avatar Oct 05 '23 17:10 balajiv113

We can remove basedisk if we go ahead with the conversion of basedisk to rawdisk. In other case we will retain basedisk

balajiv113 avatar Oct 05 '23 17:10 balajiv113

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.

jandubois avatar Oct 05 '23 17:10 jandubois

Existing instances will have to use old names, only new instances will use the new layout

AkihiroSuda avatar Oct 05 '23 18:10 AkihiroSuda

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

afbjorklund avatar Oct 05 '23 18:10 afbjorklund

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

afbjorklund avatar Oct 05 '23 18:10 afbjorklund