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

Failed to create loopback storage #147

Closed
3lding opened this issue Feb 26, 2021 · 0 comments
Closed

Failed to create loopback storage #147

3lding opened this issue Feb 26, 2021 · 0 comments

Comments

@3lding
Copy link

3lding commented Feb 26, 2021

Hello

I tried to spawn an lxc container with a loopback storage device as backend type.
But it failed to create the storage device.
Following lines were logged:

lxc 20210226152722.259 ERROR    lxccontainer - lxccontainer.c:do_storage_create:1272 - Failed to create "loopback" storage
lxc 20210226152722.259 ERROR    lxccontainer - lxccontainer.c:do_lxcapi_create:1869 - Failed to create loopback storage for test0
lxc 20210226153541.279 ERROR    lxccontainer - lxccontainer.c:do_storage_create:1272 - Failed to create "loopback" storage
lxc 20210226153541.279 ERROR    lxccontainer - lxccontainer.c:do_lxcapi_create:1869 - Failed to create loopback storage for test0
lxc 20210226154424.601 ERROR    lxccontainer - lxccontainer.c:do_storage_create:1272 - Failed to create "loopback" storage
lxc 20210226154424.601 ERROR    lxccontainer - lxccontainer.c:do_lxcapi_create:1869 - Failed to create loopback storage for test0
lxc 20210226154726.197 ERROR    lxccontainer - lxccontainer.c:do_storage_create:1272 - Failed to create "loopback" storage
lxc 20210226154726.197 ERROR    lxccontainer - lxccontainer.c:do_lxcapi_create:1869 - Failed to create loopback storage for test0
lxc 20210226155147.131 ERROR    lxccontainer - lxccontainer.c:do_storage_create:1272 - Failed to create "loopback" storage
lxc 20210226155147.131 ERROR    lxccontainer - lxccontainer.c:do_lxcapi_create:1869 - Failed to create loopback storage for test0

For creating an instance I copied the examples/create.go and modified the function init() inside it:

func init() {
        flag.StringVar(&lxcpath, "lxcpath",  lxc.DefaultConfigPath(), "Use specified container path")
        flag.StringVar(&template, "template", "debian", "Template to use")
        flag.StringVar(&distro, "distro", "debian", "Template to use")
        flag.StringVar(&release, "release", "buster", "Template to use")
        flag.StringVar(&arch, "arch", "amd64", "Template to use")
        flag.StringVar(&name, "name", "test0", "Name of the container")
        flag.BoolVar(&verbose, "verbose", true, "Verbose output")
        flag.BoolVar(&flush, "flush", false, "Flush the cache")
        flag.BoolVar(&validation, "validation", false, "GPG validation")
        flag.StringVar(&bdevtype, "bdev", "loopback", "backing store type")
        flag.StringVar(&fssize, "fssize", "8192MB", "backing store size")
        flag.Parse()
}

I tried this on Ubuntu 20.04 as well as on Debian 10.8 with Go 1.16/1.15.7 and both resulted with the same error.
Are there any required parameters missing to create the loopback storage device? 🤔

If I try to create the container with lxc-create -t debian -B loop --fssize 8192 -n test0 -- -a amd64 -r buster the container instance will be created without any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant