Change-Id: I8fbd4917dbf9a086c212143e272d2b0cdcf8b9c5
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1249
Reviewed-by: Steve Hoenisch <shoenisch@vmware.com>
Tested-by: Steve Hoenisch <shoenisch@vmware.com>
| ... | ... |
@@ -1,76 +1,69 @@ |
| 1 | 1 |
Overview |
| 2 | 2 |
================= |
| 3 |
-```cloud-init``` is the defacto multi-distribution package that handles early initialization of a cloud instance. |
|
| 3 |
+```cloud-init``` is a multi-distribution package that handles early initialization of a cloud instance. |
|
| 4 | 4 |
|
| 5 |
-In-depth documentation for cloud-init is available here: https://cloudinit.readthedocs.org/en/latest/ |
|
| 5 |
+In-depth documentation for cloud-init is available here: |
|
| 6 |
+ |
|
| 7 |
+[https://cloudinit.readthedocs.org/en/latest/](https://cloudinit.readthedocs.org/en/latest/) |
|
| 6 | 8 |
|
| 7 | 9 |
Supported installations |
| 8 | 10 |
================= |
| 9 |
-```Photon Container OS (Minimal)``` |
|
| 10 | 11 |
|
| 11 |
-```Photon Full OS (All)``` |
|
| 12 |
+Both the full version of and the minimal version of Photon OS support cloud-init. |
|
| 12 | 13 |
|
| 13 | 14 |
Supported capabilities |
| 14 | 15 |
================= |
| 15 |
-```Photon``` supports ```cloud-init``` starting with the following capabilities |
|
| 16 |
-<dl> |
|
| 17 |
-<dt>```run commands```</dt> |
|
| 18 |
-<dd>execute a list of commands with output to console.</dd> |
|
| 19 |
-<dt>```configure ssh keys```</dt> |
|
| 20 |
-<dd>add entry to ~/.ssh/authorized_keys for the configured user</dd> |
|
| 21 |
-<dt>```install package```</dt> |
|
| 22 |
-<dd>install additional packages on first boot</dd> |
|
| 23 |
-<dt>```configure networking```</dt> |
|
| 24 |
-<dd>update /etc/hosts, hostname etc</dd> |
|
| 25 |
-<dt>```write files```</dt> |
|
| 26 |
-<dd>write arbitrary file(s) to disk</dd> |
|
| 27 |
-<dt>```add yum repo```</dt> |
|
| 28 |
-<dd>add a yum repository to /etc/yum.repos.d</dd> |
|
| 29 |
-<dt>```create groups and users```</dt> |
|
| 30 |
-<dd>add groups and users to the system. set user/group properties</dd> |
|
| 31 |
-<dt>```run yum upgrade```</dt> |
|
| 32 |
-<dd>upgrade all packages</dd> |
|
| 33 |
-<dt>```reboot```</dt> |
|
| 34 |
-<dd>reboot or power off when done with cloud-init</dd> |
|
| 35 |
-</dl> |
|
| 16 |
+ |
|
| 17 |
+Photon OS supports the following cloud-init capabilities: |
|
| 18 |
+ |
|
| 19 |
+ |
|
| 20 |
+* run commands: execute a list of commands with output to console. |
|
| 21 |
+* configure ssh keys: add an entry to ~/.ssh/authorized_keys for the configured user. |
|
| 22 |
+* install package: install additional packages on first boot. |
|
| 23 |
+* configure networking: update /etc/hosts, hostname, etc. |
|
| 24 |
+* write files: write arbitrary files to disk. |
|
| 25 |
+* add yum repository: add a yum repository to /etc/yum.repos.d. |
|
| 26 |
+* create groups and users: add groups and users to the system and set properties for them. |
|
| 27 |
+* run yum upgrade: upgrade all packages. |
|
| 28 |
+* reboot: reboot or power off when done with cloud-init. |
|
| 29 |
+ |
|
| 36 | 30 |
|
| 37 | 31 |
Getting Started |
| 38 | 32 |
================= |
| 39 |
-photon cloud config has ```ec2 datasource``` turned on by default so an ```ec2``` configuration is accepted. |
|
| 40 |
-However, for testing, the following methods provide ways to do ```cloud-init``` with ```photon``` standalone. |
|
| 33 |
+The Amazon Machine Image of Photon OS has an ```ec2 datasource``` turned on by default so an ```ec2``` configuration is accepted. |
|
| 34 |
+However, for testing, the following methods provide ways to do ```cloud-init``` with a standalone instance of Photon OS. |
|
| 41 | 35 |
|
| 42 |
-Using a seed iso |
|
| 36 |
+Using a Seed ISO |
|
| 43 | 37 |
---------------- |
| 44 |
-This will be using the ```nocloud``` datasource. In order to init this way, an iso file needs to be created with a meta-data and an user-data file as shown below |
|
| 38 |
+This will be using the ```nocloud``` data source. In order to initialize the system in this way, an ISO file needs to be created with a meta-data file and an user-data file as shown below: |
|
| 45 | 39 |
``` |
| 46 | 40 |
$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
|
| 47 | 41 |
$ printf "#cloud-config\nhostname: testhost\n" > user-data |
| 48 | 42 |
$ genisoimage -output seed.iso -volid cidata -joliet -rock user-data meta-data |
| 49 | 43 |
``` |
| 50 | 44 |
|
| 51 |
-Attach the above generated seed.iso to your machine and reboot for the init to take effect. |
|
| 52 |
-In this case, the hostname is set to ```testhost``` |
|
| 45 |
+Attach the `seed.iso` generated above to your machine and reboot for the init to take effect. |
|
| 46 |
+In this case, the hostname is set to ```testhost```. |
|
| 53 | 47 |
|
| 54 |
-Using a seed disk file |
|
| 48 |
+Using a Seed Disk File |
|
| 55 | 49 |
---------------- |
| 56 |
-To init using local disk files, do the following |
|
| 50 |
+To init using local disk files, do the following: |
|
| 57 | 51 |
``` |
| 58 | 52 |
mkdir /var/lib/cloud/seed/nocloud |
| 59 | 53 |
cd /var/lib/cloud/seed/nocloud |
| 60 | 54 |
$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
|
| 61 | 55 |
$ printf "#cloud-config\nhostname: testhost\n" > user-data |
| 62 | 56 |
``` |
| 63 |
-Reboot the machine and the hostname will be set to `testhost` |
|
| 57 |
+Reboot the machine and the hostname will be set to `testhost`. |
|
| 64 | 58 |
|
| 65 | 59 |
Frequencies |
| 66 | 60 |
----------- |
| 67 |
-cloud-init modules have pre-determined frequencies. Based on the frequency setting, multiple runs will yield different results. |
|
| 68 |
-For the scripts to run always, remove instances folder before reboot. |
|
| 61 |
+Cloud-init modules have predetermined frequencies. Based on the frequency setting, multiple runs will yield different results. For the scripts to always run, remove the `instances` directory before rebooting. |
|
| 69 | 62 |
``` |
| 70 | 63 |
rm -rf /var/lib/cloud/instances |
| 71 | 64 |
``` |
| 72 | 65 |
|
| 73 |
-Module frequency info |
|
| 66 |
+Module Frequency Info |
|
| 74 | 67 |
------------------------------------ |
| 75 | 68 |
Name | Frequency |
| 76 | 69 |
----------------------|------------- |