Skip to content
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

Failure to delete a VM #42

Open
c3d opened this issue Jul 6, 2023 · 0 comments · May be fixed by #44
Open

Failure to delete a VM #42

c3d opened this issue Jul 6, 2023 · 0 comments · May be fixed by #44

Comments

@c3d
Copy link

c3d commented Jul 6, 2023

On macOS, some of the VMs that are recorded in my configuration won't delete:

% krunvm start debian-microVM
Error: error unmounting container debian-working-container: container not known
buildah returned an error:

% krunvm delete debian-microVM
Error: error unmounting container debian-working-container: container not known
buildah returned an error:

Notice the empty buildah output.

buildah only shows a restricted list of containers:

% buildah --root /Volumes/krunvm/root  --runroot /Volumes/krunvm/root list -a
CONTAINER ID  BUILDER  IMAGE ID     IMAGE NAME                       CONTAINER NAME
89619ec2a430     *     a6be1f66f70f                                  ubuntu-working-container
38114032134f     *     a6be1f66f70f                                  ubuntu-working-container-1

The container for debian-microVM is not there:

% krunvm list
[...]
debian-microVM
 CPUs: 2
 RAM (MiB): 1024
 DNS server: 1.1.1.1
 Buildah container: debian-working-container
 Workdir: /root
 Mapped volumes: {}
 Mapped ports: {}
[...]

In my VM list, many of my VMs have non-existent containers and fail the same way, e.g.:

fedora-rawhide
 CPUs: 4
 RAM (MiB): 4096
 DNS server: 1.1.1.1
 Buildah container: fedora-working-container
 Workdir: /root
 Mapped volumes: {"/Users/ddd": "/root"}
 Mapped ports: {}

What I find more concerning is that several VMs apparently share the same container. Is that normal?

bd-ubuntu
 CPUs: 8
 RAM (MiB): 8192
 DNS server: 1.1.1.1
 Buildah container: ubuntu-working-container-1
 Workdir: /ddd
 Mapped volumes: {"/Users/ddd/": "/ddd"}
 Mapped ports: {}

ubuntu-test
 CPUs: 2
 RAM (MiB): 1024
 DNS server: 1.1.1.1
 Buildah container: ubuntu-working-container-1
 Workdir:
 Mapped volumes: {}
 Mapped ports: {}

None of these VMs can be deleted using krunvm today, because the error causes the configuration to not be updated. It might be useful to add a -f option to ignore buildah errors and delete entries in the krunvm config anyway.

c3d added a commit to c3d/krunvm that referenced this issue Jul 6, 2023
There are cases where krunvm fails to delete a VM, e.g. because the
corresponding container no longer exists. Add a `--force` (or `-f`)
option to the `delete` subcommand that forces deletion of the VM
configuration in that case.

Fixes: containers#42

Signed-off-by: Christophe de Dinechin <[email protected]>
@c3d c3d linked a pull request Jul 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant