diff --git a/pages/02.linux/cloud-init/default.en.md b/pages/02.linux/cloud-init/default.en.md index a0f6989..b0e6457 100644 --- a/pages/02.linux/cloud-init/default.en.md +++ b/pages/02.linux/cloud-init/default.en.md @@ -1,6 +1,6 @@ --- title: Cloud-Init -visible: false +visible: true --- [toc] @@ -19,8 +19,41 @@ apt install cloud-init cloud-initramfs-growroot [/shroot] -### AlmaLinux - -## Config file +## Cloud-init Cloud-init has a config file in `/etc/cloud/cloud.cfg` + +### Growing partitions + +With growroot installed in the initramfs, cloud-init will expand partitions and filesystems to fit the root partition given. + +### XCP-ng: Set Hostname + +This cloud config snippet sets the machine hostname to the VM name. + +``` +#cloud-config +hostname: {name} +``` + +## Network config + +The network config is a special config file with cloud-init that focuses on specifying network settings. + +### Set Static IP + +The snippet below sets a static ip address for the specified interface. +Its syntax mainly follows the `/etc/network/interfaces` syntax. + +``` +network: + version: 1 + config: + - type: physical + name: [INTERFACE] + subnets: + - type: static + address: [ADDRESS] + gateway: [ADDRESS] + dns_nameservers: [ADDRESS] +``` diff --git a/pages/02.linux/guides/debian-create-new-template/default.en.md b/pages/02.linux/guides/debian-create-new-template/default.en.md new file mode 100644 index 0000000..34305ab --- /dev/null +++ b/pages/02.linux/guides/debian-create-new-template/default.en.md @@ -0,0 +1,61 @@ +--- +title: "Debian Create new template" +visible: true +--- + +[toc] + +This guide focuses on creating a new template for Debian that can be used with XCP-ng. + +## VM Creation + +Before even starting the installation, a new VM has to be created. +I choose the `Other install media` template and set the Distro name prefixed with "CR". +The usual sizing is 1 vCPU and 1 GiB RAM. +Add a network interface in the most commonly used network. +Add a disk, a size of 10 GiB is a good starting point. +Finally in the advanced settings, change the boot firmware from `bios` to `uefi` + +## Installation + +Most of the installation can be done as usual, though some parts must be observed. +The root user will get a password. We also create a new non-root user. +For partitioning, choose the manual method. +The following partitions should be created, all of them as primary partitions. + +- Type **EFI** _128M_ +- Type **Swap** _1G_ +- Type **EXT4** _remaining space_ + +![Partitions overview](partitioning.webp) + +Accept the created partitioning + +> The reason for this layout is so Cloud-init can automatically grow the root partition when the underlying virtual disk is expanded + +Reboot after the installation completes. + +## Cloud-init + +Install Cloud-init to use its configurations. +On debian the required packages are `cloud-init` and `cloud-initramfs-growroot` + +> More information can be found on the [Cloud-init page](/linux/cloud-init). + +## Final Configuration + +### Networking + +Edit `/etc/network/interfaces` and remove the network interface defined there. +Cloud-init will create a new definition under `/etc/network/interfaces.d` + +### ISO-file + +Unmount and remove the installation ISO-file. + +## Conversion + +Poweroff the VM and go to its `Advanced` tab. +![XCP-ng Advanced tab](xcp-ng-advanced-tab.webp) + +Before clicking `Convert to template`, creating a clone is recommended. diff --git a/pages/02.linux/guides/debian-create-new-template/partitioning.webp b/pages/02.linux/guides/debian-create-new-template/partitioning.webp new file mode 100644 index 0000000..ad50bc2 Binary files /dev/null and b/pages/02.linux/guides/debian-create-new-template/partitioning.webp differ diff --git a/pages/02.linux/guides/debian-create-new-template/xcp-ng-advanced-tab.webp b/pages/02.linux/guides/debian-create-new-template/xcp-ng-advanced-tab.webp new file mode 100644 index 0000000..09c4c8b Binary files /dev/null and b/pages/02.linux/guides/debian-create-new-template/xcp-ng-advanced-tab.webp differ