Failure on LXD container creation

I am trying a custom installation of opennebula, frontend is in one LXD container

I went to Apps and downloaded the bionix LXD image. then tried to create a new VM based on the template and after several minutes of CLONING, the following information was displayed in the LOG.

I can ssh without any issue from frontend to the respective node


Versions of the related components and OS (frontend, hypervisors, VMs):

Steps to reproduce:

Current results:
Sat Jan 18 05:02:00 2020 [Z0][VM][I]: New state is CLONING
Sat Jan 18 05:07:25 2020 [Z0][VM][I]: New state is PENDING
Sat Jan 18 05:07:29 2020 [Z0][VM][I]: New state is ACTIVE
Sat Jan 18 05:07:29 2020 [Z0][VM][I]: New LCM state is PROLOG
Sat Jan 18 05:07:45 2020 [Z0][VM][I]: New LCM state is BOOT
Sat Jan 18 05:07:45 2020 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/2/deployment.0
Sat Jan 18 05:07:47 2020 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Sat Jan 18 05:07:47 2020 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/lxd/deploy ‘/var/lib/one//datastores/0/2/deployment.0’ ‘node34’ 2 node34
Sat Jan 18 05:07:49 2020 [Z0][VMM][E]: deploy: sudo: no tty present and no askpass program specified
Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: /var/tmp/one/vmm/lxd/client.rb:102:in wait': {"type"=>"sync", "status"=>"Success", "status_code"=>200, "operation"=>"", "error_code"=>0, "error"=>"", "metadata"=>{"id"=>"2dbe2072-c9f9-4639-9eba-08fb20b2e576", "class"=>"task", "description"=>"Creating container", "created_at"=>"2020-01-18T10:37:49.185697912+05:30", "updated_at"=>"2020-01-18T10:37:49.185697912+05:30", "status"=>"Failure", "status_code"=>400, "resources"=>{"containers"=>["/1.0/containers/one-2"]}, "metadata"=>nil, "may_cancel"=>false, "err"=>"Invalid devices: Missing source '/var/lib/one/datastores/0/2/mapper/disk.1' for disk 'context'", "location"=>"none"}} (LXDError) Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: from /var/tmp/one/vmm/lxd/container.rb:473:in wait?’
Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: from /var/tmp/one/vmm/lxd/container.rb:134:in create' Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: from /var/tmp/one/vmm/lxd/deploy:52:in
Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: ExitCode: 1
Sat Jan 18 05:07:49 2020 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Sat Jan 18 05:07:49 2020 [Z0][VMM][E]: Error deploying virtual machine
Sat Jan 18 05:07:49 2020 [Z0][VM][I]: New LCM state is BOOT_FAILURE
Expected results:

Hello,

When downloading an app from the marketplace, to a container frontend, there could be issues when creating the image disk file.The process is:

  • An empy datablock is created
  • Formatted
  • Mounted
  • More stuff

Containers shouldn’t be able to mount block devices

root@ubuntu1804-lxd-marketplace-5-10-0-bbe5c-0:~# lxc exec one-23 bash
bash-4.4# truncate 
.bash_history  .ssh/          script.sh      
bash-4.4# truncate -s 200M image.raw
bash-4.4# mkfs
mkfs         mkfs.bfs     mkfs.cramfs  mkfs.ext2    mkfs.ext3    mkfs.ext4    mkfs.minix   mkfs.vfat    
bash-4.4# mkfs.ext4 image.raw 
mke2fs 1.44.5 (15-Dec-2018)
Discarding device blocks: done                            
Creating filesystem with 204800 1k blocks and 51200 inodes
Filesystem UUID: 2c4242ec-b5f7-4c59-b2df-a58dde753f17
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

bash-4.4# mount image.raw /mnt/
mount: /mnt/: mount failed: Operation not permitted.

So container frontend is limited, not able to import marketplace apps. And container host, is also limited. I should add that to the documentation.