displague / vagrant-linode

A Vagrant plugin that adds a Linode provider to Vagrant, allowing Vagrant to control and provision Linodes.
MIT License
124 stars 23 forks source link

disk: conditionally add swap and leftover #66

Closed batrick closed 7 years ago

batrick commented 8 years ago

This commit adds swap only if swap_size > 0 and adds any leftover storage as a raw image.

Fixes #65.

Signed-off-by: Patrick Donnelly pdonnell@redhat.com

displague commented 7 years ago

This change is a bit subjective as a user may prefer to use the "resize" features in the future and having a raw disk present would prevent that. On the other hand, that user could delete the raw disk when they want to resize and this PR makes the extra space available within the Linode opening up many possibilities.

I think it would better if we added an option that allowed one to specify both the disk type and max size for extra disk utilization.

I'll mull over this a little. Thanks for the PR - looks good (at a glance)!

batrick commented 7 years ago

Thanks @displague for having a look. Right now I'm using this patch so that Ceph OSDs can have access to a raw disk partition. So long as I'm able to do that somehow, I'll be happy. :)

displague commented 7 years ago

Could you add options for this behavior? My second thought is (my first thought was in the previous comment):

xvdb_size -- the MB size of the disk xvdb_type -- the filesystem type

Other ideas are: xvdb_size_pct -- percent of the available space to consume .. this could coexist but conflict with xvdb_size

Perhaps the extra disk should be xvdc since swaps has been parked in the xvdb slot for existing vagrant-linode instances. Under Xen (Linode) the disks could have letter gaps (xvda... xvdf->swap), but under KVM these are reordered to squash gaps (swap or extra can only be either xvdb or xvdc).

displague commented 7 years ago

xvdb_size=0 would be default and would keep the disk from being created.

Unless we call it xvdc.. Yeah. Let's do that.

xvdc_size=0

batrick commented 7 years ago

@displague what do you think now?

displague commented 7 years ago

Looks good to me, I like the swap refactor.

I kind of regret the disk naming convention, but you followed it so I can't complain.