bsd-cloudinit icon indicating copy to clipboard operation
bsd-cloudinit copied to clipboard

Swap and ephemeral disk setup

Open marko-k0 opened this issue 10 years ago • 4 comments

Since I'm using this bsd-cloudinit, I would like to know if there is any plan to support mounting swap drive and ephemeral disk? I could my some effort trying to add this but I don't know how nova gets the metadata information about the disks in the first place. Having an option to add ZFS customization from user-data on ephemeral disk would also be something good to have. Can you share any information and thoughts regarding this matter?

marko-k0 avatar Dec 21 '15 19:12 marko-k0

I'm not sure what you meant by "mounting swap drive" and "ephemeral disk".

If you are referring to mounting external Cinder block devices on boot, yes, it is possible, but we have no plan to support it. I have no idea whether the metadata service provide any information on external drives. Plus, currently there is no working userdata parser. (Upstream cloudbase-init has it, but we're not sure how it works)

If you would like to implement it, the steps would be:

  1. sync bsd-cloudinit sources with upstream (there are lots of architectural changes)
  2. port cloudbase-init's userdata parser (a huge task)
  3. implement modules that reads from the parsed userdata directive and actually mounts the drive

pellaeon avatar Dec 22 '15 09:12 pellaeon

I'm not referring to cinder. If you add swap and ephemeral disk, an instance gets 2 additional disks (disk.local and disk.swap inside nova compute instance directory) which are added as /dev/vtbd1 and /dev/vtbd2. Now I would like swap to be created and an user-data option for creating zfs on ephemeral disk. So far, I know that metadata service doesn't know that swap is vtbd2 and ephemeral disk is vtbd1 but if it would know, creating swap would be easy. Metadata refers to them as vdb and vdc and here is the part that I don't know it works...in simple words, how could metadata service get the right information in the first place?

marko-k0 avatar Dec 22 '15 16:12 marko-k0

I am not aware of this feature of Nova.

vdb and vdc are just disk sequences plugged into the VM, the metadata service can only know from hypervisor host, it cannot know in reality what device names are detected by the guest.

pellaeon avatar Dec 22 '15 17:12 pellaeon

Yes, I assumed that this is just a predefined sequence and now I'm wondering if it can be somehow set differently for freebsd and how good would that work out for the cases where you would change flavours for running instances. I don't know the details of metadata service so maybe bsd-cloudinit could also update this values if metadata service supports that and I don't know how you can get the information about the block devices and their sizes in freebsd and how could you match it with metadata service. I am not aware if that is even possible...

marko-k0 avatar Dec 22 '15 18:12 marko-k0