Skip to content

Commit

Permalink
Added content for Guest OS customization for cloud-init
Browse files Browse the repository at this point in the history
Change-Id: I6026ec3a7ce707b18a23dacdc6b9aa0c962d89a1
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/8368
Reviewed-by: Keerthana K <[email protected]>
Reviewed-by: Anish Swaminathan <[email protected]>
Tested-by: Anish Swaminathan <[email protected]>
  • Loading branch information
VinodJIsaac authored and suezzelur committed Nov 5, 2019
1 parent 7155416 commit 35e1a5b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
- [Cloud-Init on Photon OS](photon_admin/cloud-init-on-photon-os.md)
- [Cloud-Init Overview](photon_admin/cloud-init.md)
- [Deploy Photon OS With cloud-init](photon_admin/deploy_photon_with_cloud-init.md)
- [Customizing Guest OS using Cloud-Init](photon_admin/Customizing_Gos_Cloudinit.md)
- [Creating a Stand-Alone Photon Machine with cloud-init](photon_admin/creating-a-stand-alone-photon-machine-with-cloud-init.md)
- [Customizing a Photon OS Machine on EC2](photon_admin/customizing-a-photon-os-machine-on-ec2.md)
- [Running a Photon OS Machine on GCE](photon_admin/running-a-photon-os-machine-on-gce.md)
Expand Down
31 changes: 31 additions & 0 deletions docs/photon_admin/Customizing_Gos_Cloudinit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Customizing Guest OS using Cloud-Init

A guest operating system is an operating system that runs inside a virtual machine. You can install a guest operating system in a virtual machine and control guest operating system customization for virtual machines created from vApp templates.

When you customize your guest OS you can set up a virtual machine with the operating system that you want.

### Procedure
1. Perform the following steps before cloning or customizing the guest operating system:
1. Ensure that `disable_vmware_customization` is set to false in the `/etc/cloud/cloud.cfg` file.
1. Set `manage_etc_hosts: true` in the `/etc/cloud/cloud.cfg` file.
1. Make a backup of the `99-disable-networking-config.cfg` file and delete the file from `/etc/cloud/cloud.cfg.d` folder after backup.
1. Clone the VM or customize the guest operating system.
1. After you clone your VM or customize the guest operating system, perform the following steps:
1. Ensure that `disable_vmware_customization` is set to true in the `/etc/cloud/cloud.cfg` file in the newly created VM and the VM from where cloning was initiated.
1. Remove `manage_etc_hosts: true` from the `/etc/cloud/cloud.cfg` file in the newly created VM and the VM from where cloning was initiated.
1. Add a copy of the backed up file `99-disable-networking-config.cfg` to its original folder `/etc/cloud/cloud.cfg.d` in the newly created VM and the VM from where cloning was initiated.

**Note**:

1. The `disable_vmware_customization` flag in `/etc/cloud/cloud.cfg.d` file decides which customization workflow to be initiated.
- Setting this to **false** invokes the Cloud-Init GOS customization workflow.
- Setting this to **true** invokes the traditional GOSC script based customization workflow.
1. When the `manage_etc_hosts` flag is set to **true**, Cloud-Init can edit the `/etc/hosts` file with the updated values.

When the flag is set to **true** Cloud-Init edits the `/etc/hosts` file, even when there is no cloud config metadata available. Remove this entry once the Cloud-Init GOS customization is done, to stop Cloud-Init from editing `/etc/hosts` file and set a fallback configuration.
1. The `99-disable-networking-config.cfg` file is packaged as part of Cloud-Init RPM in photon and it prevents Cloud-Init from configuring the network. Delete this file before starting the Cloud-Init customization and then paste the backup of the file in the `/etc/cloud/cloud.cfg.d/` folder once the cloud-init workflow is complete. It is important to replace this file after Cloud-Init customization to avoid removal of network configuration in the Cloud-Init instance.


### Result

Cloud-Init guest OS customization is now enabled.
1 change: 1 addition & 0 deletions docs/photon_admin/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
- [Cloud-Init on Photon OS](cloud-init-on-photon-os.md)
- [Cloud-Init Overview](cloud-init.md)
- [Deploy Photon OS With cloud-init](deploy_photon_with_cloud-init.md)
- [Customizing Guest OS using Cloud-Init](Customizing_Gos_Cloudinit.md)
- [Creating a Stand-Alone Photon Machine with cloud-init](creating-a-stand-alone-photon-machine-with-cloud-init.md)
- [Customizing a Photon OS Machine on EC2](customizing-a-photon-os-machine-on-ec2.md)
- [Running a Photon OS Machine on GCE](running-a-photon-os-machine-on-gce.md)
Expand Down
1 change: 1 addition & 0 deletions docs/photon_admin/cloud-init-on-photon-os.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ The minimal and full versions of Photon OS include the cloud-init service as a b

- [Cloud-Init Overview](cloud-init.md)
- [Deploy Photon OS With cloud-init](deploy_photon_with_cloud-init.md)
- [Customizing Guest OS for Cloud-Init](Customizing_Gos_Cloudinit.md)
- [Creating a Stand-Alone Photon Machine with cloud-init](creating-a-stand-alone-photon-machine-with-cloud-init.md)
- [Customizing a Photon OS Machine on EC2](customizing-a-photon-os-machine-on-ec2.md)
- [Running a Photon OS Machine on GCE](running-a-photon-os-machine-on-gce.md)

0 comments on commit 35e1a5b

Please sign in to comment.