Ask Your Question
1

Ephemeral disk formatted as vfat?

asked 2016-05-30 05:17:52 -0500

Davide gravatar image

Hello,

i'm trying to setup a flavor with ephemeral disks, however the ephemeral disk (vdb) is auto-magically formatted as vfat and mounted on /mnt.

$ mount | grep vdb 
/dev/vdb on /mnt type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

There is no trace of the formatting and mounting of this partition in the logs (cloud-init + syslog), nor i can find anything in the cloud-init config files.

Using a disk_setup section in the cloud-config data fails:

2016-05-25 15:32:33,022 - util.py[WARNING]: Failed partitioning operation
Failed to partition device /dev/vdb
Unexpected error while running command.
Command: ['/sbin/sfdisk', '--Linux', '-uM', '/dev/vdb']
Exit code: 1
Reason: -
Stdout: ''
Stderr: "sfdisk: --Linux option is unnecessary and deprecated\nsfdisk: unsupported unit 'M'\n"

It is unclear if it fails because the device is already mounted or because unsupported options are passed to sfdisk.

We are using the Liberty release of Openstack and the tests were done with Ubuntu cloud images Trusty and Xenial releases. The problem is the same on both Ubuntu releases.

  • Does anyone know how can i stop this "vfat mount" from happening?
  • Why wrong options are passed to sfdisk?
  • Is this a bug, misconfiguration or a mix of both?

Thanks in advance for your help, Davide

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-05-30 09:00:00 -0500

Davide gravatar image

Hi,

after some more digging (in the source code) i have found that there is a default "mounts" configuration that looks like this:

defmnts = [["ephemeral0", "/mnt", "auto", defvals[3], "0", "2"],
          ["swap", "none", "swap", "sw", "0", "0"]]

thus the ephemeral disk gets auto mounted on /mnt, the strange thing is that a 10G device gets a vfat partition when is on "auto".

The following cloud-config change the default behaviour and allows custom config:

disk_setup:
  ephemeral0:
    type: 'gpt'
    layout: True
    overwrite: True

fs_setup:
  - label: opt
    filesystem: 'ext4'
    device: '/dev/vdb1'
    partition: 'auto'
    overwrite: True

mounts:
 - [ ephemeral0, null ]
 - [ /dev/vdb1, /opt, "ext4"]

A few things to note:

  • The ephemeral line on the "mounts" key overwrite the default configuration
  • The device name under "disk_setup" has to be called ephemeral0 (vdb wont work)
  • Our Trusty images contains a patched version of cloud-config, with a working cc_disk_setup.py
  • The sfdisk errors are only affecting xenial images, thus this config is failing on xenial images.

Cheers, Davide

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-05-30 05:17:52 -0500

Seen: 777 times

Last updated: May 30 '16