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

Container and volumes data does not persist between different VM instances #180

Closed
mharwani opened this issue Jan 23, 2023 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@mharwani
Copy link
Member

Describe the bug
Cannot start a created container after a new installation of Finch, or after VM re-initialization.

Steps to reproduce

  1. finch run --name test-container -v ~/workplace:/workplace alpine ls /workplace
  2. finch vm stop && finch vm remove && finch vm init
INFO[0000] Stopping existing Finch virtual machine...   
INFO[0003] Finch virtual machine stopped successfully   
INFO[0000] Removing existing Finch virtual machine...   
INFO[0000] Finch virtual machine removed successfully   
INFO[0000] Initializing and starting Finch virtual machine... 
INFO[0103] Finch virtual machine started successfully
  1. finch ps -a
CONTAINER ID    IMAGE                              COMMAND            CREATED          STATUS     PORTS    NAMES
6afe448dcc57    docker.io/library/alpine:latest    "ls /workplace"    4 minutes ago    Created             test-container
  1. finch start --attach test-container
FATA[0000] failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/mharwani.linux/.local/share/nerdctl/1935db59/containers/finch/6afe448dcc572d9dceec82d1e5d1c42ba70d46106de062eea277aa696fe5db43/hostname" to rootfs at "/etc/hostname": stat /home/mharwani.linux/.local/share/nerdctl/1935db59/containers/finch/6afe448dcc572d9dceec82d1e5d1c42ba70d46106de062eea277aa696fe5db43/hostname: no such file or directory: unknown 
FATA[0000] exit status 1

Expected behavior
test-container should start and display contents of ~/workplace without error.

Additional context
nerdctl user data (located in ~/.local/share/nerdctl) is not stored in the persistent disk. This directory stores important information such as volumes, container names, hostnames, etc. May want to add ~/.local/share/nerdctl to additionalDisks

@mharwani mharwani added the bug Something isn't working label Jan 23, 2023
@weikequ weikequ assigned weikequ and sam-berning and unassigned weikequ Jan 23, 2023
@weikequ
Copy link
Contributor

weikequ commented Jan 23, 2023

Can reproduce on my own machine running finch v0.3.0 running macOS 12.6.2 on arm64.

❯ finch start --attach test-container
FATA[0000] failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/home/weikequ.linux/.local/share/nerdctl/1935db59/containers/finch/f3e61d48e1c90618549c835f1ec52cb39c1ad650c186752ba4cbf87247cf477d/hostname" to rootfs at "/etc/hostname": stat /home/weikequ.linux/.local/share/nerdctl/1935db59/containers/finch/f3e61d48e1c90618549c835f1ec52cb39c1ad650c186752ba4cbf87247cf477d/hostname: no such file or directory: unknown
FATA[0000] exit status 1

sam-berning added a commit that referenced this issue Jan 24, 2023
Signed-off-by: Sam Berning <[email protected]>

Issue #, if available: #180

*Description of changes:*

Changes format of persistent disk to support saving nerdctl user data

*Testing done:*

```
$ finch run --name test-container -v ~/scratch:/scratch alpine ls /scratch
$ finch vm stop
$ finch vm remove
$ finch vm init
$ finch start --attach test-container
```

- [x] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

Signed-off-by: Sam Berning <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants