ephemeral device filesystems should be labeled with 'ephemeralX'

Bug #828357 reported by Scott Moser
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Wishlist
Isaku Yamahata

Bug Description

After bug 827598 is fixed , and there are filesystems already made on the ephemeral devices, it would be a very nice addition to label the filesystems with 'ephemeral0' or 'ephemeral1' corresponding to their block-device-mapping.

This would allow you to very easily add entries to fstab like:
LABEL=ephemeral0 /mnt auto defaults 0 0

Rather than dealing with block-device-mapping which is likely to be wrong.

Thanks to ~ahasenack for this idea.

Related branches

Revision history for this message
Isaku Yamahata (yamahata) wrote :

So what you want is mkfs.ext3 -L ephemeral<N> <target device/file>
It's easy.

Revision history for this message
Isaku Yamahata (yamahata) wrote :

I updated lp:~yamahata/nova/lp827598.
Can you please check if that is what you wanted?
If so, I'll request for merge.

Thierry Carrez (ttx)
Changed in nova:
assignee: nobody → Isaku Yamahata (yamahata)
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
Scott Moser (smoser) wrote :

Maybe I'm reading the diff wrong, but it looks to me like you have:
  utils.execute('mkfs.ext3', '-l', fs_label, '-F', target)

where you'd want:
  utils.execute('mkfs.ext3', '-L', fs_label, '-F', target)

Specifically, the flag for label is upper case L , not lower case.

Revision history for this message
Scott Moser (smoser) wrote :

A couple more things. I suspect volumes in windows instances are not formated with ext3. I actually have never looked. If you'd like I *can* dig that up, but the primary point would be that I suspect filesystems type is instance-OS specific (at least to the point of windows/linux).

The other thing is that mkfs on a large volume will take quite a while, so you'd most definitely want to consider that. Maybe cache the volume after mkfs was done?

Revision history for this message
Isaku Yamahata (yamahata) wrote : Re: [Bug 828357] Re: ephemeral device filesystems should be labeled with 'ephemeralX'

On Mon, Aug 22, 2011 at 01:11:09PM -0000, Scott Moser wrote:
> Maybe I'm reading the diff wrong, but it looks to me like you have:
> utils.execute('mkfs.ext3', '-l', fs_label, '-F', target)
>
> where you'd want:
> utils.execute('mkfs.ext3', '-L', fs_label, '-F', target)
>
> Specifically, the flag for label is upper case L , not lower case.

Ah, good catch. I'll fix it.

Revision history for this message
Isaku Yamahata (yamahata) wrote :

On Mon, Aug 22, 2011 at 01:13:54PM -0000, Scott Moser wrote:
> A couple more things. I suspect volumes in windows instances are not
> formated with ext3. I actually have never looked. If you'd like I
> *can* dig that up, but the primary point would be that I suspect
> filesystems type is instance-OS specific (at least to the point of
> windows/linux).

Okay, os_type is passed to libvirt driver. So we can choose which
file system to use. So which file system should be used?

os_type
   'linux' => mkfs.ext3
              mkfs.ext3 -L <volume-label>

   'windows' => mkfs.vfat
                do we want to use
                -n <volume-name>
                -i <volume-id>

                or

                mkfs.ntfs
                do we want to use
                --label STRING
                --fast: perform a quick format

   other os => We don't know. (Solaris, BSD* ...)
                leave it uninitialized or make it user configurable?

> The other thing is that mkfs on a large volume will take quite a while,
> so you'd most definitely want to consider that. Maybe cache the volume
> after mkfs was done?

Fortunately the files is cached in /var/lib/nova/instance/_base/ as you
described.
If ext4 could be used, uninit_bg option could be used. It reduces mkfs
time much.

Revision history for this message
Isaku Yamahata (yamahata) wrote :

Okay, I updated the branch with nova-trunk.
It implements options on how to mkfs a given ephemeral device depending on os_type.
Can you please check it?

Revision history for this message
Scott Moser (smoser) wrote :

OK, after *way* to many failures, I finally succeeded in launching a windows m1.large instance with 2 ephemeral devices attached on amazon.

Each of the block devices are formatted as NTFS and have no label.

So, I suggest making the default case NTFS and the comment able to change to vfat.

Revision history for this message
Isaku Yamahata (yamahata) wrote :

Thank you for confirming it. I changed the default value to use ntfs and did request-for-merge of the branch.

Revision history for this message
Scott Moser (smoser) wrote :

fix-committed at revno 1562.

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.3
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.