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

LXD drivers fail to start VMs if there are duplicated fs uuids in XFS images #3103

Closed
7 tasks
dann1 opened this issue Mar 21, 2019 · 0 comments
Closed
7 tasks

Comments

@dann1
Copy link
Contributor

dann1 commented Mar 21, 2019

Description
The LXD drivers need to mount the filesystem of the images ext* and XFS do not have their UUIDs regenerated when an instance is instantiated for the first time, causing a VM to be unable to start due to the mount action failing when the filesystem is XFS.

To Reproduce

  • Deploy VM backed by a non-persistent XFS image
  • Deploy it again and it will fail

The log will be similar to

Wed Mar 20 18:13:23 2019 [Z0][VM][I]: New state is ACTIVE
Wed Mar 20 18:13:23 2019 [Z0][VM][I]: New LCM state is PROLOG
Wed Mar 20 18:13:24 2019 [Z0][VM][I]: New LCM state is BOOT
Wed Mar 20 18:13:24 2019 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/8/deployment.0
Wed Mar 20 18:13:24 2019 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Wed Mar 20 18:13:24 2019 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: Command execution fail: cat << EOT | /var/tmp/one/vmm/lxd/deploy '/var/lib/one//datastores/0/8/deployment.0' 'ubuntu1604-context-lxd-9180d-0.test' 8 ubuntu1604-context-lxd-9180d-0.test
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: deploy: Using qcow2 mapper for /var/lib/one/datastores/0/8/disk.0
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: deploy: Mapping disk at /var/lib/lxd/storage-pools/default/containers/one-8/rootfs using device /dev/nbd1
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: deploy: Mounting /dev/nbd1 at /var/lib/lxd/storage-pools/default/containers/one-8/rootfs
Wed Mar 20 18:13:26 2019 [Z0][VMM][E]: deploy: mount_dev: mount: wrong fs type, bad option, bad superblock on /dev/nbd1,
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: missing codepage or helper program, or other error
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: 
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: In some cases useful info is found in syslog - try
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: dmesg | tail or so.
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: /var/tmp/one/vmm/lxd/deploy:72:in `<main>': failed to setup container storage (RuntimeError)
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: ExitCode: 1
Wed Mar 20 18:13:26 2019 [Z0][VMM][I]: Failed to execute virtualization driver operation: deploy.
Wed Mar 20 18:13:26 2019 [Z0][VMM][E]: Error deploying virtual machine
Wed Mar 20 18:13:26 2019 [Z0][VM][I]: New LCM state is BOOT_FAILURE

The core issue can be reproduced outside of the opennebula scope

  • create a block device truncate -s 100M img.xfs
  • format the block: mkfs.xfs img.xfs
  • copy the block : cp img.xfs img_duplicated.xfs
  • mount block1: mkdir /mnt/1 && mount img.xfs /mnt/1
  • mount block1: mkdir /mnt/2 && mount img_duplicated.xfs /mnt/2

The latter will fail. Checking dmseg will output something similar to:

[182584.911629] XFS (loop13): Filesystem has duplicate UUID 9d6923a7-32ae-41c0-9c1e-e9d6064003e3 - can't mount

Expected behavior
Partitions won't fail to mount if they can be mounted

Details

  • Affected Component: Virtualization Drivers
  • Hypervisor: LXD
  • Version: 5.8.0

Additional context
Mounting ext4 filesystems with duplicated uuids desn't fail.

Progress Status

  • Branch created
  • Code committed to development branch
  • Testing - QA
  • Documentation
  • Release notes - resolved issues, compatibility, known issues
  • Code committed to upstream release/hotfix branches
  • Documentation committed to upstream release/hotfix branches
@dann1 dann1 self-assigned this Mar 21, 2019
@dann1 dann1 added this to the Release 5.8.1 milestone Mar 21, 2019
dann1 added a commit to dann1/one that referenced this issue Mar 21, 2019
dann1 added a commit to dann1/one that referenced this issue Mar 21, 2019
dann1 added a commit to dann1/one that referenced this issue Mar 21, 2019
rsmontero added a commit that referenced this issue Mar 21, 2019
dann1 added a commit that referenced this issue Mar 21, 2019
rsmontero pushed a commit that referenced this issue Mar 21, 2019
rsmontero added a commit that referenced this issue Mar 21, 2019
(cherry picked from commit 14ee18f)
rsmontero pushed a commit that referenced this issue Mar 21, 2019
(cherry picked from commit 6f95aa9)
dann1 added a commit to dann1/one that referenced this issue Mar 21, 2019
rsmontero added a commit that referenced this issue Mar 22, 2019
dann1 added a commit that referenced this issue Mar 25, 2019
rsmontero pushed a commit that referenced this issue Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant