Does Linode Support Custom Images Created Via a Chroot-style Build-Method
When working with other CSPs, I typically create custom boot-images using a chroot-based build method. Basically, launch a VM with its regular boot-disk and a secondary-disk, then perform a chroot-build from the boot-disk to the secondary-disk. Would I be able to do similarly under Linode?
My assumption would be something like:
- Launch a standard Linode
- Attach a volume of a given size to the Linode
- Perform a chroot-build onto the volume
- Power off the linode
- Detach the volume
- Snapshot the volume
- Create register a custom custom-distribution/build-template from the snapshot
Assuming the above is basically correct, what's the actual, technical procedure for it? I mean, I know how to do the third step in other CSPs' environments — already have the build-process fully scripted. It's more the specifics of moving from snapshot to launchable boot-image that I'm a bit lost on.
Is the above at all doable? If so, pointers on how?
Basically, I'm trying to create an LVM-enabled boot-image. I'm assuming I'd have to do a two-disk or two-partition boot-image so that /boot could be its own, ext4 partition with an initrd that knew how to boot the LVM'ed root-volumes (with XFS filesystems on top).
You have the right idea. The short answer is that you would need to boot from the Block Storage volume. There are a couple of options for booting a Linode from a custom image. We have a guide for deploying a custom image directly to a Linode available here that has instructions for installing the image on a blank Linode. Most of this process takes place in Rescue Mode. If you want to retain the image on a Block Storage volume and boot directly from the volume, this guide can show you how to set that up. You would need to add the volume to your configuration profile, copy the contents of the Linode to the volume, then set the Block Storage volume as primary disk.