← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1642383] Re: Unable to configure swap space on ephemeral disk in Azure

 

This is currently fixed in cloud-init in zesty 0.7.8-67-gc9c9197-0ubuntu1 .
I've verified it functional with the user-data provided in the description on todays Azure image.


** Changed in: cloud-init (Ubuntu Zesty)
       Status: Confirmed => Fix Released

** Description changed:

  I'm following the instructions to send cloud-config and repartition the
  ephemeral disk in Azure: https://wiki.ubuntu.com/AzureSwapPartitions.
  These instructions fail on Ubuntu 14.04 and 16.04 (did not test 12.04
  yet).
  
  Repro:
  
  1) Add the following content to a file such as customdata.txt:
  
   #cloud-config
   disk_setup:
       ephemeral0:
           table_type: mbr
           layout: [66, [33, 82]]
           overwrite: True
   fs_setup:
       - device: ephemeral0.1
         filesystem: ext4
       - device: ephemeral0.2
         filesystem: swap
   mounts:
       - ["ephemeral0.1", "/mnt2"]
       - ["ephemeral0.2", "none", "swap", "sw", "0", "0"]
  
  2) Create a VM in Azure with this cloud-config:
  
   $ azure group create ubtest 'east us'
  
   $ azure vm create ubtest ubtest-1604 Linux --image-urn
  canonical:UbuntuServer:16.04.0-LTS:latest --admin-username azureuser
  --admin-password '<PASSWORD>' --nic-name ubtest-1604 --location "East
  US" --vnet-name "ubtest" --vnet-address-prefix "10.0.0.0/24" --vnet-
  subnet-name "ubtest" --vnet-subnet-address-prefix "10.0.0.0/24"
  --public-ip-name "ubtest" --public-ip-domain-name "ubtest" --custom-data
  ./customdata.txt
  
  Expected Result:
  
   - /dev/disk/cloud/azure_resource should have two partitions; one ext4 and a second swap
   - /dev/disk/cloud/azure_resource-part1 should be mounted on /mnt2
   - /dev/disk/cloud/azure_resource-part2 should be active swap space
   - /etc/fstab should be configured correctly
  
  Actual Results:
  
   - /dev/disk/cloud/azure_resource-part1 is properly mounted on /mnt2.
   - On Ubuntu 14.04, /dev/disk/cloud/azure_resource is re-partitioned as expected.
   - On Ubuntu 16.04, /dev/disk/cloud/azure_resource is *not* re-partitioned. There is only a single partition (no swap space).
   - On Ubuntu 14.04 and 16.04, /etc/fstab includes an incorrect entry for the swap space:
  
     ephemeral0.2    none    swap    sw,comment=cloudconfig  0       0
  
  This clearly won't work, it should resolve to "/dev/disk/cloud
  /azure_resource-part2".  I do notice that on Ubuntu 14.04, the ephemeral
  disk is re-partitioned correctly, but there is no symlink in
  /dev/disk/azure/ to the second partition. These symlinks are created by
  /lib/udev/rules.d/66-azure-ephemeral.rules. Perhaps cloud-init needs to
  re-trigger this udev rule after repartitioning the disk.
  
  FYI, I also tested with the latest cloud-init that is currently in
  xenial-proposed (0.7.8-47-gb6561a1-0ubuntu1~16.04.1) with the same
  results.
  
  Related bugs:
-  * bug 1460715: MBR disk setup fails because sfdisk no longer accepts M as a valid unit
+  * bug 1460715: MBR disk setup fails because sfdisk no longer accepts M as a valid unit
+  * bug 1647708: azure ephemeral disk not mounted at boot

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1642383

Title:
  Unable to configure swap space on ephemeral disk in Azure

Status in cloud-init package in Ubuntu:
  Fix Released
Status in cloud-init source package in Xenial:
  Confirmed
Status in cloud-init source package in Yakkety:
  Confirmed
Status in cloud-init source package in Zesty:
  Fix Released

Bug description:
  I'm following the instructions to send cloud-config and repartition
  the ephemeral disk in Azure:
  https://wiki.ubuntu.com/AzureSwapPartitions.  These instructions fail
  on Ubuntu 14.04 and 16.04 (did not test 12.04 yet).

  Repro:

  1) Add the following content to a file such as customdata.txt:

   #cloud-config
   disk_setup:
       ephemeral0:
           table_type: mbr
           layout: [66, [33, 82]]
           overwrite: True
   fs_setup:
       - device: ephemeral0.1
         filesystem: ext4
       - device: ephemeral0.2
         filesystem: swap
   mounts:
       - ["ephemeral0.1", "/mnt2"]
       - ["ephemeral0.2", "none", "swap", "sw", "0", "0"]

  2) Create a VM in Azure with this cloud-config:

   $ azure group create ubtest 'east us'

   $ azure vm create ubtest ubtest-1604 Linux --image-urn
  canonical:UbuntuServer:16.04.0-LTS:latest --admin-username azureuser
  --admin-password '<PASSWORD>' --nic-name ubtest-1604 --location "East
  US" --vnet-name "ubtest" --vnet-address-prefix "10.0.0.0/24" --vnet-
  subnet-name "ubtest" --vnet-subnet-address-prefix "10.0.0.0/24"
  --public-ip-name "ubtest" --public-ip-domain-name "ubtest" --custom-
  data ./customdata.txt

  Expected Result:

   - /dev/disk/cloud/azure_resource should have two partitions; one ext4 and a second swap
   - /dev/disk/cloud/azure_resource-part1 should be mounted on /mnt2
   - /dev/disk/cloud/azure_resource-part2 should be active swap space
   - /etc/fstab should be configured correctly

  Actual Results:

   - /dev/disk/cloud/azure_resource-part1 is properly mounted on /mnt2.
   - On Ubuntu 14.04, /dev/disk/cloud/azure_resource is re-partitioned as expected.
   - On Ubuntu 16.04, /dev/disk/cloud/azure_resource is *not* re-partitioned. There is only a single partition (no swap space).
   - On Ubuntu 14.04 and 16.04, /etc/fstab includes an incorrect entry for the swap space:

     ephemeral0.2    none    swap    sw,comment=cloudconfig  0       0

  This clearly won't work, it should resolve to "/dev/disk/cloud
  /azure_resource-part2".  I do notice that on Ubuntu 14.04, the
  ephemeral disk is re-partitioned correctly, but there is no symlink in
  /dev/disk/azure/ to the second partition. These symlinks are created
  by /lib/udev/rules.d/66-azure-ephemeral.rules. Perhaps cloud-init
  needs to re-trigger this udev rule after repartitioning the disk.

  FYI, I also tested with the latest cloud-init that is currently in
  xenial-proposed (0.7.8-47-gb6561a1-0ubuntu1~16.04.1) with the same
  results.

  Related bugs:
   * bug 1460715: MBR disk setup fails because sfdisk no longer accepts M as a valid unit
   * bug 1647708: azure ephemeral disk not mounted at boot

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1642383/+subscriptions