Failed mount of '/dev/sdb1' with Swap File cloud-init config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
Environment : RHEL 7.5 on Azure, using cloud-init 18.2 rebase with these patches: https:/
Scenario:
I provision an image with the above on Azure, in addition, i apply this cloud-init config:
#cloud-config
disk_setup:
ephemeral0:
table_type: gpt
layout: [66, [33, 82]]
overwrite: True
fs_setup:
- device: ephemeral0.1
filesystem: ext4
- device: ephemeral0.2
filesystem: swap
mounts:
- ["ephemeral0.1", "/mnt"]
- ["ephemeral0.2", "none", "swap", "sw", "0", "0"]
The VM provisions successfully, you see /sdb1 gets mounted and the swap file config succeeds.
If i deallocate the VM and start it, /sdb1 does not get mounted, you see the errors below.
2018-06-20 19:50:38,138 - util.py[WARNING]: Failed reading the partition table Unexpected error while running command.
Command: ['/usr/
Exit code: 1
Reason: -
Stdout:
Stderr: blockdev: ioctl error on BLKRRPART: Device or resource busy
2018-06-20 19:50:38,138 - util.py[DEBUG]: Failed reading the partition table Unexpected error while running command.
Command: ['/usr/
Exit code: 1
Reason: -
Stdout:
Stderr: blockdev: ioctl error on BLKRRPART: Device or resource busy
Traceback (most recent call last):
File "/usr/lib/
util.
File "/usr/lib/
cmd=args)
ProcessExecutio
Running multiple deallocates and starts does not see the system resolve itself.
I check fstab:
UUID=6e4681f0-
UUID=f2116236-
/dev/disk/
/dev/disk/
As a test, i changed the FSTAB entry for the swap to add a dependency on cloud-init:
/dev/disk/
I deallocated and started the VM, sdb mounts correctly, but the FSTAB is overwritten for swap with the previous config. I modified the FSTAB again, with the addition, then rebooted, again, everything works.
Does azure_resource-
You can also test this using the existing Azure cloud-init preview images (cloud-init 0.7.9.x)
az vm create
--resource-group rgName
--name vmName
--image RedHat:
--admin-username anotherusr
--custom-data /../swapconfig.txt
--ssh-key-value /.../my.pub
az vm deallocate --resource-group rgName --name vmName
az vm start --resource-group rgName --name vmName
Thanks,
Related bugs:
* bug 1785354: /etc/fstab: fs_passno is 0 for all file systems
ran cloud-init collect- logs... attaching