2

When i create VM from the pre-set Ubuntu images at Azure -- its ok. It looks like:

brutto@app-test-brutto:~$ df -T
Filesystem     Type     1K-blocks    Used Available Use% Mounted on
/dev/sda1      ext4      30224952 1391464  27298436   5% /
udev           devtmpfs    851432       8    851424   1% /dev
tmpfs          tmpfs       344108     236    343872   1% /run
none           tmpfs         5120       0      5120   0% /run/lock
none           tmpfs       860268       0    860268   0% /run/shm
/dev/sdb1      ext4      72246600  331976  68244712   1% /mnt/resource

See at the last line. Resource disk attached as ext4.

But if i create VM from my previously captured image (based on Ubuntu) it looks like:

brutto@app1-test-brutto:~$ df -T
Filesystem     Type     1K-blocks    Used Available Use% Mounted on
/dev/sda1      ext4      30235684 1242036  27458060   5% /
udev           devtmpfs    851432       8    851424   1% /dev
tmpfs          tmpfs       344108     248    343860   1% /run
none           tmpfs         5120       0      5120   0% /run/lock
none           tmpfs       860260       0    860260   0% /run/shm
/dev/sdb1      fuseblk   73398268   99232  73299036   1% /mnt

See at the last line too. Resource disk attached NTFS/fuseblk.

How can i create VM from image with ext4 resource disk?


I've read about /etc/waagent.conf and trying to set this ones:

ResourceDisk.Format=y
ResourceDisk.Filesystem=ext4
ResourceDisk.MountPoint=/mnt

Than reboot but nothing happens.

brutto
  • 74
  • 1
  • 6
  • 1
    This issue has consumed several hours for me today. It's especially vexing if you're trying to use the "resource disk" for anything that has requirements around linux file ownership or file permissions -- `chmod` and `chown` happily report success while doing **nothing** on any `/dev/sdb1` file. I think this ticket is potentially related : https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1292648 – dampier Mar 21 '14 at 02:20
  • @dampier thanks for your link. It looks the same. Am i correct that according to comments there this problem, probably, fixed and commited so i can get it to my ubuntu 12.04 LTS or it is allowed only for 14+ versions? – brutto Mar 27 '14 at 15:56
  • Great question @brutto ... happily it looks like the fix is committed for 12.04 "Precise": https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1292648/comments/5 – dampier Mar 28 '14 at 20:48

1 Answers1

0

I know this was a long time ago, but it looks like the bug has resurfaced in cloud-init 0.7.5, and no solution or workaround has yet been posted.

My solution is a hack, but it works. If anyone has any improvements (especially around the sleep) I would be happy to hear them.

Basically on startup run a script that first sleeps to ensure disk is mounted, then forces the mount point to use ext4 filesystem, and remount:

sleep 30
sudo umount /mnt
sudo mkfs -t ext4 -F /dev/sdb1
sudo mount /mnt 

and schedule it using a cronjob:

$> crontab -e

add:

@reboot /path/to/script
benrules2
  • 417
  • 4
  • 14