Skip to content

Commit b790435

Browse files
committed
add cloud-init customization
1 parent 62c1e25 commit b790435

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Customization
3+
description: Welcome to your private Cloud !
4+
weight: 6
5+
---
6+
7+
Multiple options exist to further tune-in your Kowabunga setup.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Cloud-Init bootstrap
3+
description: Customize your private Cloud instances.
4+
weight: 1
5+
---
6+
7+
Cloud images are operating system templates and every instance starts out as an identical clone of every other instance. It is the user data that gives every cloud instance its personality and [cloud-init](https://cloud-init.io/) is the tool that applies user data to your instances automatically.
8+
9+
Kowabunga **Kahuna** comes with pre-bundled [cloud-init templates](https://github.com/kowabunga-cloud/kowabunga/tree/master/config/templates) which are then deployed into **/etc/kowabunga/templates** configuration directory.
10+
11+
Supporting both Linux and Windows targets, they come with the usual:
12+
13+
- **meta_data.yml** file, providing various metadata information, that can be further reused by Kowabunga agents.
14+
- **network_config.yml** file, allowing for proper automatic network stack and interfaces configuration.
15+
- **user_data.yml** file, provoiding a sequence of actions to be applied post (initial) boot, as described in its [standard documentation](https://cloudinit.readthedocs.io/en/latest/topics/examples.html).
16+
17+
Note that all these files are based on [Go Templates](https://pkg.go.dev/text/template). They are used by **Kahuna** to generate instance-specific configuration files and bundled into an ISO9660 image (stored on Ceph backend), ready to be consumed by OS, and written/updated each time a computing instance is being created/updated.
18+
19+
{{< alert color="warning" title="Warning" >}}
20+
Kowabunga currently only provide admin-level **cloud-init** templating support. Templates are defined and maintained at admin level for the global platform. There's no present way to fine-tune **cloud-init** templates per project, as override.
21+
{{< /alert >}}
22+
23+
## Linux Instances
24+
25+
Most of Linux distributions these days natively support **cloud-init** standard. As long as you're virtual machines boots up with an associated emulated CD-ROM ISO9660 image aside, you're good to go.
26+
27+
Note that Kowabunga **cloud-init** template natively provide the following post-actions:
28+
29+
- Setup network interfaces, DNS and gateway.
30+
- Set instance hostname and FQDN.
31+
- Update package repositories.
32+
- Install basic packages, including QEMU agent.
33+
- Set initial root password.
34+
- Provision service user, ready to further bootstrap instance.
35+
- Adds a **/usr/bin/kw-meta** wrapper script, friendly use to Kowabunga instance metadata retrieval.
36+
- Wait for Internet connectivity/access.
37+
38+
## Microsoft Windows Instances
39+
40+
Microsoft Windows OS is a different story than Linux as there's no default **cloud-init** implementation bundled.
41+
42+
One can however cope with such limitation thanks to the [Cloudbase-Init](https://cloudbase.it/cloudbase-init/) project which provide **cloud-init** compatibility and is the "*The Quickest Way of Automating Windows Guest Initialization*". It supports Windows 8+ and Windows Server 2012+ OS variants.
43+
44+
Its usage implies a mcu hmore complex approach than Linux targets as it requires you to first [build up your private custom Windows disk image template](https://www.phillipsj.net/posts/building-a-windows-server-qcow2-image/), extending it with [cloudbase-init.conf](https://github.com/kowabunga-cloud/kowabunga/blob/master/config/cloudbase-init/cloudbase-init.conf) configuration file.
45+
46+
Once your image has been built, Kowabunga **cloudbase-init** supports all options from the [NoCloud](https://cloudbase-init.readthedocs.io/en/latest/services.html#nocloud-configuration-drive) engine.
47+
48+
Note that Kowabunga **cloudbase-init** template natively provide the following post-actions:
49+
50+
- Setup network interfaces, DNS and gateway.
51+
- Set instance hostname and FQDN.
52+
- Install basic packages, including NuGet, Paket, PsExec, OpenSSH.
53+
- Set PowerShell as SSH default shell.
54+
- Update firewall rules.
55+
- Set OS password security policy.
56+
- Set initial root password.
57+
- Provision service user, ready to further bootstrap instance.
58+
59+
From there on, you'll get a ready-to-be-consumed Windows instance, which deployment can be further automated thanks to Ansible over SSH or any other provisionning tool or scripts.
60+
61+
It is then your responsibility to provide the Microsoft Windows license key (your Windows instance will anyway automatically shutdown after an hour if not).
62+
63+
{{< alert color="warning" title="Warning" >}}
64+
Note that it is possible to bypass the license verification mechanism. This is only valid if you intend to use your instance as a temporary sandbox for development/testing purpose. Microsoft Windows licenses are not that expensive and **in no way does the Kowabunga project encourage piracy**.
65+
{{< /alert >}}
66+
67+
Shall you be willing to temporarily bypass such mechanism, you can do so with such an Ansible playbook for instance:
68+
69+
```yaml
70+
---
71+
- hosts: windows
72+
73+
vars:
74+
ansible_connection: ssh
75+
ansible_shell_type: powershell
76+
ansible_user: admin
77+
ansible_password: "SECURE_ADMIN_PASSWORD"
78+
79+
tasks:
80+
- name: Accept EULA
81+
ansible.windows.win_shell: "PsExec.exe -accepteula"
82+
ignore_errors: true
83+
84+
- name: Disable WLM
85+
ansible.windows.win_shell: "PsExec.exe \\\\127.0.0.1 -s -i sc config WLMS start=disabled"
86+
87+
- name: Reboot hosts
88+
ansible.windows.win_shell: "shutdown /r"
89+
```

0 commit comments

Comments
 (0)