Browse code

Migrated 1.0/2.0 docs, updated TOC, links & images

Change-Id: I0a1ee8541a67ef105caedc443516ddcc8c3dfc54
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5908
Reviewed-by: Stuart Clements <sclements@vmware.com>
Tested-by: Stuart Clements <sclements@vmware.com>

Vidya Vasudevan authored on 2018/10/11 23:26:42
Showing 217 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,16 @@
0
+An official Vagrant box is available on Hashicorp Atlas. To get started: 
1
+
2
+	vagrant init vmware/photon
3
+
4
+Add the following lines to the Vagrantfile: 
5
+
6
+	config.vm.provider "virtualbox" do |v|
7
+	  v.customize ['modifyvm', :id, '--acpi', 'off']
8
+	end
9
+
10
+Install vagrant-guests-photon plugin which provides VMware Photon OS guest support.
11
+It is available at https://github.com/vmware/vagrant-guests-photon.
12
+
13
+Requires VirtualBox 4.3 or later version. If you have issues, please check your version.
14
+
15
+
0 16
new file mode 100644
... ...
@@ -0,0 +1,119 @@
0
+# Downloading Photon OS
1
+
2
+Download the Photon OS version that’s right for you. Click one of the links below.
3
+
4
+## Selecting a Download Format
5
+----------------
6
+
7
+Photon OS is available in the following pre-packaged, binary formats.
8
+
9
+### Download Formats ####
10
+
11
+| Format | Description |
12
+| --- | --- |
13
+| ISO Image | Contains everything needed to install either the minimal or full installation of Photon OS. The bootable ISO has a manual installer or can be used with PXE/kickstart environments for automated installations. |
14
+| OVA | Pre-installed minimal environment, customized for VMware hypervisor environments. These customizations include a highly sanitized and optimized kernel to give improved boot and runtime performance for containers and Linux applications. Since an OVA is a complete virtual machine definition, we've made available a Photon OS OVA that has virtual hardware version 11; this will allow for compatibility with several versions of VMware platforms or allow for the latest and greatest virtual hardware enhancements. |
15
+| Amazon AMI | Pre-packaged and tested version of Photon OS made ready to deploy in your Amazon EC2 cloud environment. Previously, we'd published documentation on how to create an Amazon compatible instance, but, now we've done the work for you. |
16
+| Google GCE Image | Pre-packaged and tested Google GCE image that is ready to deploy in your Google Compute Engine Environment, with all modifications and package requirements for running Photon OS in GCE. | 
17
+| Azure VHD | Pre-packaged and tested Azure HD image that is ready to deploy in your Microsoft Azure Cloud, with all modifications and package requirements for running Photon OS in Azure. |
18
+
19
+## Downloading Photon OS 2.0 GA
20
+------------------------------
21
+
22
+Photon OS 2.0 GA is available now! Choose the download that’s right for you and click one of the links below. Refer to the associated sha1sums and md5sums.
23
+
24
+### Photon OS 2.0 GA Binaries
25
+
26
+| Download | Size | sha1 checksum | md5 checksum |
27
+| --- | --- | --- | --- |
28
+| [Full ISO](http://dl.bintray.com/vmware/photon/2.0/GA/iso/photon-2.0-304b817.iso) | 2.3GB | 68ec892a66e659b18917a12738176bd510cde829 | 6ce66c763589cf1ee49f0144ff7182dc |
29
+| [OVA with virtual hardware v11](http://dl.bintray.com/vmware/photon/2.0/GA/ova/photon-custom-hw11-2.0-304b817.ova) | 108MB | b8c183785bbf582bcd1be7cde7c22e5758fb3f16 | 1ce23d43a778fdeb5283ecd18320d9b5 |
30
+| [OVA with virtual hardware v13 (ESX 6.5 and above)](http://dl.bintray.com/vmware/photon/2.0/GA/ova/photon-custom-hw13-2.0-304b817.ova) | 106MB | 44f7b808ca48ea1af819d222561a14482a15e493 | ec490b65615284a0862e9ee4a7a0ac97 |
31
+| [OVA with virtual hardware v11(Workstation and Fusion)](http://dl.bintray.com/vmware/photon/2.0/GA/ova/photon-custom-lsilogic-hw11-2.0-304b817.ova) | 108MB | 6ed700cbbc5e54ba621e975f28284b27adb71f68 | 586c059bf3373984c761e254bd491f59 |
32
+| [Amazon AMI](http://dl.bintray.com/vmware/photon/2.0/GA/ami/photon-ami-2.0-304b817.tar.gz) | 135MB | 45f4e9bc27f7316fae77c648c8133195d38f96b3 | 486d59eca17ebc948e2f863f2af06eee |
33
+| [Google GCE](http://dl.bintray.com/vmware/photon/2.0/GA/gce/photon-gce-2.0-304b817.tar.gz) | 705MB | b1385dd8464090b96e6b402c32c5d958d43f9fbd | 34953176901f194f02090988e596b1a7 |
34
+| [Azure VHD - gz file](http://dl.bintray.com/vmware/photon/2.0/GA/azure/photon-azure-2.0-304b817.vhd.gz) | 170MB | a77d54351cca43eefcf289a907ec751c32372930 | 86d281f033f3584b11e5721a5cbda2d3 |
35
+| [Azure VHD - gz file - cloud-init provisioning](http://dl.bintray.com/vmware/photon/2.0/GA/azure/photon-azure-2.0-3146fa6.tar.gz) | 172MB | d7709a7b781dad03db55c4999bfa5ef6606efd8b | ee95bffe2c924d9cb2d47a94ecbbea2c |
36
+
37
+## Photon OS 2.0 AMI ID (Update: November 7th, 2017)
38
+-------------------------
39
+| Region | AMI ID|
40
+| --- | --- |
41
+| N.Virginia | ami-47fe4c3d |
42
+| Ohio | ami-29dff04c |
43
+| N.California | ami-065f6166 |
44
+| Oregon | ami-f6ab7f8e |
45
+
46
+## Downloading Photon OS 2.0 RC
47
+------------------------------
48
+Photon OS 2.0 RC is available now! Choose the download that’s right for you and click one of the links below. Refer to the associated sha1sums and md5sums.
49
+
50
+### Photon OS 2.0 RC Binaries
51
+
52
+| Download | Size | sha1 checksum | md5 checksum |
53
+| --- | --- | --- | --- |
54
+| [Full ISO](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fiso%2Fphoton-2.0-31bb961.iso) | 2.2GB | 5c049d5ff40c8f22ae5e969eabd1ee8cd6b834e7 | 88cc8ecf2a7f6ae5ac8eb15f54e4a821 |
55
+| [OVA with virtual hardware v11](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fova%2Fphoton-custom-hw11-2.0-31bb961.ova) | 108MB | 6467ebb31ff23dfd112c1c574854f5655a462cc2 | b2c7fa9c151b1130342f08c2f513f9e1 |
56
+| [OVA with virtual hardware v13 (ESX 6.5 and above)](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fova%2Fphoton-custom-hw13-2.0-31bb961.ova) | 106MB | 5072ec86bcaa2d6e07f4fe3e6aa99063acbbc3f3 | 9331fc10d4526f389d2b658920727925 |
57
+| [Amazon AMI](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fami%2Fphoton-ami-2.0-31bb961.tar.gz) | 135MB | 2461b81f3d7c2325737c6ae12099e4c7ef6a079c | 67458ee457a0cf68d199ab95fc707107 |
58
+| [Google GCE](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fgce%2Fphoton-gce-2.0-31bb961.tar.gz) | 704MB | c65bcc0cbda061c6305f968646be2d72a4283227 | 2dff057540e37a161520ec86e39b17aa |
59
+| [Azure VHD - gz file](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fazure%2Fphoton-azure-2.0-31bb961.vhd.gz) | 169MB | b43a746fead931ae2bb43e9108cde35913b23715 | 3485c7a31741cca07cc11cbf374ec1a5 |
60
+
61
+## Downloading Photon OS 2.0 Beta 
62
+------------------------------
63
+Photon OS 2.0 Beta is here! Choose the download that’s right for you and click one of the links below. Refer to the associated sha1sums and md5sums.
64
+
65
+### Photon OS 2.0 Beta Binaries
66
+| Download | Size | sha1 checksum | md5 checksum |
67
+| --- | --- | --- | --- |
68
+| [Full ISO](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fiso%2Fphoton-2.0-8553d58.iso) | 2.1GB | 7a0e837061805b7aa2649f9ba6652afb2d4591fc | a52c50240726cb3c4219c5c608f9acf3 |
69
+| [OVA with virtual hardware v11](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fova%2Fphoton-custom-hw11-2.0-8553d58.ova) | 110MB | 30b81b22a7754165ff30cc964b0a4a66b9469805 | fb309ee535cb670fe48677f5bfc74ec0 |
70
+| [Amazon AMI](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fami%2Fphoton-ami-2.0-8553d58.tar.gz) | 136MB | 320c5b6f6dbf6b000a6036b569b13b11e0e93034 | cc3cff3cf9a9a8d5f404af0d78812ab4 |
71
+| [Google GCE](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fgce%2Fphoton-gce-2.0-8553d58.tar.gz) | 705MB | c042d46971fa3b642e599b7761c18f4005fc70a7 | 03b873bbd2f0dd1401a334681c59bbf6 |
72
+| [Azure VHD](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fazure%2Fphoton-azure-2.0-8553d58.vhd) | 17GB | 20cfc506a2425510e68a9d12ea48218676008ffe | 6a531eab9e1f8cba89b1f150d344ecab |
73
+
74
+## Downloading Photon OS 1.0
75
+-------------------------
76
+
77
+### Photon OS 1.0 AMI ID (Update: September 28th, 2017)
78
+
79
+-------------------------
80
+| Region | AMI ID|
81
+| --- | --- |
82
+| N Virginia | ami-18758762 |
83
+| Ohio | ami-96200df3 |
84
+| N.California | ami-37360657 |
85
+| Oregon | ami-66b74f1e |
86
+
87
+### Photon OS 1.0, Revision 2 Binaries (Update: January 19th, 2017)
88
+
89
+-------------------------------------------------------------
90
+We've been busy updating RPMs in our repository for months, now, to address both functional and security issues. However, our binaries have remained fixed since their release back in September 2015. In order to make it faster and easier to get a up-to-date Photon OS system, we've repackaged all of our binaries to include all of these RPM updates. For clarity, we'll call these updated binaries, which are still backed by the 1.0 repos - **1.0, Revision 2**.
91
+
92
+Choose the download that’s right for you and click one of the links below.
93
+
94
+#### Photon OS 1.0, Revision 2 Binaries
95
+
96
+| Download | Size | sha1 checksum | md5 checksum |
97
+| --- | --- | --- | --- |
98
+| [Full ISO](https://bintray.com/vmware/photon/download_file?file_path=photon-1.0-62c543d.iso) | 2.4GB | c4c6cb94c261b162e7dac60fdffa96ddb5836d66| 69500c07d25ce9caa9b211a8b6eefd61|
99
+| [OVA with virtual hardware v10](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw10-1.0-62c543d.ova) | 159MB | 6e9087ed25394e1bbc56496ae368b8c77efb21cb | 3e4b1a5f24ab463677e3edebd1ecd218|
100
+| [OVA with virtual hardware v11](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw11-1.0-62c543d.ova) | 159MB | 18c1a6d31545b757d897c61a0c3cc0e54d8aeeba| be9961a232ad5052b746fccbb5a9672d|
101
+| [Amazon AMI](https://bintray.com/vmware/photon/download_file?file_path=photon-ami-1.0-62c543d.tar.gz) | 590MB | 6df9ed7fda83b54c20bc95ca48fa467f09e58548| 5615a56e5c37f4a9c762f6e3bda7f9d0|
102
+| [Google GCE](https://bintray.com/vmware/photon/download_file?file_path=photon-gce-1.0-62c543d.tar.gz) | 164MB | 1feb68ec00aaa79847ea7d0b00eada7a1ac3b527| 5adb7b30803b168e380718db731de5dd|
103
+
104
+There are a few other ways that you could create a Photon OS instance – either making the ISO from source that’s been cloned from the [GitHub Photon OS repository](https://github.com/vmware/photon), using the [instructions](https://github.com/vmware/photon/blob/master/docs/build-photon.md) found on the GitHub repo, using the [scripted installation](https://github.com/vmware/photon/blob/master/docs/kickstart.md), or [boot Photon OS over a network](https://github.com/vmware/photon/blob/master/docs/PXE-boot.md), using PXE. These options are beyond the scope of this document. If you’re interested in these methods, follow the links provided above. 
105
+
106
+### Photon OS 1.0, Original Binaries
107
+--------------------------------
108
+
109
+If you're looking for the original Photon OS, version 1.0 binaries, they can still be found here:
110
+
111
+#### Photon OS 1.0, Original Binaries ####
112
+| Download | Size | sha1 checksum | md5 checksum |
113
+| --- | --- | --- | --- |
114
+| [Full ISO](https://bintray.com/artifact/download/vmware/photon/photon-1.0-13c08b6.iso) | 2.1GB | ebd4ae77f2671ef098cf1e9f16224a4d4163bad1 | 15aea2cf5535057ecb019f3ee3cc9d34 |
115
+| [OVA with virtual hardware v10](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw10-1.0-13c08b6.ova) | 292MB | 8669842446b6aac12bd3c8158009305d46b95eac | 3ca7fa49128d1fd16eef1993cdccdd4d |
116
+| [OVA with virtual hardware v11](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw11-1.0-13c08b6.ova) | 292MB | 2ee56c5ce355fe6c59888f2f3731fd9d51ff0b4d | 8838498fb8202aac5886518483639073 |
117
+| [Amazon AMI](https://bintray.com/artifact/download/vmware/photon/photon-ami-1.0-13c08b6.tar.gz) | 148.5MB | 91deb839d788ec3c021c6366c192cf5ac601575b | fe657aafdc8189a85430e19ef82fc04a |
118
+| [Google GCE](https://bintray.com/artifact/download/vmware/photon/photon-gce-1.0-13c08b6.tar.gz) | 411.7MB | 397ccc7562f575893c89a899d9beafcde6747d7d | 67a671e032996a26d749b7d57b1b1887 |
0 119
new file mode 100644
... ...
@@ -0,0 +1,169 @@
0
+# Photon OS Frequently Asked Questions
1
+
2
+* [What is Photon OS?](#q-what-is-photon-os)
3
+* [How do I get started with Photon OS?](#q-how-do-i-get-started-with-photon-os)
4
+* [Can I upgrade my existing Photon OS 1.0 VMs?](#q-can-i-upgrade-my-existing-photon-os-10-vms)
5
+* [What kind of support comes with Photon OS?](#q-what-kind-of-support-comes-with-photon-os)
6
+* [How can I contribute to Photon OS?](#q-how-can-i-contribute-to-photon-os)
7
+* [How is Photon OS patched?](#q-how-is-Photon-OS-patched)
8
+* [How does Photon OS relate to Project Lightwave?](#q-how-does-photon-os-relate-to-project-lightwave)
9
+* [Will VMware continue to support other container host runtime offerings on vSphere?](#q-will-vmware-continue-to-support-other-container-host-runtime-offerings-on-vsphere)
10
+* [How to report a security vulnerability in Photon OS?](#q-how-to-report-a-security-vulnerability-in-photon-os)
11
+* [What are the Docker improvements in Photon OS 2.0?](#q-what-are-the-docker-improvements-in-photon-os-20)
12
+* [Why is VMware creating Photon OS?](#q-why-is-vmware-creating-photon-os)
13
+* [Why is VMware open-sourcing Photon OS?](#q-why-is-vmware-open-sourcing-photon-os)
14
+* [In what way is Photon OS "optimized for VMware?"](#q-in-what-way-is-photon-os-optimized-for-vmware)
15
+* [Why can't I SSH in as root?](#q-why-cant-i-ssh-in-as-root)
16
+* [Why isn't netstat working?](#q-why-is-netstat-not-working)
17
+* [Why do all of my cloned Photon OS instances have the same IP address when using DHCP?](#q-why-do-all-of-my-cloned-photon-os-instances-have-the-same-ip-address-when-using-dhcp)
18
+* [How to install new packages?](#how-to-install-new-packages)
19
+* [Why is the yum command not working in a minimal installation?](#q-why-the-yum-command-not-working-in-a-minimal-installation)
20
+* [How to install all build essentials?](#q-how-to-install-all-build-essentials)
21
+* [How to build new package for Photon OS?](#q-how-to-build-new-package-for-photon-os)
22
+* [I just booted into freshly installed Photon OS instance, why isn't "docker ps" working?](#q-i-just-booted-into-freshly-installed-photon-os-instance-why-isnt-docker-ps-working)
23
+* [What is the difference between Minimal and Full installation?](#q-what-is-the-difference-between-minimal-and-full-installation)
24
+* [What packages are included in Minimal and Full?](#q-what-packages-are-included-in-minimal-and-full)
25
+* [How do I transfer or share files between Photon OS and my host machine?](#q-how-do-i-transfer-or-share-files-between-photon-and-my-host-machine)
26
+* [Why is the ISO over 2GB, when I hear that Photon OS is a minimal container runtime?](#q-why-is-the-iso-over-2gb-when-i-hear-that-photon-os-is-a-minimal-container-runtime)
27
+
28
+***
29
+
30
+# Getting Started
31
+
32
+## Q. What is Photon OS?
33
+A. Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see [https://vmware.github.io/photon/](https://vmware.github.io/photon/).
34
+
35
+## Q. How do I get started with Photon OS?
36
+A. Start by deciding your target platform. Photon OS 2.0 has been certified in public cloud environments - Microsoft Azure (new), Google Compute Engine (GCE), Amazon Elastic Compute Cloud (EC2) - as well as on VMware vSphere, VMware Fusion, and VMware Workstation.
37
+Next, download the latest binary distributions for your target platform. The binaries are hosted on [https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/). For download instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
38
+Finally, go to the installation instructions for your target platform, which are listed here:  [Quick Start](photon-admin-guide.md#getting-started-with-photon-os-20).
39
+
40
+## Q. Can I upgrade my existing Photon OS 1.0 VMs?
41
+A. Yes, there is an in-place upgrade path for Photon OS 1.0 implementations. You simply download an upgrade package, run a script, and reboot the VM. Refer to the instructions in [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md).
42
+
43
+## Q. What kind of support comes with Photon OS?
44
+A. Photon OS is supported through community efforts and direct developer engagement in the communities. Potential users of Photon OS should start with the [Photon microsite](http://vmware.com/photon).
45
+
46
+Developers who might want the source code, including those interested in making contributions, should visit the [Photon OS Github repository](https://github.com/vmware/photon). 
47
+
48
+## Q. How can I contribute to Photon OS?
49
+A. We welcome community participation in the development of Photon OS and look forward to broad ecosystem engagement around the project. Getting your idea into Photon OS is just a [GitHub](https://vmware.github.io/photon) pull request away. When you submit a pull request, you'll be asked to accept the Contributor License Agreement (CLA). 
50
+
51
+## Q. How is Photon OS patched?
52
+A. Within a major release, updates will be delivered as package updates. Security updates will be delivered on an as-needed basis. Non-security related updates will happen quarterly, but may not include every, single package update. The focus is on delivering a valid, functional updated stack every quarter.
53
+
54
+Photon OS isn't "patched," as a whole - instead, individual packages are updated (potentially, with patches applied to that individual package). For instance, if a package releases a fix for a critical vulnerability, we'll update the package in the Photon OS repository, for critical issues probably within a day or two. At that point, customers get that updated package by running, "tdnf update <package>"
55
+ 
56
+## Q. How does Photon OS relate to Project Lightwave?
57
+A. Project Lightwave is an open-sourced project that provides enterprise-grade identity and access management services, and can be used to solve key security, governance, and compliance challenges for a variety of use cases within the enterprise.
58
+Through integration between Photon OS and Project Lightwave, organizations can enforce security and 
59
+governance on container workloads, for example, by ensuring only authorized containers are run on authorized hosts, by authorized users. For details about Lightwave, see [https://github.com/vmware/lightwave](https://github.com/vmware/lightwave).
60
+
61
+## Q. Will VMware continue to support other container host runtime offerings on vSphere?
62
+A. YES, VMware is committed to delivering an infrastructure for all workloads, and for vSphere to have the largest guest OS support in the industry and support customer choice. 
63
+Toward those goals, VMware will continue to work with our technology partners to support new Guest Operating Systems and container host runtimes as they come to the market. Open-sourcing Photon OS will enable optimizations and enhancements for container host runtimes on VMware Platform are available as reference implementation for other container host runtimes as well.
64
+
65
+# Photon OS
66
+## Q. What is Photon OS?
67
+A. Photon OS is an open source, Linux container host runtime optimized for VMware vSphere®. Photon OS is extensible, lightweight, and supports the most common container formats including Docker, Rocket and Garden. Photon OS includes a small footprint, yum-compatible, package-based lifecycle management system, and can support an rpm-ostree image-based system versioning. When used with development tools and environments such as VMware Fusion®, VMware Workstation™, HashiCorp (Vagrant and Atlas) and a production runtime environment (vSphere, VMware vCloud® Air™), Photon OS allows seamless migration of containers-based Apps from development to production.
68
+
69
+## Q. How to report a security vulnerability in Photon OS?
70
+A. VMware encourages users who become aware of a security vulnerability in VMware products to contact VMware with details of the vulnerability. VMware has established an email address that should be used for reporting a vulnerability. Please send descriptions of any vulnerabilities found to security@vmware.com. Please include details on the software and hardware configuration of your system so that we can duplicate the issue being reported.
71
+
72
+Note: We encourage use of encrypted email. Our public PGP key is found at [kb.vmware.com/kb/1055](http://kb.vmware.com/kb/1055).
73
+
74
+VMware hopes that users encountering a new vulnerability will contact us privately as it is in the best interests of our customers that VMware has an opportunity to investigate and confirm a suspected vulnerability before it becomes public knowledge.
75
+
76
+In the case of vulnerabilities found in third-party software components used in VMware products, please also notify VMware as described above.
77
+
78
+## Q. What are the Docker improvements in Photon OS 2.0?
79
+In Photon OS 2.0, the Docker image size (compressed and uncompressed) was reduced to less than a third of its size in Photon OS 1.0. This gain resulted from:
80
+- using toybox (instead of standard core tools), which brings the docker image size from 50MB (in 1.0) to 14MB (in 2.0)
81
+- a package split - in Photon OS 2.0, the binary set contains only bash, tdnf, and toybox; all other installed packages are now libraries only.
82
+
83
+## Q. Why is VMware creating Photon OS?
84
+A. It's about workloads - VMware has always positioned our vSphere platform as a secure, highly-performant platform for enterprise applications. With containers, providing an optimized runtime ensures that customers can embrace these new workload technologies without disrupting existing operations. Over time, Photon OS will extend the capabilities of the software-defined data center such as security, identity and resource management to containerized workloads. Organizations can then leverage a single infrastructure architecture for both traditional and cloud-native Apps, and leverage existing investments in tools, skills and technologies. This converged environment will simplify operation and troubleshooting, and ease the adoption of Cloud-Native Apps. 
85
+
86
+Photon OS can provide a reference implementation for optimizing containers on VMware platforms across compute, network, storage and management. For example, Photon OS can deliver performance through kernel tuning to remove redundant caching between the Linux kernel and the vSphere hypervisor, and advanced security services through network micro-segmentation delivered by VMware NSX™, and more.
87
+
88
+## Q. Why is VMware open-sourcing Photon OS?
89
+A. Open-sourcing Photon OS encourages discussion, innovation, and collaboration with others in the container ecosystem. In particular, we want to make sure the innovations we introduce to Photon to run containers effectively on VMware are also available to any other container runtime OS. 
90
+Additionally, VMware is committed to supporting industry and de facto standards, as doing so also supports stronger security, interoperability, and choice for our customers. 
91
+
92
+## Q. In what way is Photon OS "optimized for VMware?"
93
+
94
+Photon OS 1.0 introduced extensive optimizations for VMware environments, which are described in detail in the following VMware white paper: [Deploying Cloud-Native Applications with Photon OS](https://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/whitepaper/vmware-deploying-cloud-native-apps-with-photon-os.pdf). Photon OS 2.0 enhances VMware optimization. The kernel message dumper (new in Photon OS 2.0) is a paravirt feature that extends debugging support. In case of a guest panic, the kernel (through the paravirt channel) dumps the entire kernel log buffer (including the panic message) into the VMware log file (vmware.log) for easy, consolidated access. Previously, this information was stored in a huge vmss (VM suspend state) file.
95
+
96
+## Q. Why can't I SSH in as root?
97
+A. By default Photon does not permit root login to ssh. To make yourself login as root using SSH set PermitRootLogin yes in /etc/ssh/sshd_config, and restart the sshd deamon.
98
+
99
+## Q. Why is netstat not working?
100
+A. netstat is deprecated, ss or ip (part of iproute2) should be used instead.
101
+
102
+## Q. Why do all of my cloned Photon OS instances have the same IP address when using DHCP?
103
+A. Photon OS uses the contents of /etc/machine-id to determine the duid that is used for DHCP requests. If you're going to use a Photon OS instance as the base system for cloning to create additional Photon OS instances, you should clear the machine-id with:
104
+~~~~
105
+    echo -n > /etc/machine-id
106
+~~~~
107
+With this value cleared, systemd will regenerate the machine-id and, as a result, all DHCP requests will contain a unique duid. 
108
+
109
+# How to install new packages?
110
+## Q. Why is the yum command not working in a minimal installation?
111
+A. yum has package dependencies that make the system larger than it needs to be. Photon OS includes [tdnf](https://github.com/vmware/tdnf) - 'tiny' dandified yum - to provide package management and yum-functionality in a much, much smaller footprint. To install packages from cdrom, mount cdrom using following command
112
+~~~~
113
+     mount /dev/cdrom /media/cdrom
114
+~~~~
115
+Then, you can use tdnf to install new packages. For example, to install the vim editor, 
116
+~~~~
117
+     tdnf install vim
118
+~~~~
119
+## Q. How to install all build essentials?
120
+A. Following command can be used to install all build essentials.
121
+~~~~
122
+curl -L https://git.io/v1boE | xargs -I {} tdnf install -y {}
123
+~~~~
124
+## Q. How to build new package for Photon OS??
125
+A. Assuming you have an Ubuntu development environment, setup and get the latest code pull into /workspace. Lets assume your package name is foo with version 1.0.
126
+~~~~
127
+    cp foo-1.0.tar.gz /workspace/photon/SOURCES
128
+    cp foo.spec /workspace/photon/SPECS/foo/
129
+    cd /workspace/photon/support/package-builder
130
+    sudo python ./build_package.py -i foo
131
+~~~~
132
+## Q. I just booted into freshly installed Photon OS instance, why isn't "docker ps" working?
133
+A. Make sure docker daemon is running. By design and default in Photon OS, the docker daemon/engine is not started at boot time. To start the docker daemon for the current session, use the command:
134
+~~~~
135
+    systemctl start docker
136
+~~~~
137
+To start the docker daemon, on boot, use the command:
138
+~~~~
139
+    systemctl enable docker
140
+~~~~
141
+## Q. What is the difference between Minimal and Full installation?
142
+A. Minimal is the minimal set of packages for a container runtime, plus cloud-init.
143
+Full contains all the packages shipped with ISO.
144
+
145
+## Q. What packages are included in Minimal and Full?
146
+A. See [packages_minimal.json](https://github.com/vmware/photon/blob/dev/common/data/packages_minimal.json) as an example
147
+
148
+## Q. How do I transfer or share files between Photon and my host machine?
149
+A. Use vmhgfs-fuse to transfer files between Photon and your host machine:
150
+1. Enable Shared folders in the Workstation or Fusion UI (edit the VM settings and choose Options->Enabled shared folders).
151
+2. Make sure open-vm-tools is installed (it is installed by default in the Minimal installation and OVA import).
152
+3. Run vmware-hgfsclient to list the shares.
153
+
154
+Next, do one of the following:
155
+
156
+- Run the following to mount:
157
+~~~~
158
+vmhgfs-fuse .host:/$(vmware-hgfsclient) /mnt/hgfs
159
+~~~~
160
+OR
161
+
162
+- Add the following line to /etc/fstab:
163
+~~~~
164
+.host:/ /mnt/hgfs fuse.vmhgfs-fuse <options> 0 0
165
+~~~~
166
+
167
+## Q. Why is the ISO over 2GB, when I hear that Photon OS is a minimal container runtime?
168
+A. ISO includes a repository with all Photon OS packages. When you mount the ISO to a machine and boot to the Photon installer, you'll be able to choose the Photon Minimal installation option and the hypervisor-optimized Linux kernel, which will reduce the storage size.
0 169
\ No newline at end of file
1 170
new file mode 100644
... ...
@@ -0,0 +1,41 @@
0
+# Install and Configure DCOS CLI for Mesos
1
+
2
+To install the DCOS CLI:
3
+Install virtualenv. The Python tool virtualenv is used to manage the DCOS CLI’s environment.
4
+
5
+```
6
+sudo pip install virtualenv
7
+```
8
+
9
+Tip: On some older Python versions, ignore any ‘Insecure Platform’ warnings. For more information, see https://virtualenv.pypa.io/en/latest/installation.html. From the command line, create a new directory named dcos and navigate into it.
10
+
11
+```
12
+$ mkdir dcos
13
+$ cd dcos
14
+$ curl -O https://downloads.mesosphere.io/dcos-cli/install.sh
15
+```
16
+
17
+Run the DCOS CLI install script, where <hosturl> is the hostname of your master node prefixed with http://:
18
+```
19
+$ bash install.sh <install_dir> <mesos-master-host>
20
+```
21
+
22
+For example, if the hostname of your Mesos master node is mesos-master.example.com:
23
+
24
+```
25
+$ bash install.sh . http://mesos-master.example.com
26
+```
27
+
28
+Follow the on-screen DCOS CLI instructions and enter the Mesosphere verification code. You can ignore any Python ‘Insecure Platform’ warnings.
29
+
30
+```
31
+Confirm whether you want to add DCOS to your system PATH:
32
+$ Modify your bash profile to add DCOS to your PATH? [yes/no]
33
+```
34
+
35
+Since DCOS CLI is used for DCOS cluster, reconfigure Marathon and Mesos masters URLs with the following commands:
36
+
37
+```
38
+dcos config set core.mesos_master_url http://<mesos-master-host>:5050
39
+dcos config set marathon.url http://<marathon-host>:8080
40
+```
0 41
new file mode 100644
... ...
@@ -0,0 +1,59 @@
0
+# Install and Configure Marathon for Mesos Cluster on PhotonOS
1
+
2
+In this How-To I am going to explain how to install and configure Marathon for Mesos cluster. All the following steps should be done on each Mesos master.
3
+
4
+First, download Marathon:
5
+
6
+```
7
+root@pt-mesos-master2 [ ~ ]# mkdir -p  /opt/mesosphere/marathon/ && cd /opt/mesosphere/marathon/
8
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]#  curl -O http://downloads.mesosphere.com/marathon/v0.13.0/marathon-0.13.0.tgz
9
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# tar -xf marathon-0.13.0.tgz
10
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# mv marathon-0.13.0 marathon
11
+```
12
+
13
+Create a configuration for Marathon:
14
+
15
+```
16
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# ls -l /etc/marathon/conf/
17
+total 8
18
+-rw-r--r-- 1 root root 68 Dec 24 14:33 master
19
+-rw-r--r-- 1 root root 71 Dec 24 14:33 zk
20
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# cat /etc/marathon/conf/*
21
+zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/mesos
22
+zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/marathon
23
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# cat /etc/systemd/system/marathon.service
24
+[Unit]
25
+Description=Marathon
26
+After=network.target
27
+Wants=network.target
28
+ 
29
+[Service]
30
+Environment="JAVA_HOME=/opt/OpenJDK-1.8.0.51-bin"
31
+ExecStart=/opt/mesosphere/marathon/bin/start \
32
+    --master zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/mesos \
33
+    --zk zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/marathon
34
+Restart=always
35
+RestartSec=20
36
+ 
37
+[Install]
38
+WantedBy=multi-user.target
39
+```
40
+
41
+Finally, we need to change the Marathon startup script, since PhotonOS do not use the standard JRE. 
42
+
43
+Make sure you add JAVA_HOME to Java path:
44
+
45
+```
46
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# tail -n3 /opt/mesosphere/marathon/bin/start
47
+# Start Marathon
48
+marathon_jar=$(find "$FRAMEWORK_HOME"/target -name 'marathon-assembly-*.jar' | sort | tail -1)
49
+exec "${JAVA_HOME}/bin/java" "${java_args[@]}" -jar "$marathon_jar" "${app_args[@]}"
50
+```
51
+
52
+Now we can start the Marthon service:
53
+```
54
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# systemctl start marathon
55
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# ps -ef | grep marathon
56
+root     15821     1 99 17:14 ?        00:00:08 /opt/OpenJDK-1.8.0.51-bin/bin/java -jar /opt/mesosphere/marathon/bin/../target/scala-2.11/marathon-assembly-0.13.0.jar --master zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/mesos --zk zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/marathon
57
+root     15854 14692  0 17:14 pts/0    00:00:00 grep --color=auto marathon
58
+```
0 59
\ No newline at end of file
1 60
new file mode 100644
... ...
@@ -0,0 +1,158 @@
0
+# Install and Configure Mesos DNS on a Mesos Cluster
1
+
2
+## Overview 
3
+
4
+Before you read this How-To, please read: [Install and Configure a Production-Ready Mesos Cluster on PhotonOS](Install-and-Configure-a-Production-Ready-Mesos-Cluster-on-Photon-OS.md), [Install and Configure Marathon for Mesos Cluster on PhotonOS](Install-and-Configure-Marathon-for-Mesos-Cluster-on-PhotonOS.md) and [Install and Configure DCOS CLI for Mesos](Install-and-Configure-DCOS-CLI-for-Mesos.md).
5
+
6
+After you have fully installed and configured the Mesos cluster, you can execute jobs on it. However, if you want a service discovery and load balancing capabilities you will need to use Mesos-DNS and Haproxy. In this How-To I will explain how to install and configure Mesos-DNS for your Mesos cluster.
7
+Mesos-DNS supports service discovery in Apache Mesos clusters. It allows applications and services running on Mesos to find each other through the domain name system (DNS), similarly to how services discover each other throughout the Internet. Applications launched by Marathon are assigned names like search.marathon.mesos. Mesos-DNS translates these names to the IP address and port on the machine currently running each application. To connect to an application in the Mesos datacenter, all you need to know is its name. Every time a connection is initiated, the DNS translation will point to the right machine in the datacenter.
8
+
9
+![Architecture](images/architecture.png)
10
+
11
+## Installation
12
+
13
+I will explain how to configure Mesos-DNS docker and run it through Marathon. I will show you how to create a configuration file for a mesos-dns-docker container and how to run it via Marathon.
14
+
15
+```
16
+root@pt-mesos-node1 [ ~ ]# cat /etc/mesos-dns/config.json
17
+{
18
+  "zk": "zk://192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181/mesos",
19
+  "masters": ["192.168.0.1:5050", "192.168.0.2:5050", "192.168.0.3:5050"],
20
+  "refreshSeconds": 60,
21
+  "ttl": 60,
22
+  "domain": "mesos",
23
+  "port": 53,
24
+  "resolvers": ["8.8.8.8"],
25
+  "timeout": 5,
26
+  "httpon": true,
27
+  "dnson": true,
28
+  "httpport": 8123,
29
+  "externalon": true,
30
+  "SOAMname": "ns1.mesos",
31
+  "SOARname": "root.ns1.mesos",
32
+  "SOARefresh": 60,
33
+  "SOARetry":   600,
34
+  "SOAExpire":  86400,
35
+  "SOAMinttl": 60
36
+}
37
+```
38
+
39
+### Create Application Run File
40
+
41
+Next step is to create a json file and run the service from Marathon for HA. It is possible to run the service via API or via DCOS CLI.
42
+
43
+```
44
+client:~/mesos/jobs$ cat mesos-dns-docker.json
45
+{
46
+    "args": [
47
+        "/mesos-dns",
48
+        "-config=/config.json"
49
+    ],
50
+    "container": {
51
+        "docker": {
52
+            "image": "mesosphere/mesos-dns",
53
+            "network": "HOST"
54
+        },
55
+        "type": "DOCKER",
56
+        "volumes": [
57
+            {
58
+                "containerPath": "/config.json",
59
+                "hostPath": "/etc/mesos-dns/config.json",
60
+                "mode": "RO"
61
+            }
62
+        ]
63
+    },
64
+    "cpus": 0.2,
65
+    "id": "mesos-dns-docker",
66
+    "instances": 3,
67
+    "constraints": [["hostname", "CLUSTER", "pt-mesos-node2.example.com"]]
68
+}
69
+```
70
+
71
+Now we can see in the Marthon and Mesos UI that we launched the application.
72
+
73
+
74
+### Setup Resolvers and Testing
75
+
76
+To allow Mesos tasks to use Mesos-DNS as the primary DNS server, you must edit the file */etc/resolv.conf* in every slave and add a new nameserver. For instance, if *mesos-dns* runs on the server with IP address *192.168.0.5* at the beginning of */etc/resolv.conf* on every slave.
77
+
78
+```
79
+root@pt-mesos-node2 [ ~/mesos-dns ]# cat /etc/resolv.conf
80
+# This file is managed by systemd-resolved(8). Do not edit.
81
+#
82
+# Third party programs must not access this file directly, but
83
+#only through the symlink at /etc/resolv.conf. To manage
84
+# resolv.conf(5) in a different way, replace the symlink by a
85
+# static file or a different symlink.
86
+nameserver 192.168.0.5
87
+nameserver 192.168.0.4
88
+nameserver 8.8.8.8
89
+```
90
+
91
+Let's run a simple Docker app and see if we can resolve it in DNS.
92
+
93
+```
94
+client:~/mesos/jobs$ cat docker.json
95
+{
96
+    "id": "docker-hello",
97
+    "container": {
98
+        "docker": {
99
+            "image": "centos"
100
+        },
101
+        "type": "DOCKER",
102
+        "volumes": []
103
+    },
104
+    "cmd": "echo hello; sleep 10000",
105
+    "mem": 16,
106
+    "cpus": 0.1,
107
+    "instances": 10,
108
+    "disk": 0.0,
109
+    "ports": [0]
110
+}
111
+```
112
+```
113
+client:~/mesos/jobs$ dcos marathon app add docker.json
114
+```
115
+
116
+Let's try to resolve it.
117
+
118
+```
119
+root@pt-mesos-node2 [ ~/mesos-dns ]# dig _docker-hello._tcp.marathon.mesos SRV
120
+;; Truncated, retrying in TCP mode.
121
+; <<>> DiG 9.10.1-P1 <<>> _docker-hello._tcp.marathon.mesos SRV
122
+;; global options: +cmd
123
+;; Got answer:
124
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25958
125
+;; flags: qr aa rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 10
126
+;; QUESTION SECTION:
127
+;_docker-hello._tcp.marathon.mesos. IN SRV
128
+;; ANSWER SECTION:
129
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31998 docker-hello-4bjcf-s2.marathon.slave.mesos.
130
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31844 docker-hello-jexm6-s1.marathon.slave.mesos.
131
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31111 docker-hello-6ms44-s2.marathon.slave.mesos.
132
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31719 docker-hello-muhui-s2.marathon.slave.mesos.
133
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31360 docker-hello-jznf4-s1.marathon.slave.mesos.
134
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31306 docker-hello-t41ti-s1.marathon.slave.mesos.
135
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31124 docker-hello-mq3oz-s1.marathon.slave.mesos.
136
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31816 docker-hello-tcep8-s1.marathon.slave.mesos.
137
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31604 docker-hello-5uu37-s1.marathon.slave.mesos.
138
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31334 docker-hello-jqihw-s1.marathon.slave.mesos.
139
+ 
140
+;; ADDITIONAL SECTION:
141
+docker-hello-muhui-s2.marathon.slave.mesos. 60 IN A 192.168.0.5
142
+docker-hello-4bjcf-s2.marathon.slave.mesos. 60 IN A 192.168.0.5
143
+docker-hello-jexm6-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
144
+docker-hello-jqihw-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
145
+docker-hello-mq3oz-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
146
+docker-hello-tcep8-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
147
+docker-hello-6ms44-s2.marathon.slave.mesos. 60 IN A 192.168.0.5
148
+docker-hello-t41ti-s1.marathon.slave.mesos. 60 IN A 192.168.0.4
149
+docker-hello-jznf4-s1.marathon.slave.mesos. 60 IN A 192.168.0.4
150
+docker-hello-5uu37-s1.marathon.slave.mesos. 60 IN A 192.168.0.4
151
+;; Query time: 0 msec
152
+;; SERVER: 192.168.0.5#53(192.168.0.5)
153
+;; WHEN: Sun Dec 27 14:36:32 UTC 2015
154
+;; MSG SIZE  rcvd: 1066
155
+```
156
+
157
+We can see that we can resolve our app.
0 158
\ No newline at end of file
1 159
new file mode 100644
... ...
@@ -0,0 +1,175 @@
0
+# Install and Configure a Production Ready Mesos Cluster on Photon OS
1
+
2
+## Overview
3
+
4
+For this setup I will use 3 Mesos masters and 3 slaves. On each Mesos master I will run a Zookeeper, meaning that we will have 3 Zookeepers as well. The Mesos cluster will be configured with a quorum of 2. For networking Mesos use Mesos-DNS. I tried to run Mesos-DNS as container, but got into some resolving issues, so in my next How-To I will explain how to configure Mesos-DNS and run it through Marathon. Photon hosts will be used for masters and slaves.
5
+
6
+**Masters:**
7
+
8
+| Hostname | IP Address|
9
+|-
10
+| pt-mesos-master1.example.com | 192.168.0.1 |
11
+| pt-mesos-master2.example.com | 192.168.0.2 |
12
+| pt-mesos-master3.example.com | 192.168.0.3 |
13
+
14
+**Agents:**
15
+
16
+| Hostname | IP Address|
17
+|-
18
+| pt-mesos-node1.example.com | 192.168.0.4 |
19
+| pt-mesos-node2.example.com | 192.168.0.5 |
20
+| pt-mesos-node3.example.com | 192.168.0.6
21
+
22
+## Masters Installation and Configuration 
23
+
24
+First of all we will install Zookeeper. Since currently there is a bug in Photon related to the Zookeeper installation I will use the tarball. Do the following for each master:
25
+
26
+```
27
+root@pt-mesos-master1 [ ~ ]# mkdir -p /opt/mesosphere && cd /opt/mesosphere && wget http://apache.mivzakim.net/zookeeper/stable/zookeeper-3.4.7.tar.gz
28
+root@pt-mesos-master1 [ /opt/mesosphere ]# tar -xf zookeeper-3.4.7.tar.gz && mv zookeeper-3.4.7 zookeeper
29
+root@pt-mesos-master1 [ ~ ]# cat /opt/mesosphere/zookeeper/conf/zoo.cfg | grep -v '#'
30
+tickTime=2000
31
+initLimit=10
32
+syncLimit=5
33
+dataDir=/var/lib/zookeeper
34
+clientPort=2181
35
+server.1=192.168.0.1:2888:3888
36
+server.2=192.168.0.2:2888:3888
37
+server.3=192.168.0.3:2888:3888
38
+```
39
+
40
+Example of Zookeeper systemd configuration file:
41
+```
42
+root@pt-mesos-master1 [ ~ ]# cat /etc/systemd/system/zookeeper.service
43
+[Unit]
44
+Description=Apache ZooKeeper
45
+After=network.target
46
+ 
47
+[Service]
48
+Environment="JAVA_HOME=/opt/OpenJDK-1.8.0.51-bin"
49
+WorkingDirectory=/opt/mesosphere/zookeeper
50
+ExecStart=/bin/bash -c "/opt/mesosphere/zookeeper/bin/zkServer.sh start-foreground"
51
+Restart=on-failure
52
+RestartSec=20
53
+User=root
54
+Group=root
55
+ 
56
+[Install]
57
+WantedBy=multi-user.target
58
+```
59
+
60
+Add server id to the configuration file, so zookeeper will understand the id of your master server. 
61
+This should be done for each master with its own id.
62
+
63
+```
64
+root@pt-mesos-master1 [ ~ ]# echo 1 > /var/lib/zookeeper/myid
65
+root@pt-mesos-master1 [ ~ ]# cat /var/lib/zookeeper/myid
66
+1
67
+```
68
+
69
+Now lets install the Mesos masters. Do the following for each master:
70
+```
71
+root@pt-mesos-master1 [ ~ ]# yum -y install mesos
72
+Setting up Install Process
73
+Package mesos-0.23.0-2.ph1tp2.x86_64 already installed and latest version
74
+Nothing to do
75
+root@pt-mesos-master1 [ ~ ]# cat /etc/systemd/system/mesos-master.service
76
+[Unit]
77
+Description=Mesos Slave
78
+After=network.target
79
+Wants=network.target
80
+ 
81
+[Service]
82
+ExecStart=/bin/bash -c "/usr/sbin/mesos-master \
83
+    --ip=192.168.0.1 \
84
+    --work_dir=/var/lib/mesos \
85
+    --log_dir=/var/log/mesos \
86
+    --cluster=EXAMPLE \
87
+    --zk=zk://192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181/mesos \
88
+    --quorum=2"
89
+KillMode=process
90
+Restart=always
91
+RestartSec=20
92
+LimitNOFILE=16384
93
+CPUAccounting=true
94
+MemoryAccounting=true
95
+ 
96
+[Install]
97
+WantedBy=multi-user.target
98
+```
99
+
100
+Make sure you replace *ip* setting on each master. So far we have 3 masters with a Zookeeper and Mesos packages installed. Let's start zookeeper and mesos-master services on each master:
101
+
102
+```
103
+root@pt-mesos-master1 [ ~ ]# systemctl start zookeeper
104
+root@pt-mesos-master1 [ ~ ]# systemctl start mesos-master
105
+root@pt-mesos-master1 [ ~ ]# ps -ef | grep mesos
106
+root     11543     1  7 12:09 ?        00:00:01 /opt/OpenJDK-1.8.0.51-bin/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /opt/mesosphere/zookeeper/bin/../build/classes:/opt/mesosphere/zookeeper/bin/../build/lib/*.jar:/opt/mesosphere/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/mesosphere/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/opt/mesosphere/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/opt/mesosphere/zookeeper/bin/../lib/log4j-1.2.16.jar:/opt/mesosphere/zookeeper/bin/../lib/jline-0.9.94.jar:/opt/mesosphere/zookeeper/bin/../zookeeper-3.4.7.jar:/opt/mesosphere/zookeeper/bin/../src/java/lib/*.jar:/opt/mesosphere/zookeeper/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /opt/mesosphere/zookeeper/bin/../conf/zoo.cfg
107
+root     11581     1  0 12:09 ?        00:00:00 /usr/sbin/mesos-master --ip=192.168.0.1 --work_dir=/var/lib/mesos --log_dir=/var/lob/mesos --cluster=EXAMPLE --zk=zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/mesos --quorum=2
108
+root     11601  9117  0 12:09 pts/0    00:00:00 grep --color=auto mesos
109
+```
110
+
111
+## Slaves Installation and Configuration 
112
+
113
+The steps for configuring a Mesos slave are very simple and not very different from master installation. The difference is that we won't install zookeeper on each slave. We will also start the Mesos slaves in slave mode and will tell the daemon to join the Mesos masters. Do the following for each slave:
114
+
115
+```
116
+root@pt-mesos-node1 [ ~ ]# cat /etc/systemd/system/mesos-slave.service
117
+[Unit]
118
+Description=Photon instance running as a Mesos slave
119
+After=network-online.target,docker.service
120
+  
121
+[Service]
122
+Restart=on-failure
123
+RestartSec=10
124
+TimeoutStartSec=0
125
+ExecStartPre=/usr/bin/rm -f /tmp/mesos/meta/slaves/latest
126
+ExecStart=/bin/bash -c "/usr/sbin/mesos-slave \
127
+    --master=zk://192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181/mesos \
128
+        --hostname=$(/usr/bin/hostname) \
129
+        --log_dir=/var/log/mesos_slave \
130
+        --containerizers=docker,mesos \
131
+        --docker=$(which docker) \
132
+        --executor_registration_timeout=5mins \
133
+        --ip=192.168.0.4"
134
+  
135
+[Install]
136
+WantedBy=multi-user.target
137
+```
138
+
139
+Please make sure to replace the NIC name under *ip* setting. Start the mesos-slave service on each node.
140
+
141
+Now you should have ready Mesos cluster with 3 masters, 3 Zookeepers and 3 slaves. 
142
+
143
+If you want to use private docker registry, you will need to edit docker systemd file. 
144
+
145
+In my example I am using cse-artifactory.eng.vmware.com registry:
146
+
147
+```
148
+root@pt-mesos-node1 [ ~ ]# cat /lib/systemd/system/docker.service
149
+[Unit]
150
+Description=Docker Daemon
151
+Wants=network-online.target
152
+After=network-online.target
153
+  
154
+[Service]
155
+EnvironmentFile=-/etc/sysconfig/docker
156
+ExecStart=/bin/docker -d $OPTIONS -s overlay
157
+ExecReload=/bin/kill -HUP $MAINPID
158
+KillMode=process
159
+Restart=always
160
+MountFlags=slave
161
+LimitNOFILE=1048576
162
+LimitNPROC=1048576
163
+LimitCORE=infinity
164
+  
165
+[Install]
166
+WantedBy=multi-user.target
167
+  
168
+root@pt-mesos-node1 [ ~ ]# cat /etc/sysconfig/docker
169
+OPTIONS='--insecure-registry cse-artifactory.eng.vmware.com'
170
+root@pt-mesos-node1 [ ~ ]# systemctl daemon-reload && systemctl restart docker
171
+root@pt-mesos-node1 [ ~ ]# ps -ef | grep cse-artifactory
172
+root      5286     1  0 08:39 ?        00:00:00 /bin/docker -d --insecure-registry <your_privet_registry> -s overlay
173
+```
174
+
0 175
new file mode 100644
... ...
@@ -0,0 +1,287 @@
0
+# Install and Configure a Swarm Cluster with DNS Service on PhotonOS
1
+
2
+## Overview
3
+
4
+In this How-To, the steps for installing and configuring a Docker Swarm cluster, alongside DNS and Zookeeper, will be presented.
5
+
6
+The cluster that will be set up will be on VMware Photon hosts. 
7
+
8
+A prerequisite to using this guide is to be familiar with Docker Swarm - information can be found [here](https://docs.docker.com/swarm/).
9
+
10
+## Cluster description
11
+
12
+The cluster will have 2 Swarm Managers and 3 Swarm Agents:
13
+
14
+**Master**
15
+
16
+| Hostname | IP Address|
17
+|-
18
+| pt-swarm-master1.example.com | 192.168.0.1 |
19
+| pt-swarm-master2.example.com | 192.168.0.2 |
20
+
21
+**Agents**
22
+
23
+| Hostname | IP Address|
24
+|-
25
+| pt-swarm-agent1.example.com | 192.168.0.3 |
26
+| pt-swarm-agent2.example.com | 192.168.0.4 |
27
+| pt-swarm-agent3.example.com | 192.168.0.5 |
28
+
29
+## Docker Swarm Installation and Configuration
30
+
31
+### Setting Up the Managers
32
+
33
+The following steps should be done on both managers.
34
+
35
+Docker Swarm supports multiple methods of using service discovery, but in order to use failover, Consul, etcd or Zookeeper must be used. In this guide, Zookeeper will be used.
36
+
37
+Download the latest stable version of Zookeeper and create the *zoo.cfg* file under the *conf* directory:
38
+
39
+#### Zookeeper installation
40
+
41
+```
42
+root@pt-swarm-master1 [ ~ ]# mkdir -p /opt/swarm && cd /opt/swarm && wget http://apache.mivzakim.net/zookeeper/stable/zookeeper-3.4.6.tar.gz
43
+root@pt-swarm-master1 [ /opt/swarm ]# tar -xf zookeeper-3.4.6.tar.gz && mv zookeeper-3.4.6 zookeeper
44
+root@pt-swarm-master1 [ ~ ]# cat /opt/swarm/zookeeper/conf/zoo.cfg | grep -v '#'
45
+tickTime=2000
46
+initLimit=10
47
+syncLimit=5
48
+dataDir=/var/lib/zookeeper
49
+clientPort=2181
50
+server.1=192.168.0.1:2888:3888
51
+server.2=192.168.0.2:2888:3888
52
+```
53
+
54
+The dataDir should be an empty, existing directory.
55
+From the Zookeeper documentation: Every machine that is part of the ZooKeeper ensemble should know about every other machine in the ensemble. You accomplish this with the series of lines of the form server.id=host:port:port. You attribute the server id to each machine by creating a file named myid, one for each server, which resides in that server's data directory, as specified by the configuration file parameter dataDir. The myid file consists of a single line containing only the text of that machine's id. So myid of server 1 would contain the text "1" and nothing else. The id must be unique within the ensemble and should have a value between 1 and 255.
56
+
57
+Set Zookeeper ID
58
+```
59
+root@pt-swarm-master1 [ ~ ]# echo 1 > /var/lib/zookeeper/myid
60
+</source><br />
61
+Project Photon uses [https://en.wikipedia.org/wiki/Systemd Systemd] for services, so a zookeeper service should be created using systemd unit file.<br />
62
+<source lang="bash" enclose="div">
63
+root@pt-swarm-master1 [ ~ ]# cat /etc/systemd/system/zookeeper.service
64
+[Unit]
65
+Description=Apache ZooKeeper
66
+After=network.target
67
+ 
68
+[Service]
69
+Environment="JAVA_HOME=/opt/OpenJDK-1.8.0.51-bin"
70
+WorkingDirectory=/opt/swarm/zookeeper
71
+ExecStart=/bin/bash -c "/opt/swarm/zookeeper/bin/zkServer.sh start-foreground"
72
+Restart=on-failure
73
+RestartSec=20
74
+User=root
75
+Group=root
76
+ 
77
+[Install]
78
+WantedBy=multi-user.target
79
+```
80
+
81
+Zookeeper comes with OpenJDK, so having Java on the Photon host is not a prerequisite. Simply direct the Environment variable to the location where the Zookeeper was extracted.
82
+Now you need to enable and start the service. Enabling the service will make sure that if the host restarts for some reason, the service will automatically start.
83
+
84
+```
85
+root@pt-swarm-master1 [ ~ ]# systemctl enable zookeeper
86
+root@pt-swarm-master1 [ ~ ]# systemctl start zookeeper
87
+</source><br />
88
+Verify that the service was able to start:<br />
89
+<source lang="bash" enclose="div">
90
+root@pt-swarm-master1 [ ~ ]# systemctl status zookeeper
91
+zookeeper.service - Apache ZooKeeper
92
+   Loaded: loaded (/etc/systemd/system/zookeeper.service; enabled)
93
+   Active: active (running) since Tue 2016-01-12 00:27:45 UTC; 10s ago
94
+ Main PID: 4310 (java)
95
+   CGroup: /system.slice/zookeeper.service
96
+           `-4310 /opt/OpenJDK-1.8.0.51-bin/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /opt/swarm/zookeeper/bin/../build/classes:/opt/swarm/zookeeper/bin/../build/lib/*.jar:/opt/s...
97
+```
98
+
99
+On the Manager you elected to be the Swarm Leader (primary), execute the following (if you do not have a specific leader in mind, choose one of the managers randomly):
100
+
101
+```
102
+root@pt-swarm-master1 [ ~ ]# docker run -d --name=manager1 -p 8888:2375 swarm manage --replication --advertise 192.168.0.1:8888 zk://192.168.0.1,192.168.0.2/swarm
103
+```
104
+
105
+* *docker run -d* - run the container in the background.
106
+* *--name=manager1* - give the container a name instead of the auto-generated one.
107
+* *-p 8888:2375* - publish a container's port(s) to the host. In this case, when you connect to the host in port 8888, it connects to the container in port 2375.
108
+* swarm - the image to use for the container.
109
+* manage - the command to send to the container once it's up, alongside the rest of the parameters.
110
+* *--replication* - tells swarm that the manager is part of a a multi-manager configuration and that this primary manager competes with other manager instances for the primary role. The primary manager has the authority to manage the cluster, replicate logs, and replicate events that are happening inside the cluster.
111
+* *--advertise 192.168.0.1:8888* - specifies the primary manager address. Swarm uses this address to advertise to the cluster when the node is elected as the primary.
112
+* *zk://192.168.0.1,192.168.0.2/swarm* - specifies the Zookeepers' location to enable service discovery. The /swarm path is arbitrary, just make sure that every node that joins the cluster specifies that same path (it is meant to enable support for multiple clusters with the same Zookeepers).
113
+
114
+On the second manager, execute the following:
115
+
116
+```
117
+root@pt-swarm-master2 [ ~ ]# docker run -d --name=manager2 -p 8888:2375 swarm manage --replication --advertise 192.168.0.2:8888 zk://192.168.0.1,192.168.0.2/swarm
118
+```
119
+
120
+Notice that the only difference is the --advertise flag value. The first manager will not lose leadership following this command.
121
+
122
+Now 2 managers are alive, one is the primary and another is the replica. When we now look at the docker info on our primary manager, we can see the following information:
123
+
124
+```
125
+docker-client:~$ docker -H tcp://192.168.0.1:8888 info
126
+Containers: 0
127
+Images: 0
128
+Role: primary
129
+Strategy: spread
130
+Filters: health, port, dependency, affinity, constraint
131
+Nodes: 0
132
+CPUs: 0
133
+Total Memory: 0 B
134
+Name: 82b8516efb7c
135
+```
136
+
137
+There are a few things that are worth noticing:
138
+
139
+* The info command can be executed from ANY machine that can reach the master. The -H tcp://<ip>:<port> command specifies that the docker command should be executed on a remote host.
140
+* Containers - this is the result of the docker ps -a command for the cluster we just set up.
141
+* Images - the result of the docker images command.
142
+* Role - as expected, this is the primary manager.
143
+* Strategy - Swarm has a number of strategies it supports for setting up containers in the cluster. spread means that a new container will run on the node with the least amount of containers on it.
144
+* Filters - Swarm can choose where to run containers based on different filters supplied in the command line. More info can be found [here](https://docs.docker.com/swarm/scheduler/filter/).
145
+
146
+
147
+When we now look at the docker info on our replicated manager, we can see the following information:
148
+
149
+```
150
+docker-client:~$ docker -H tcp://192.168.0.2:8888 info
151
+Containers: 0
152
+Images: 0
153
+Role: replica
154
+Primary: 192.168.0.1:8888
155
+Strategy: spread
156
+Filters: health, port, dependency, affinity, constraint
157
+Nodes: 0
158
+CPUs: 0
159
+Total Memory: 0 B
160
+Name: ac06f826e507
161
+```
162
+
163
+Notice that the only differences between both managers are:
164
+Role: as expected, this is the replicated manager.
165
+Primary: contains the primary manager.
166
+
167
+#### Setting Up the Agents
168
+
169
+In Swarm, in order for a node to become a part of the cluster, it should "join" that said cluster - do the following for each of the agents.
170
+Edit the */usr/lib/systemd/system/docker.service* file so that each agent will be able to join the cluster:
171
+
172
+```
173
+root@pt-swarm-agent1 [ ~ ]# cat /usr/lib/systemd/system/docker.service
174
+[Unit]
175
+Description=Docker Daemon
176
+Wants=network-online.target
177
+After=network-online.target
178
+ 
179
+[Service]
180
+ExecStart=/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-advertise eno16777984:2375 --cluster-store zk://192.168.0.1,192.168.0.2/swarm
181
+ExecReload=/bin/kill -HUP $MAINPID
182
+KillMode=process
183
+Restart=always
184
+MountFlags=slave
185
+LimitNOFILE=1048576
186
+LimitNPROC=1048576
187
+LimitCORE=infinity
188
+ 
189
+[Install]
190
+WantedBy=multi-user.target
191
+```
192
+
193
+* -H tcp://0.0.0.0:2375 - This ensures that the Docker remote API on Swarm Agents is available over TCP for the Swarm Manager.
194
+* -H unix:///var/run/docker.sock - The Docker daemon can listen for Docker Remote API requests via three different types of Socket: unix, tcp, and fd. 
195
+    * tcp - If you need to access the Docker daemon remotely, you need to enable the tcp Socket.
196
+    * fd - On Systemd based systems, you can communicate with the daemon via Systemd socket activation.
197
+* *--cluster-advertise <NIC>:2375* - advertises the machine on the network by stating the ethernet card and the port used by the Swarm Managers.
198
+* --cluster-store zk://192.168.0.1,192.168.0.2/swarm - as we defined before, the service discovery being used here is Zookeeper.
199
+
200
+Enable and start the docker service:
201
+
202
+```
203
+root@pt-swarm-agent1 [ ~ ]# systemctl enable docker
204
+root@pt-swarm-agent1 [ ~ ]# systemctl daemon-reload && systemctl restart docker
205
+root@pt-swarm-agent1 [ ~ ]# systemctl status docker
206
+docker.service - Docker Daemon
207
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
208
+   Active: active (running) since Tue 2016-01-12 00:46:18 UTC; 4s ago
209
+ Main PID: 11979 (docker)
210
+   CGroup: /system.slice/docker.service
211
+           `-11979 /bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-advertise eno16777984:2375 --cluster-store zk://192.168.0.1,192.168.0.2/swarm
212
+```
213
+
214
+All that remains is to have the agents join the cluster:
215
+```
216
+root@pt-swarm-agent1 [ ~ ]# docker run -d swarm join --advertise=192.168.0.3:2375 zk://192.168.0.1,192.168.0.2/swarm
217
+```
218
+
219
+A look at the output of the docker info command will now show:
220
+```
221
+docker-client:~$ docker -H tcp://192.168.0.1:8888 info
222
+Containers: 3
223
+Images: 9
224
+Role: primary
225
+Strategy: spread
226
+Filters: health, port, dependency, affinity, constraint
227
+Nodes: 3
228
+ pt-swarm-agent1.example.com: 192.168.0.3:2375
229
+  └ Status: Healthy
230
+  └ Containers: 1
231
+  └ Reserved CPUs: 0 / 1
232
+  └ Reserved Memory: 0 B / 2.055 GiB
233
+  └ Labels: executiondriver=native-0.2, kernelversion=4.1.3-esx, operatingsystem=VMware Photon/Linux, storagedriver=overlay
234
+ pt-swarm-agent2.example.com: 192.168.0.4:2375
235
+  └ Status: Healthy
236
+  └ Containers: 1
237
+  └ Reserved CPUs: 0 / 1
238
+  └ Reserved Memory: 0 B / 2.055 GiB
239
+  └ Labels: executiondriver=native-0.2, kernelversion=4.1.3-esx, operatingsystem=VMware Photon/Linux, storagedriver=overlay
240
+ pt-swarm-agent3.example.com: 192.168.0.5:2375
241
+  └ Status: Healthy
242
+  └ Containers: 1
243
+  └ Reserved CPUs: 0 / 1
244
+  └ Reserved Memory: 0 B / 2.055 GiB
245
+  └ Labels: executiondriver=native-0.2, kernelversion=4.1.3-esx, operatingsystem=VMware Photon/Linux, storagedriver=overlay
246
+CPUs: 3
247
+Total Memory: 6.166 GiB
248
+Name: 82b8516efb7c
249
+```
250
+
251
+#### Setting Up DNS
252
+
253
+Docker does not have its own self-provided DNS so we use a [https://github.com/ahmetalpbalkan/wagl wagl] DNS.
254
+Setting it up is very simple. In this case, one of the masters will also be the DNS. Simply execute:
255
+
256
+```
257
+docker-client:~$ docker run -d --restart=always --name=dns -p 53:53/udp --link manager1:swarm ahmet/wagl wagl --swarm tcp://swarm:2375
258
+```
259
+
260
+* *--restart=always* - Always restart the container regardless of the exit status. When you specify always, the Docker daemon will try to restart the container continuously. The container will also always start on daemon startup, regardless of the current state of the container.
261
+* *--link manager1:swarm* - link the manager1 container (by name) and give it the alias swarm.
262
+That's it, DNS is up and running.
263
+
264
+### Test Your Cluster 
265
+
266
+#### Running Nginx
267
+
268
+Execute the following commands from any docker client:
269
+
270
+```
271
+docker-client:~$ docker -H tcp://192.168.0.1:8888 run -d -l dns.service=api -l dns.domain=example -p 80:80 vmwarecna/nginx
272
+docker-client:~$ docker -H tcp://192.168.0.1:8888 run -d -l dns.service=api -l dns.domain=example -p 80:80 vmwarecna/nginx
273
+```
274
+
275
+Note that this is the same command, executed twice. It tells the master to run 2 of the similar containers, each of which has 2 dns labels.
276
+
277
+Now, from any container in the cluster that has dnsutils, you can execute the following (for example):
278
+
279
+```
280
+root@13271a2d0fcb:/# dig +short A api.example.swarm
281
+192.168.0.3
282
+192.168.0.4
283
+root@13271a2d0fcb:/# dig +short SRV _api._tcp.example.swarm
284
+1 1 80 192.168.0.3.
285
+1 1 80 192.168.0.4.
286
+```
0 287
new file mode 100644
... ...
@@ -0,0 +1,38 @@
0
+# Installing the Lightwave Client on a Photon Image and Joining the Client to a Domain
1
+
2
+After you have set up a Lightwave domain controller, you can join Photon clients to that domain. You install the Lightwave client first. After the client is installed, you join the client to the domain.
3
+
4
+## Prerequisites
5
+
6
+- Prepare a Photon OS client for the Lightwave client installation.
7
+- Verify that the hostname of the client can be resolved.
8
+- Verify that you have 184 MB free for the Lightwave client installation.
9
+
10
+## Procedure
11
+
12
+1. Log in to your Photon OS client over SSH.
13
+2. Install the Lightwave client by running the following command. 
14
+	
15
+	`# tdnf install lightwave-client -y`
16
+
17
+3. Edit the `iptables` firewall rules configuration file to allow connections on port `2020` as a default setting.
18
+	
19
+	The default Photon OS 2.0 firewall settings block all incoming, outgoing, and forwards so that you must configure the rules.
20
+
21
+	1. Open the  iptables settings file.
22
+	
23
+	`# vi /etc/systemd/scripts/iptables`
24
+
25
+	2. Add allow information over tcp for port 2020 in the end of the file, save, and close the file.
26
+
27
+	`iptables -A INPUT -p tcp -m tcp --dport 2020 -j ACCEPT`
28
+
29
+	3. Run the following command to allow the required connections without restarting the client.
30
+
31
+	`# iptables -A INPUT -p tcp -m tcp --dport 2020 -j ACCEPT`
32
+
33
+4. Join the client to the domain by running the `domainjoin.sh` script and configuring the domain controller FQDN, domain, and the password for the `administrator` user.
34
+
35
+	`# domainjoin.sh --domain-controller <lightwave-server-FQDN> --domain <your-domain> --password '<administrator-user-password>`
36
+
37
+5. In a browser, go to https://*Lightwave-Server-FQDN* to verify that the client appears under the tenants list for the domain.
0 38
\ No newline at end of file
1 39
new file mode 100644
... ...
@@ -0,0 +1,34 @@
0
+# Installing the Lightwave Server and Configuring It as a Domain Controller on a Photon Image
1
+
2
+You can configure Lightwave server as domain controller on a Photon client. You install the Lightwave server first. After the server is installed, you configure a new domain. 
3
+
4
+## Prerequisites
5
+
6
+- Prepare a Photon OS client for the Lightwave server installation.
7
+- Verify that the hostname of the client can be resolved.
8
+- Verify that you have 500 MB free for the Lightwave server installation.
9
+
10
+## Procedure
11
+
12
+1. Log in to your Photon OS client over SSH as an administrator.
13
+2. Install the Lightwave server by running the following command. 
14
+	
15
+	`# tdnf install lightwave -y`
16
+3. Configure the Lightwave server as domain controller by selecting a domain name and password for the `administrator` user.
17
+	
18
+	The minimum required password complexity is 8 characters, one symbol, one upper case letter, and one lower case letter. 
19
+	Optionally, if you want to access the domain controller over IP, configure the ip under the `--ssl-subject-alt-name` parameter.
20
+	`# configure-lightwave-server --domain <your-domain> --password '<administrator-user-password>' --ssl-subject-alt-name <machine-ip-address>`
21
+4. Edit `iptables` rules to allow connections to and from the client.
22
+
23
+	The default Photon OS 2.0 firewall settings block all incoming, outgoing, and forwards so that you must reconfigure them.
24
+	
25
+	`# iptables -P INPUT ACCEPT`
26
+
27
+	`# iptables -P OUTPUT ACCEPT`
28
+
29
+	`# iptables -P FORWARD ACCEPT`
30
+
31
+5. In a browser, go to https://*lightwave-server-FQDN* to verify that you can log in to the newly created domain controller.
32
+	1. On the Cascade Identity Services page, enter the domain that you configured and click **Take me to Lightwave Admin**.
33
+	2. On the Welcome page, enter administrator@your-domain as user name and the password that you set during the domain controller configuration and click **LOGIN**.
0 34
\ No newline at end of file
1 35
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# Installing and Using Lightwave on Photon OS #
1
+
2
+Project Lightwave is an open-sourced project that provides enterprise-grade identity and access management services, and can be used to solve key security, governance, and compliance challenges for a variety of use cases within the enterprise. Through integration between Photon OS and Project Lightwave, organizations can enforce security and governance on container workloads, for example, by ensuring only authorized containers are run on authorized hosts, by authorized users. For more details about Lightwave, see the [project Lightwave page on GitHub](https://github.com/vmware/lightwave).
3
+
4
+## Procedure
5
+
6
+1. [Installing the Lightwave Server and Configuring It as a Domain Controller on a Photon Image](Installing-Lightwave-Server-and-Setting-Up-a-Domain.md)
7
+2. [Installing the Lightwave Client on a Photon Image and Joining the Client to a Domain](Installing-Lightwave-Client-and-Joining-a-Domain.md)
8
+3. [Installing the Photon Management Daemon on a Lightwave Client](Installing-the-Photon-Management-Daemon-on-a-Lightwave-Client.md)
9
+4. [Remotely Upgrade a Single Photon OS Machine With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-a-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
10
+5. [Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
0 11
new file mode 100644
... ...
@@ -0,0 +1,35 @@
0
+# Installing the Photon Management Daemon on a Lightwave Client 
1
+
2
+After you have installed and configured a domain on Lightwave, and joined a client to the domain, you can install the Photon Management Daemon on that client so that you can remotely manage it.
3
+
4
+## Prerequisites
5
+
6
+- Have an installed Lightwave server with configured domain controller on it.
7
+- Have an installed Lightwave client that is joined to the domain.
8
+- Verify that you have 100 MB free for the daemon installation on the client.
9
+
10
+## Procedure
11
+
12
+1. Log in to a machine with installed Lightwave client over SSH as an administrator.
13
+2. Install the Photon Management Daemon.
14
+	
15
+	`# tdnf install pmd -y`
16
+2. Start the Photon Management Daemon.
17
+	 
18
+	`# systemctl start pmd`
19
+3. Verify that the daemon is in an `active` state.
20
+
21
+	`# systemctl status pmd`
22
+4. (Optional) In a new console, use `curl` to verify that the Photon Management Daemon returns information.
23
+
24
+	Use the root credentials for the local client to authenticate against the daemon service.
25
+	`# curl https://<lightwave-client-FQDN>:2081/v1/info -ku root`
26
+
27
+5. (Optional) Create an administrative user for the Photon Management Daemon for your domain and assign it the domain administrator role.
28
+	1. In a browser, go to https://*lightwave-server-FQDN*.
29
+	1. On the Cascade Identity Services page, enter your domain name and click **Take me to Lightwave Admin**.
30
+	2. On the Welcome page, enter administrative credentials for your domain and click **Login**.
31
+	2. Click **Users & Groups** and click **Add** to create a new user.
32
+	3. On the Add New User page, enter user name, at least one name, password, and click **Save**.
33
+	3. Click the **Groups** tab, select the Administrators group, and click  **Membership**  to add the new user to the group.
34
+	4. On the View Members page, select the user that you created, click **Add Member**, click **Save**, and click **Cancel** to return to the previous page.
0 35
\ No newline at end of file
1 36
new file mode 100644
... ...
@@ -0,0 +1,52 @@
0
+# Introduction
1
+
2
+## 1.1 What is OSTree? How about RPM-OSTree?
3
+
4
+OSTree is a tool to manage bootable, immutable, versioned filesystem trees. Unlike traditional package managers like rpm or dpkg that know how to install, uninstall, configure packages, OSTree has no knowledge of the relationship between files. But when you add rpm capabilities on top of OSTree, it becomes RPM-OSTree, meaning a filetree replication system that is also package-aware.   
5
+The idea behind it is to use a client / server architecture to keep your Linux installed machines (physical or VM) in sync with the latest bits, in a predictable and reliable manner. To achieve that, OSTree uses a git-like repository that records the changes to any file and replicate them to any subscriber.  
6
+A system administrator or an image builder developer takes a base Linux image, prepares the packages and other configuration on a server box, executes a command to compose a filetree that the host machines will download and then incrementally upgrade whenever a new change has been committed.
7
+You may read more about OSTree [here](https://wiki.gnome.org/Projects/OSTree).
8
+
9
+## 1.2 Why use RPM-OSTree in Photon?
10
+There are several important benefits:
11
+* Reliable, efficient: The filetree replication is simple, reliable and efficient. It will only transfer deltas over the network. If you have deployed two almost identical bootable images on same box (differing just by several files), it will not take twice the space. The new tree will have a set of hardlinks to the old tree and only the different files will have a separate copy stored to disk.
12
+* Atomic: the filetree replication is atomic. At the end of a deployment, you are either booting from one deployment, or the other. There is no "partial deployed bootable image". If anything bad happens during replication or deployment- power loss, network failure, your machine boots from the old image. There is even a tool option to cleanup old deployed (successfully or not) image.
13
+* Manageable: You are provided simple tools to figure out exactly what packages have been installed, to compare files, configuration and package changes between versions.
14
+* Predictable, repeatable: A big headache for a system administrator is to maintain a farm of computers with different packages, files and configuration installed in different order, that will result in exponential set of test cases. With RPM-OStree, you get identical, predictable installed systems. 
15
+
16
+As drawbacks, I would mention:
17
+* Some applications configured by user on host may have compatibility issues if they save configuration or download into read only directories like /usr.
18
+* People not used with "read only" file systems will be disappointed that they could no longer use RPM, yum, tdnf to install whatever they want. Think of this as an "enterprise policy". They may circumvent this by customizing the target directory to a writable directory like /var or using rpm to install packages and record them using a new RPM repository in a writable place.
19
+* Administrators need to be aware about the directories re-mapping specific to OSTree and plan accordingly.
20
+
21
+## 1.3 Photon with RPM-OSTree installation profiles
22
+Photon takes advantage of RPM-OSTree and offers several installation choices:
23
+* Photon RPM-OSTree server - used to compose customized Photon OS installations and to prepare updates. I will call it for short 'server'.
24
+* Photon RPM-OSTree host connected to a default online server repository via http or https, maintained by VMware Photon OS team, where future updates will be published. This will create a minimal installation profile, but with the option to self-upgrade. I will call it for short 'default host'.
25
+* Photon RPM-OSTree host connected to a custom server repository. It requires a Photon RPM-OSTree Server installed in advance. I will call it for short 'custom host'.
26
+
27
+## 1.4 Terminology
28
+I use the term "OSTree" (starting with capitals) throughout this document, when I refer to the general use of this technology, the format of the repository or replication protocol. I use "RPM-OSTree" to emphasize the layer that adds RedHat Package Manager compatibility on both ends - at server and at host. However, since Photon OS is an RPM-based Linux, there are places in the documentation and even in the installer menus where "OSTree" may be used instead of "RPM-OSTree" when the distinction is not obvious or doesn't matter in that context.
29
+When "ostree" and "rpm-ostree" (in small letters) are encountered, they refer to the usage of the specific Unix commands.   
30
+
31
+Finally, "Photon RPM-OSTree" is the application or implementation of RPM-OStree system into Photon OS, materialized into two options: Photon Server and Photon Host (or client). "Server" or "Host" may be used with or without the "Photon" and/or "RPM-OStree" qualifier, but it means the same thing. 
32
+
33
+## 1.5 Sample code
34
+Codes samples used throughout the book are small commands that can be typed at shell command prompt and do not require downloading additional files. As an alternative, one can remote via ssh, so cut & paste sample code from outside sources or copy files via scp will work. See the Photon Administration guide to learn [how to enable ssh](photon-admin-guide.md#permitting-root-login-with-ssh). 
35
+The samples assume that the following VMs have been installed - see the steps in the next chapters:
36
+* A default host VM named **photon-host-def**.
37
+* Two server VMs named **photon-srv1** and **photon-srv2**.
38
+* Two custom host VMs named **photon-host-cus1** and **photon-host-cus2**, connected each to the corresponding server during install.
39
+
40
+## 1.6 How to read this book
41
+I've tried to structure this book to be used both as a sequential read and as a reference documentation.   
42
+If you are just interested in deploying a host system and keeping it up to date, then read chapters 2 and 5.   
43
+If you want to install your own server and experiment with customizing packages for your Photon hosts, then read chapters 6 to 9. There are references to the concepts discussed throughout the book, if you need to understand them better.  
44
+However, if you want to read page by page, information is presented from simple to complex, although as with any technical book, we occasionally run into the chicken and egg problem - forward references to concepts that have yet to be explained later. In other cases, concepts are introduced and presented in great detail that may be seem hard to follow at first, but I promise they will make sense in the later pages when you get to use them.
45
+
46
+## 1.7 Difference between versions
47
+This book has been written when Photon 1.0 was released, so all the information presented apply directly to Photon 1.0 and also to Photon 1.0 Revision 2 (in short Photon 1.0 Rev2 or Photon 1.0r, as some people refer to it as Photon 1.0 Refresh). This release is relevant to OSTree, because of ISO including an updated RPM-OSTree repository containing upgraded packages, as well as matching updated online repo that plays well into the upgrade story. Other than that, differences are minimal.  
48
+
49
+The guide has been updated significantly for Photon OS 2.0. Information of what's different is scattered through chapters 2, 6, 7, 8. [Install or rebase to Photon OS 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md) is dedicated to the topic.    
50
+
51
+OSTree technology is evolving too and rather than pointing out at what package version some feature has been introduced or changed, the focus is on the ostree and rpm-ostree package versions included with the Photon OS major releases.
0 52
new file mode 100644
... ...
@@ -0,0 +1,89 @@
0
+# Remotes
1
+
2
+In Chapter 3 we talked about the Refspec that contains a **photon:** prefix, that is the name of a remote. When a Photon host is installed, a remote is added - which contains the URL for an OSTree repository that is the origin of the commits we are going to pull from and deploy filetrees, in our case the Photon RPM-OSTree server we installed the host from. This remote is named **photon**, which may be confusing, because it's also the OS name and part of the Refspec (branch) path.
3
+
4
+## 10.1 Listing remotes
5
+A host repo can be configured to switch between multiple remotes to pull from, however only one remote is the "active" one at a time. We can list the remotes created so far, which brings back the expected result.
6
+```
7
+root@photon-host-def [ ~ ]# ostree remote list
8
+photon
9
+```
10
+We can inquiry about the URL for that remote name, which for the default host is the expected Photon OS online OSTree repo.
11
+```
12
+root@photon-host-def [ ~ ]# ostree remote show-url photon
13
+https://dl.bintray.com/vmware/photon/rpm-ostree/1.0
14
+```
15
+But where is this information stored? The repo's config file has it.
16
+```
17
+root@photon-host-def [ ~ ]# cat /ostree/repo/config 
18
+[core]
19
+repo_version=1
20
+mode=bare
21
+
22
+[remote "photon"]
23
+url=https://dl.bintray.com/vmware/photon/rpm-ostree/1.0
24
+gpg-verify=false
25
+```
26
+
27
+If same command is executed on the custom host we've installed, it's going to reveal the URL of the Photon RPM-OSTree server connected to during setup.
28
+```
29
+root@photon-host-cus [ ~ ]# ostree remote show-url photon
30
+http://10.118.101.168
31
+```
32
+
33
+## 10.2 GPG signature verification
34
+You may wonder what is the purpose of ```gpg-verify=false``` in the config file, associated with the specific remote. This will instruct any host update to skip the signing verification for the updates that come from server, resulted from tree composed locally at the server, as they are not signed. Without this, host updating will fail.  
35
+
36
+There is a whole chapter about signing, importing keys and so on that I will not get into, but the idea is that signing adds an extra layer of security, by validating that everything you download comes from the trusted publisher and has not been altered. That is the case for all Photon OS artifacts downloaded from VMware official site. All OVAs and packages, either from the online RPMS repositories or included in the ISO file - are signed by VMware. We've seen a similar setting ```gpgcheck=1``` in the RPMS repo configuration files that tdnf uses to validate or not the signature for all packages downloaded to be installed.
37
+
38
+
39
+## 10.3 Switching repositories
40
+Since mapping name/url is stored in the repo's config file, in principle you can re-assign a different URL, connecting the host to a different server. The next upgrade will get the latest commit chain from the new server.   
41
+If we edit photon-host-def's repo config and replace the bintray URL by photon-srv1's IP address, all original packages in the original 1.0_minimal version will be preserved, but any new package change (addition, removal, upgrade) added after that (in 1.0_minimal.1, 1.0_minimal.2) will be reverted and all new commits from photon-srv1 (that may have same version) will be applied. This is because the two repos are identical copies, so they have the same original commit ID as a common ancestor, but they diverge from there.  
42
+This may create confusion and it's one of the reasons I insisted on creating your own scheme of versioning.
43
+  
44
+If the old and new repo have nothing in common (no common ancestor commit), this will undo even the original commit, so all commits from the new tree will be applied.  
45
+A better solution would be to add a new remote that will identify where the commits come from.
46
+
47
+## 10.4 Adding and removing remotes
48
+
49
+A cleaner way to switch repositories is to add remotes that point to different servers. Let's add another server that we will refer to as **photon2**, along with (optional) the refspecs for branches that it provides (we will see later that in the newer OSTree versions, we don't need to know the branch names, they could be [queried at run-time](Photon-RPM-OSTree-10-Remotes.md#105-listing-available-branches)). The 'minimal' and 'full' branch ref names containing '2.0' suggest this may be a Photon OS 2.0 RPM-OSTree server. 
50
+```
51
+root@photon-host-cus [ ~ ]# ostree remote add --repo=/ostree/repo -v --no-gpg-verify photon2 http://10.118.101.86 photon/2.0/x86_64/minimal photon/2.0/x86_64/full
52
+root@photon-host-cus [ ~ ]# ostree remote list
53
+photon
54
+photon2
55
+root@photon-host-cus [ ~ ]# ostree remote show-url photon2
56
+http://10.118.101.86
57
+```
58
+Where is this information stored? There is an extra config file created per each remote:
59
+```
60
+root@photon-host-cus [ ~ ]# cat /etc/ostree/remotes.d/photon2.conf 
61
+[remote "photon2"]
62
+url=http://10.118.101.86
63
+branches=photon/2.0/x86_64/minimal;photon/2.0/x86_64/full;
64
+gpg-verify=false
65
+```
66
+You may have guessed what is the effect of ```--no-gpg-verify option```.  
67
+Obviously, remotes could also be deleted.
68
+```
69
+root@photon-host-cus [ ~ ]# ostree remote delete photon2
70
+root@photon-host-cus [ ~ ]# ostree remote list
71
+photon
72
+```
73
+
74
+## 10.5 List available branches
75
+If a host has been deployed from a specific branch and would like to switch to a different one, maybe from a different server, how would it know what branches are available? In git, you would run ```git remote show origin``` or ```git remote -a``` (although last command would not show all branches, unless you ran ```git fetch``` first).  
76
+
77
+Fortunately, in Photon OS 2.0 and higher, the hosts are able to query the server, if summary metadata has been generated, as we've seen in [8.5](Photon-RPM-OSTree:-8-File-oriented-server-operations.md#85-creating-summary-metadata).  This command lists all branches available for remote **photon2**.
78
+
79
+```
80
+root@photon-host-cus [ ~ ]# ostree remote refs photon2 
81
+photon2:photon/2.0/x86_64/base
82
+photon2:photon/2.0/x86_64/full
83
+photon2:photon/2.0/x86_64/minimal
84
+```
85
+
86
+###10.6 Switching branches (rebasing)
87
+
88
+
0 89
new file mode 100644
... ...
@@ -0,0 +1,211 @@
0
+# Running container applications between bootable images
1
+
2
+In this chapter, we want to test a docker application and make sure that all the settings and downloads done in one bootable filetree are going to be saved into writable folders and be available in the other image, in other words after reboot from the other image, everything is available exactly the same way.   
3
+We are going to do this twice: first, to verify an existing bootable image installed in parallel and then create a new one.
4
+
5
+## 11.1 Downloading a docker container appliance
6
+Photon OS comes with docker package installed and configured, but we expect that the docker daemon is inactive (not started). Configuration file /usr/lib/systemd/system/docker.service is read-only (remember /usr is bound as read-only). 
7
+```
8
+root@sample-host-def [ ~ ]# systemctl status docker
9
+* docker.service - Docker Daemon
10
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
11
+   Active: inactive (dead)
12
+
13
+root@sample-host-def [ ~ ]# cat /usr/lib/systemd/system/docker.service
14
+[Unit]
15
+Description=Docker Daemon
16
+Wants=network-online.target
17
+After=network-online.target
18
+
19
+[Service]
20
+ExecStart=/bin/docker -d -s overlay
21
+ExecReload=/bin/kill -HUP $MAINPID
22
+KillMode=process
23
+Restart=always
24
+MountFlags=slave
25
+LimitNOFILE=1048576
26
+LimitNPROC=1048576
27
+LimitCORE=infinity
28
+
29
+[Install]
30
+WantedBy=multi-user.target
31
+```
32
+Now let's enable docker daemon to start at boot time - this will create a symbolic link into writable folder /etc/systemd/system/multi-user.target.wants to its systemd configuration, as with all other systemd controlled services. 
33
+```
34
+root@sample-host-def [ ~ ]# systemctl enable docker
35
+Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
36
+
37
+root@sample-host-def [ ~ ]# ls -l /etc/systemd/system/multi-user.target.wants
38
+total 0
39
+lrwxrwxrwx 1 root root 38 Sep  6 08:38 docker.service -> /usr/lib/systemd/system/docker.service
40
+lrwxrwxrwx 1 root root 47 Aug 28 20:21 iptables.service -> ../../../../lib/systemd/system/iptables.service
41
+lrwxrwxrwx 1 root root 47 Aug 28 20:21 remote-fs.target -> ../../../../lib/systemd/system/remote-fs.target
42
+lrwxrwxrwx 1 root root 50 Aug 28 20:21 sshd-keygen.service -> ../../../../lib/systemd/system/sshd-keygen.service
43
+lrwxrwxrwx 1 root root 43 Aug 28 20:21 sshd.service -> ../../../../lib/systemd/system/sshd.service
44
+lrwxrwxrwx 1 root root 55 Aug 28 20:21 systemd-networkd.service -> ../../../../lib/systemd/system/systemd-networkd.service
45
+lrwxrwxrwx 1 root root 55 Aug 28 20:21 systemd-resolved.service -> ../../../../lib/systemd/system/systemd-resolved.service
46
+```
47
+To verify that the symbolic link points to a file in a read-only directory, try to make a change in this file using vim and save. you'll get an error: "/usr/lib/systemd/system/docker.service" E166: Can't open linked file for writing".  
48
+Finally, let's start the daemon, check again that is active. 
49
+```
50
+root@sample-host-def [ ~ ]# systemctl start docker
51
+
52
+root@sample-host-def [ ~ ]# systemctl status -l docker
53
+* docker.service - Docker Daemon
54
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
55
+   Active: active (running) since Sun 2015-09-06 08:56:30 UTC; 42s ago
56
+ Main PID: 349 (docker)
57
+   CGroup: /system.slice/docker.service
58
+           `-349 /bin/docker -d -s overlay
59
+
60
+Sep 06 08:56:30 sample-host-def docker[349]: Warning: '-d' is deprecated, it will be removed soon. See usage.
61
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30Z" level=warning msg="please use 'docker daemon' instead."
62
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.617969465Z" level=info msg="Option DefaultDriver: bridge"
63
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.618264109Z" level=info msg="Option DefaultNetwork: bridge"
64
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.632397533Z" level=info msg="Listening for HTTP on unix (/var/run/docker.sock)"
65
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.637516253Z" level=info msg="Firewalld running: false"
66
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.786748372Z" level=info msg="Loading containers: start."
67
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.787252697Z" level=info msg="Loading containers: done."
68
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.787410576Z" level=info msg="Daemon has completed initialization"
69
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.787610148Z" level=info msg="Docker daemon" commit=d12ea79 execdriver=native-0.2 graphdriver=overlay version=1.8.1
70
+```
71
+We'll ask docker to run Ubuntu Linux in a container. Since it's not present locally, it's going to be downloaded first from the official docker repository https://hub.docker.com/_/ubuntu/.
72
+```
73
+root@sample-host-def [ ~ ]# docker ps -a
74
+CONTAINER ID        IMAGE            COMMAND      CREATED           STATUS              PORTS       NAMES
75
+
76
+root@sample-host-def [ ~ ]# docker run -it ubuntu
77
+Unable to find image 'ubuntu:latest' locally
78
+latest: Pulling from library/ubuntu
79
+d3a1f33e8a5a: Downloading [=========================================>         ] 54.55 MB/65.79 MB
80
+c22013c84729: Download complete 
81
+d74508fb6632: Download complete 
82
+91e54dfb1179: Download complete 
83
+```
84
+When downloading is complete, it comes to Ubuntu root prompt with assigned host name d07ebca78051, that is actually the Container ID. Let's verify it's indeed the expected OS.
85
+```
86
+root@sample-host-def [ ~ ]# docker run -it ubuntu
87
+Unable to find image 'ubuntu:latest' locally
88
+latest: Pulling from library/ubuntu
89
+d3a1f33e8a5a: Pull complete 
90
+c22013c84729: Pull complete 
91
+d74508fb6632: Pull complete 
92
+91e54dfb1179: Already exists 
93
+library/ubuntu:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
94
+Digest: sha256:fde8a8814702c18bb1f39b3bd91a2f82a8e428b1b4e39d1963c5d14418da8fba
95
+Status: Downloaded newer image for ubuntu:latest
96
+
97
+root@d07ebca78051:/# cat /etc/os-release
98
+NAME="Ubuntu"
99
+VERSION="14.04.3 LTS, Trusty Tahr"
100
+ID=ubuntu
101
+ID_LIKE=debian
102
+PRETTY_NAME="Ubuntu 14.04.3 LTS"
103
+VERSION_ID="14.04"
104
+HOME_URL="http://www.ubuntu.com/"
105
+SUPPORT_URL="http://help.ubuntu.com/"
106
+BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
107
+root@d07ebca78051:/#
108
+```
109
+Now let's write a file into Ubuntu home directory
110
+```
111
+echo "Ubuntu file" > /home/myfile
112
+root@d07ebca78051:/home# cat /home/myfile
113
+Ubuntu file
114
+```
115
+We'll exit back to the Photon prompt and if it's stopped, we will re-start it.
116
+```
117
+root@d07ebca78051:/# exit
118
+exit
119
+
120
+root@sample-host-def [ ~ ]# docker ps -a
121
+CONTAINER ID    IMAGE   COMMAND       CREATED         STATUS                      PORTS   NAMES
122
+d07ebca78051    ubuntu  "/bin/bash"   3 minutes ago   Exited (0) 13 seconds ago           kickass_hodgkin
123
+
124
+root@photon-host-cus1 [ ~ ]# docker start  d07ebca78051
125
+d07ebca78051
126
+
127
+root@photon-host-cus1 [ ~ ]# docker ps -a
128
+CONTAINER ID    IMAGE   COMMAND       CREATED         STATUS                      PORTS   NAMES
129
+d07ebca78051    ubuntu  "/bin/bash"   16 minutes ago  Up 5 seconds                        kickass_hodgkin
130
+```
131
+
132
+## 11.2 Rebooting into an existing image
133
+Now let's reboot the machine and select the other image. First, we'll verify that the docker daemon is automaically started.
134
+```
135
+root@photon-host-cus1 [ ~ ]# systemctl status docker
136
+* docker.service - Docker Daemon
137
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
138
+   Active: active (running) since Sun 2015-09-06 11:19:05 UTC; 2min 9s ago
139
+ Main PID: 292 (docker)
140
+   CGroup: /system.slice/docker.service
141
+           `-292 /bin/docker -d -s overlay
142
+   ...
143
+```
144
+Next, is the Ubuntu OS container still there?
145
+```
146
+root@photon-host-cus1 [ ~ ]# docker ps -a 
147
+CONTAINER ID    IMAGE     COMMAND      CREATED          STATUS                     PORTS   NAMES
148
+57dcac5d0490    ubuntu    "/bin/bash"  25 minutes ago   Exited (137) 5 minutes ago         sad_banach
149
+```
150
+It is, so let's start it, attach and verify that our file is persisted, then add another line to it and save, exit.
151
+```
152
+root@photon-host-cus1 [ ~ ]# docker start -i  57dcac5d0490
153
+root@57dcac5d0490:/# cat /home/myfile 
154
+Ubuntu file
155
+root@57dcac5d0490:/# echo "booted into existing image" >> /home/myfile
156
+root@57dcac5d0490:/# exit
157
+```
158
+## 11.3 Reboot into a newly created image
159
+Let's upgrade and replace the .0 image by a .3 build that contains git and also perl_YAML (because it is a dependency of git).
160
+```
161
+root@photon-host-cus1 [ ~ ]# rpm-ostree status
162
+  TIMESTAMP (UTC)         VERSION               ID             OSNAME     REFSPEC                              
163
+* 2015-09-04 00:36:37     1.0_tp2_minimal.2     092e21d292     photon     photon:photon/tp2/x86_64/minimal     
164
+  2015-08-20 22:27:43     1.0_tp2_minimal       2940e10c4d     photon     photon:photon/tp2/x86_64/minimal     
165
+
166
+root@photon-host-cus1 [ ~ ]# rpm-ostree upgrade
167
+Updating from: photon:photon/tp2/x86_64/minimal
168
+
169
+43 metadata, 209 content objects fetched; 19992 KiB transferred in 0 seconds
170
+Copying /etc changes: 5 modified, 0 removed, 19 added
171
+Transaction complete; bootconfig swap: yes deployment count change: 0
172
+Freed objects: 16.2 MB
173
+Added:
174
+  git-2.1.2-1.ph1tp2.x86_64
175
+  perl-YAML-1.14-1.ph1tp2.noarch
176
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot
177
+
178
+root@photon-host-cus1 [ ~ ]# rpm-ostree status
179
+  TIMESTAMP (UTC)         VERSION               ID             OSNAME     REFSPEC                              
180
+  2015-09-06 18:12:08     1.0_tp2_minimal.3     d16aebd803     photon     photon:photon/tp2/x86_64/minimal     
181
+* 2015-09-04 00:36:37     1.0_tp2_minimal.2     092e21d292     photon     photon:photon/tp2/x86_64/minimal  
182
+```
183
+After reboot from 1.0_tp2_minimal.3 build, let's check that the 3-way /etc merge succeeded as expected. The docker.service slink is still there, and docker demon restarted at boot.
184
+```
185
+root@photon-host-cus1 [ ~ ]# ls -l /etc/systemd/system/multi-user.target.wants/docker.service 
186
+lrwxrwxrwx 1 root root 38 Sep  6 12:50 /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service
187
+
188
+root@photon-host-cus1 [ ~ ]# systemctl status docker
189
+* docker.service - Docker Daemon
190
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
191
+   Active: active (running) since Sun 2015-09-06 12:56:33 UTC; 1min 27s ago
192
+ Main PID: 292 (docker)
193
+   CGroup: /system.slice/docker.service
194
+           `-292 /bin/docker -d -s overlay
195
+
196
+   ...   
197
+```  
198
+Let's revisit the Ubuntu container. Is the container still there? is myfile persisted?
199
+```
200
+root@photon-host-cus1 [ ~ ]# docker ps -a
201
+CONTAINER ID   IMAGE       COMMAND      CREATED       STATUS                        PORTS   NAMES
202
+57dcac5d0490   ubuntu      "/bin/bash"  2 hours ago   Exited (0) About an hour ago          sad_banach
203
+
204
+root@photon-host-cus1 [ ~ ]# docker start 57dcac5d0490
205
+
206
+root@57dcac5d0490:/# cat /home/myfile
207
+Ubuntu file
208
+booted into existing image
209
+root@57dcac5d0490:/# echo "booted into new image" >> /home/myfile
210
+```
0 211
new file mode 100644
... ...
@@ -0,0 +1,38 @@
0
+# Installing a host against default server repository
1
+
2
+RPM-OSTree Host default server repo installation option in Photon 1.0 or 1.0 Revision 2 will setup a profile similar to Photon Minimal, with the added benefit of being able to self-upgrade.  
3
+Photon OS 2.0 does not offer a 'default host' installation. See chapter 7 and 12 for other options. 
4
+
5
+## 2.1 Who is this for?  
6
+The RPM-OSTree 'default host' is the easiest way to deploy a Photon RPM-OSTree host from ISO/cdrom, without the need to deploy and maintain an RPM-OSTree server. It is targeted at the user who relies on VMware Photon OS team to keep his or her system up-to-date, configured to get its updates from the official Photon 1.0 OSTree repository.
7
+
8
+This is also the fastest way to install a host (18 seconds on my Mac with SSD after all UI choices have been entered by user), as we've included in the ISO/cdrom an identical copy of the Photon 1.0 "starter" RPM-OSTree repository that is published online by VMware Photon OS team. So rather than pulling from the online repository, the installer pulls the repo from cdrom, which saves bandwidth and also reduces to zero the chances of failing due to a networking problem. After successful installation, any updates are going to be pulled from the official online repository, when Photon OS team will make them available.    
9
+
10
+Note: It is also possible to install an RPM-OSTree host against the official online repo via PXE boot, without the benefit of fast, local pull from cdrom. This will be covered in the PXE boot/kickstart chapter, as it requires additional configuration.
11
+
12
+## 2.2 Installing the ISO, step by step
13
+User will first download [Photon 1.0 ISO file](https://bintray.com/artifact/download/vmware/photon/photon-1.0-13c08b6.iso) or the newer [Photon 1.0 Rev2 ISO file](https://bintray.com/artifact/download/vmware/photon/photon-1.0-62c543d.iso) that contains the installer, which is able to deploy any of the supported Photon installation profiles.
14
+
15
+There are some steps common to all Photon installation profiles, starting with adding a VM in VMware Fusion, Workstation or ESXi, selecting the OS family, then customizing for disk size, CPU, memory size, network interface etc. (or leaving the defaults) and selecting the ISO image as cdrom. The installer will launch, that will go through disk partitioning and accepting the license agreement screens, followed by selecting an installation profile.
16
+These steps are described at the page linked below, so I won't repeat them, just that instead of setting up a Photon Minimal profile, we will install a Photon OSTree host:   
17
+
18
+[Running Project Photon on Fusion](Running-Project-Photon-on-Fusion.md).  
19
+
20
+Select the **Photon OSTree Host** option.
21
+
22
+![PhotonChooseHost](https://cloud.githubusercontent.com/assets/13158414/14757883/15742dce-08ad-11e6-9486-4fe08b4bf7f2.png)  
23
+
24
+Continue with setting up a host name like **photon1-def** and a root password, re-confirm.   
25
+Then, select "Default OSTree Server" and continue.  
26
+
27
+![PhotonChooseHostDefault](https://cloud.githubusercontent.com/assets/13158414/14757878/1557500a-08ad-11e6-9cb7-f917cb0fdaca.png)
28
+
29
+![PhotonHostDefaultFinish](https://cloud.githubusercontent.com/assets/13158414/14757882/1571cde0-08ad-11e6-8e07-47258ca4e8d9.png)  
30
+
31
+When installation is over, the VM will reboot and will show in grub VMWare Photon/Linux 1.0_minimal (ostree), which will reassure that it's booting from an OSTree image!  
32
+
33
+![PhotonHostFirstRebootGrub](https://cloud.githubusercontent.com/assets/13158414/14757877/155614ec-08ad-11e6-9e36-b43f77b6fb69.png)  
34
+
35
+Boot, login and you are ready to use it!  The next chapters are about experimenting first hand and understanding in detail how everything works. If you just want to learn how to [upgrade your host](Photon-RPM-OSTree-5-Host-updating-operations.md) when new updates are available, skip to [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md).
36
+
37
+Note: If you ran Photon 1.0 Rev2 installer rather than Photon 1.0, you may notice in grub **1.0_minimal.1** rather than **1.0_minimal**, hinting of an updated, newer version installed. This will be also explained in [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md).  
0 38
new file mode 100644
... ...
@@ -0,0 +1,256 @@
0
+# Querying For Commit File and Package Metadata
1
+
2
+There are several ostree and rpm-ostree commands that list file or package data based on either the Commit ID, or Refspec. If Refspec is passed as a parameter, it's the same as passing the most recent commit ID (head) for that branch.
3
+
4
+## 4.1 Commit history
5
+For a host that is freshly installed, there is only one commit in the history for the only branch.
6
+```
7
+root@photon-host [ ~ ]# ostree log photon/1.0/x86_64/minimal
8
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
9
+Date:  2016-06-07 14:06:17 +0000
10
+Version: 1.0_minimal
11
+```
12
+This commit has no parent; if there was an older commit, it would have been listed too. We can get the same listing (either nicely formatted or raw variant data) by passing the Commit ID. Just the first several hex digits will suffice to identify the commit ID. We can either request to be displayed in a pretty format, or raw - the actual C struct.
13
+```
14
+root@photon-host [ ~ ]# ostree log 56ef
15
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
16
+Date:  2016-06-07 14:06:17 +0000
17
+Version: 1.0_minimal
18
+```
19
+```
20
+root@photon-host [ ~ ]# ostree log 56ef --raw
21
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
22
+({'version': <'1.0_minimal'>, 'rpmostree.inputhash': <'40ae75453cf7f00b163848676c4b5716511e7515b95fb7b9168004aa97f05dd9'>}, @ay [], @a(say) [], '', '', uint64 1465308377, [byte 0x3c, 0x6b, 0x71, 0x44, 0x07, 0xd0, 0x5e, 0xd5, 0x9d, 0xfc, 0x4a, 0x1c, 0x33, 0x74, 0x96, 0x1d, 0x50, 0xa3, 0x53, 0xd5, 0xf1, 0x20, 0xb4, 0x40, 0xd0, 0x60, 0x35, 0xf2, 0xf8, 0x29, 0xcf, 0x5f], [byte 0x44, 0x6a, 0x0e, 0xf1, 0x1b, 0x7c, 0xc1, 0x67, 0xf3, 0xb6, 0x03, 0xe5, 0x85, 0xc7, 0xee, 0xee, 0xb6, 0x75, 0xfa, 0xa4, 0x12, 0xd5, 0xec, 0x73, 0xf6, 0x29, 0x88, 0xeb, 0x0b, 0x6c, 0x54, 0x88])
23
+```
24
+
25
+## 4.2 Listing file mappings
26
+This command lists the file relations between the original source Linux Photon filetree and the deployed filetree. The normal columns include file type type (regular file, directory, link), permissions in chmod octal format, userID, groupID, file size, file name. 
27
+```
28
+root@photon-host [ ~ ]# ostree ls photon/1.0/x86_64/minimal
29
+d00755 0 0      0 /
30
+l00777 0 0      0 /bin -> usr/bin
31
+l00777 0 0      0 /home -> var/home
32
+l00777 0 0      0 /lib -> usr/lib
33
+l00777 0 0      0 /lib64 -> usr/lib
34
+l00777 0 0      0 /media -> run/media
35
+l00777 0 0      0 /mnt -> var/mnt
36
+l00777 0 0      0 /opt -> var/opt
37
+l00777 0 0      0 /ostree -> sysroot/ostree
38
+l00777 0 0      0 /root -> var/roothome
39
+l00777 0 0      0 /sbin -> usr/sbin
40
+l00777 0 0      0 /srv -> var/srv
41
+l00777 0 0      0 /tmp -> sysroot/tmp
42
+d00755 0 0      0 /boot
43
+d00755 0 0      0 /dev
44
+d00755 0 0      0 /proc
45
+d00755 0 0      0 /run
46
+d00755 0 0      0 /sys
47
+d00755 0 0      0 /sysroot
48
+d00755 0 0      0 /usr
49
+d00755 0 0      0 /var
50
+```
51
+Extra columns can be added like checksum (-C) and extended attributes (-X). 
52
+```
53
+root@photon-host [ /usr/share/man/man1 ]# ostree ls photon/1.0/x86_64/minimal -C
54
+d00755 0 0      0 3c6b714407d05ed59dfc4a1c3374961d50a353d5f120b440d06035f2f829cf5f 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /
55
+l00777 0 0      0 389846c2702216e1367c8dfb68326a6b93ccf5703c89c93979052a9bf359608e /bin -> usr/bin
56
+l00777 0 0      0 4344c10bf4931483f918496534f12ed9b50dc6a2cead35e3cd9dd898d6ac9414 /home -> var/home
57
+l00777 0 0      0 f11902ca9d69a80df33918534a3e443251fd0aa7f94b76301e1f55e52aed29dd /lib -> usr/lib
58
+l00777 0 0      0 f11902ca9d69a80df33918534a3e443251fd0aa7f94b76301e1f55e52aed29dd /lib64 -> usr/lib
59
+l00777 0 0      0 75317a3df11447c470ffdd63dde045450ca97dfb2a97a0f3f6a21a5da66f737c /media -> run/media
60
+l00777 0 0      0 97c55dbe24e8f3aecfd3f3e5b3f44646fccbb39799807d37a217e9c871da108b /mnt -> var/mnt
61
+l00777 0 0      0 46b1abbd27a846a9257a8d8c9fc4b384ac0888bdb8ac0d6a2d5de72715bd5092 /opt -> var/opt
62
+l00777 0 0      0 d37269e3f46023fd0275212473e07011894cdf4148cbf3fb5758a7e9471dad8e /ostree -> sysroot/ostree
63
+l00777 0 0      0 6f800e74eed172661278d1e1f09e389a6504dcd3358618e1c1618f91f9d33601 /root -> var/roothome
64
+l00777 0 0      0 e0bead7be9323b06bea05cb9b66eb151839989e3a4e5d1a93e09a36919e91818 /sbin -> usr/sbin
65
+l00777 0 0      0 5d4250bba1ed300f793fa9769474351ee5cebd71e8339078af7ebfbe6256d9b5 /srv -> var/srv
66
+l00777 0 0      0 364fbd62f91ca1e06eb7dbd50c93de8976f2cea633658e2dbe803ce6f7490c09 /tmp -> sysroot/tmp
67
+d00755 0 0      0 1e4f98d92b35c453d8f61e668aea9fae7ca1863f6609db787374b4ad5caf3b2f 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /boot
68
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /dev
69
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /proc
70
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /run
71
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /sys
72
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /sysroot
73
+d00755 0 0      0 b072f4b3e995a491c04d88636401ca156e80f103b002d724ae76c07174ee4c74 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /usr
74
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /var
75
+```
76
+
77
+By default, only the top folders are listed, but -R will list recursively. Instead of listing over 10,000 files, let's filter to just all files that contain 'rpm-ostree', 'rpmostree' or 'RpmOstree', that must belong to **rpm-ostree** package itself.
78
+```
79
+root@photon-host [ /usr/share/rpm-ostree ]# ostree ls photon/1.0/x86_64/minimal -R | grep -e '[Rr]pm-\?[Oo]stree'
80
+l00777 0 0      0 /usr/bin/atomic -> rpm-ostree
81
+-00755 0 0 131104 /usr/bin/rpm-ostree
82
+l00777 0 0      0 /usr/lib/librpmostree-1.so.1 -> librpmostree-1.so.1.0.0
83
+-00755 0 0 104272 /usr/lib/librpmostree-1.so.1.0.0
84
+-00644 0 0   1296 /usr/lib/girepository-1.0/RpmOstree-1.0.typelib
85
+d00755 0 0      0 /usr/lib/rpm-ostree
86
+-00644 0 0    622 /usr/lib/rpm-ostree/tmpfiles-ostree-integration.conf
87
+-00644 0 0    717 /usr/lib/tmpfiles.d/rpm-ostree-autovar.conf
88
+d00755 0 0      0 /usr/share/rpm-ostree
89
+-00644 0 0   1132 /usr/share/rpm-ostree/treefile.json
90
+```
91
+
92
+**atomic** is really an alias for rpm-ostree command. The last file **treefile.json** is not installed by the rpm-ostree package, it's actually downloaded from the server, as we will see in the next chapter. For now, let's notice **"osname" : "photon",  "ref" : "photon/1.0/x86_64/minimal",  "automatic_version_prefix" : "1.0_minimal"**, that matches what we've known so far, and also the **"documentation" : false** setting, that explains why there are no manual files installed for rpm-ostree, and in fact for any package.
93
+```
94
+root@photon-host [ /usr/share/rpm-ostree ]# ls -l /usr/share/man/man1 
95
+total 0
96
+```
97
+
98
+
99
+## 4.3 Listing configuration changes
100
+
101
+To diff the current /etc configuration versus default /etc (from the base image), this command will show the **M**odified, **A**dded and **D**eleted files:
102
+```
103
+root@photon-host [ ~ ]# ostree admin config-diff
104
+M    mtab
105
+M    ssh/sshd_config
106
+M    shadow
107
+M    hosts
108
+M    fstab
109
+M    machine-id
110
+A    ssh/ssh_host_rsa_key
111
+A    ssh/ssh_host_rsa_key.pub
112
+A    ssh/ssh_host_dsa_key
113
+A    ssh/ssh_host_dsa_key.pub
114
+A    ssh/ssh_host_ecdsa_key
115
+A    ssh/ssh_host_ecdsa_key.pub
116
+A    ssh/ssh_host_ed25519_key
117
+A    ssh/ssh_host_ed25519_key.pub
118
+A    ssh/sshd.pid
119
+A    tmpfiles.d/postinstall.sh
120
+A    udev/hwdb.bin
121
+A    resolv.conf
122
+A    hostname
123
+A    postinstall
124
+A    localtime
125
+A    .updated
126
+```
127
+
128
+## 4.4 Listing packages
129
+As expected, there is an rpm-ostree command that lists all the packages for that branch, extracted from RPM database.   
130
+```
131
+root@photon-host [ ~ ]# rpm-ostree db list photon/1.0/x86_64/minimal
132
+ostree commit: photon/1.0/x86_64/minimal (56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4)
133
+ Linux-PAM-1.2.1-3.ph1.x86_64
134
+ attr-2.4.47-3.ph1.x86_64
135
+ autogen-libopts-5.18.7-2.ph1.x86_64
136
+ bash-4.3.30-4.ph1.x86_64
137
+ bc-1.06.95-3.ph1.x86_64
138
+ binutils-2.25.1-2.ph1.x86_64
139
+ bridge-utils-1.5-2.ph1.x86_64
140
+ bzip2-1.0.6-5.ph1.x86_64
141
+ ca-certificates-20160109-5.ph1.x86_64
142
+ coreutils-8.25-2.ph1.x86_64
143
+ cpio-2.12-2.ph1.x86_64
144
+ cracklib-2.9.6-2.ph1.x86_64
145
+ cracklib-dicts-2.9.6-2.ph1.x86_64
146
+ curl-7.47.1-2.ph1.x86_64
147
+ db-6.1.26-2.ph1.x86_64
148
+ dbus-1.8.8-5.ph1.x86_64
149
+ device-mapper-2.02.141-5.ph1.x86_64
150
+ device-mapper-libs-2.02.141-5.ph1.x86_64
151
+ docker-1.11.0-5.ph1.x86_64
152
+ dracut-044-3.ph1.x86_64
153
+ dracut-tools-044-3.ph1.x86_64
154
+ e2fsprogs-1.42.13-2.ph1.x86_64
155
+ elfutils-libelf-0.165-2.ph1.x86_64
156
+ expat-2.1.0-2.ph1.x86_64
157
+ file-5.24-2.ph1.x86_64
158
+ filesystem-1.0-7.ph1.x86_64
159
+ findutils-4.6.0-2.ph1.x86_64
160
+ flex-2.5.39-2.ph1.x86_64
161
+ gdbm-1.11-2.ph1.x86_64
162
+ glib-2.47.6-2.ph1.x86_64
163
+ glib-networking-2.46.1-2.ph1.x86_64
164
+ glibc-2.22-8.ph1.x86_64
165
+ gmp-6.0.0a-3.ph1.x86_64
166
+ gnutls-3.4.11-2.ph1.x86_64
167
+ gobject-introspection-1.46.0-2.ph1.x86_64
168
+ gpgme-1.6.0-2.ph1.x86_64
169
+ grep-2.21-2.ph1.x86_64
170
+ grub2-2.02-4.ph1.x86_64
171
+ gzip-1.6-2.ph1.x86_64
172
+ hawkey-2014.1-4.ph1.x86_64
173
+ iana-etc-2.30-2.ph1.noarch
174
+ iproute2-4.2.0-2.ph1.x86_64
175
+ iptables-1.6.0-4.ph1.x86_64
176
+ iputils-20151218-3.ph1.x86_64
177
+ json-glib-1.0.4-2.ph1.x86_64
178
+ kmod-21-4.ph1.x86_64
179
+ krb5-1.14-4.ph1.x86_64
180
+ libarchive-3.1.2-6.ph1.x86_64
181
+ libassuan-2.4.2-2.ph1.x86_64
182
+ libcap-2.25-2.ph1.x86_64
183
+ libffi-3.2.1-2.ph1.x86_64
184
+ libgcc-5.3.0-3.ph1.x86_64
185
+ libgcrypt-1.6.5-2.ph1.x86_64
186
+ libgomp-5.3.0-3.ph1.x86_64
187
+ libgpg-error-1.21-2.ph1.x86_64
188
+ libgsystem-2015.1-2.ph1.x86_64
189
+ libhif-0.2.2-2.ph1.x86_64
190
+ librepo-1.7.17-2.ph1.x86_64
191
+ libselinux-2.5-2.ph1.x86_64
192
+ libsepol-2.5-2.ph1.x86_64
193
+ libsolv-0.6.19-2.ph1.x86_64
194
+ libsoup-2.53.90-2.ph1.x86_64
195
+ libstdc++-5.3.0-3.ph1.x86_64
196
+ libtasn1-4.7-2.ph1.x86_64
197
+ libtool-2.4.6-2.ph1.x86_64
198
+ libxml2-2.9.4-1.ph1.x86_64
199
+ linux-4.4.8-6.ph1.x86_64
200
+ lua-5.3.2-2.ph1.x86_64
201
+ m4-1.4.17-2.ph1.x86_64
202
+ mkinitcpio-19-2.ph1.x86_64
203
+ mpfr-3.1.3-2.ph1.x86_64
204
+ ncurses-6.0-2.ph1.x86_64
205
+ net-tools-1.60-7.ph1.x86_64
206
+ nettle-3.2-2.ph1.x86_64
207
+ nspr-4.12-2.ph1.x86_64
208
+ nss-3.21-2.ph1.x86_64
209
+ nss-altfiles-2.19.1-2.ph1.x86_64
210
+ openssh-7.1p2-3.ph1.x86_64
211
+ openssl-1.0.2h-2.ph1.x86_64
212
+ ostree-2015.7-5.ph1.x86_64
213
+ pcre-8.38-3.ph1.x86_64
214
+ photon-release-1.0-5.ph1.noarch
215
+ pkg-config-0.28-2.ph1.x86_64
216
+ popt-1.16-2.ph1.x86_64
217
+ procps-ng-3.3.11-2.ph1.x86_64
218
+ python2-2.7.11-4.ph1.x86_64
219
+ python2-libs-2.7.11-4.ph1.x86_64
220
+ readline-6.3-4.ph1.x86_64
221
+ rpm-4.11.2-10.ph1.x86_64
222
+ rpm-ostree-2015.7-2.ph1.x86_64
223
+ sed-4.2.2-2.ph1.x86_64
224
+ shadow-4.2.1-7.ph1.x86_64
225
+ sqlite-autoconf-3.11.0-2.ph1.x86_64
226
+ systemd-228-21.ph1.x86_64
227
+ tcsh-6.19.00-4.ph1.x86_64
228
+ util-linux-2.27.1-2.ph1.x86_64
229
+ vim-7.4-5.ph1.x86_64
230
+ which-2.21-2.ph1.x86_64
231
+ xz-5.2.2-2.ph1.x86_64
232
+ zlib-1.2.8-3.ph1.x86_64
233
+```
234
+
235
+## 4.5 Querying for package details
236
+We are able to use the query option of rpm to make sure any package have been installed properly. The files list should match the previous file mappings in 4.2, so let's check package **rpm-ostree**. As we've seen, manual files listed here are actually missing, they were not installed.
237
+```
238
+root@photon-host [ /usr/share/man/man1 ]# rpm -ql  rpm-ostree
239
+/usr/bin/atomic
240
+/usr/bin/rpm-ostree
241
+/usr/lib/girepository-1.0/RpmOstree-1.0.typelib
242
+/usr/lib/librpmostree-1.so.1
243
+/usr/lib/librpmostree-1.so.1.0.0
244
+/usr/lib/rpm-ostree
245
+/usr/lib/rpm-ostree/tmpfiles-ostree-integration.conf
246
+/usr/share/man/man1/atomic.1.gz
247
+/usr/share/man/man1/rpm-ostree.1.gz
248
+```
249
+## 4.6 Why am I unable to install, update or delete packages?
250
+
251
+All the commands executed so far operated in read-only mode. But what if you want to erase or install a package using our old friend rpm?
252
+The RPM database is not writable any longer and the file system itself is read-only (except for /var and /etc directories). The idea is that preparing the packages should be done via server tree composition and deployment at host should bring them installed into a new bootable tree that is read-only, recorded into the read-only RPM database. This will insure that all systems deployed are brought into a predictable state and no one could mess with them.
253
+In fact, tdnf and yum commands are not even available to install new packages at the host. Even if you bring them over, adding a new package via **tdnf install** will return an error.
254
+But don't get sad. Installing, updating and deleting files & packages the RPM-OSTree way - from the server - that's exactly the topic of next chapters.
255
+
0 256
new file mode 100644
... ...
@@ -0,0 +1,508 @@
0
+# Host Updating Operations 
1
+
2
+## 5.1 Is it an update or an upgrade?
3
+If you've used yum, dnf (and now tdnf for Photon) in RPM systems or apt-get in Debian based Unix, you understand what "install" is for packages and the subtle difference between "update" and "upgrade".
4
+
5
+OSTree and RPM-OSTree don't distringuish between them and the term "upgrade" has a slightly different meaning - to bring the system in sync with the remote repo, to the top of the Refspec (branch), just like in Git, by pulling the latest changes.
6
+
7
+In fact, ostree and rpm-ostree commands support a single "upgrade" verb for a file image tree and a package list in the same refspec (branch). ```rpm-ostree upgrade``` will install a package if it doesn't exist, will not touch it if it has same version in the new image, will upgrade it if the version number is higher and it may actually downgrade it, if the package has been downgraded in the new image. I wish this operation had a different name, to avoid any confusion.
8
+
9
+The reverse operation of an upgrade is a "rollback" and fortunately it's not named "downgrade" because it may upgrade packages in the last case describe above.
10
+
11
+As we'll see in a future chapter, a jump to a different Refspec (branch) is also supported and it's named "rebase".
12
+
13
+
14
+## 5.2 Incremental upgrade
15
+To check if there are any updates available, one would execute:
16
+```
17
+root@photon-host-def [ ~ ]# rpm-ostree upgrade
18
+Updating from: photon:photon/1.0/x86_64/minimal
19
+
20
+
21
+No upgrade available.
22
+```  
23
+It's good idea to check periodically for updates. In fact, VMware released in July 2016 Photon OS 1.0 Revision 2, that included an ISO containing an updated OSTree repo, mirrored online at same bintray site location. The updated OSTree repo contains new versions all packages that have been updated between since the 1.0 GA (general availability) in September 2015.  
24
+
25
+To simplify our example, let's assume that an updated Photon OS release for this branch (Refspec) contains three new packages: **gawk**, **sudo** and **wget**.
26
+To check if there are any new updates without actually applying them, we will pass the --check-diff flag, that would list the different packages as added, modified or deleted - if such operations were to happen.
27
+```
28
+root@photon-host [ ~ ]# rpm-ostree upgrade --check-diff
29
+Updating from: photon:photon/1.0/x86_64/minimal
30
+
31
+8 metadata, 13 content objects fetched; 1026 KiB transferred in 0 seconds
32
++gawk-4.1.3-2.ph1.x86_64
33
++sudo-1.8.15-3.ph1.x86_64
34
++wget-1.17.1-2.ph1.x86_64
35
+```
36
+
37
+We like what we see and now let's upgrade for real. This command will deploy a new bootable filetree. 
38
+```
39
+root@photon-host [ ~ ]# rpm-ostree upgrade             
40
+Updating from: photon:photon/1.0/x86_64/minimal
41
+
42
+98 metadata, 189 content objects fetched; 14418 KiB transferred in 0 seconds
43
+Copying /etc changes: 6 modified, 0 removed, 16 added
44
+Transaction complete; bootconfig swap: yes deployment count change: 1
45
+Added:
46
+  gawk-4.1.3-2.ph1.x86_64
47
+  sudo-1.8.15-3.ph1.x86_64
48
+  wget-1.17.1-2.ph1.x86_64
49
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot
50
+```
51
+By looking at the commit history, notice that the new commit has the original commit as parent. 
52
+```
53
+root@photon-host [ ~ ]# ostree log photon/1.0/x86_64/minimal
54
+commit 184d9bbcecd4e8401d4a5073a248082f7a8888d232ef9678b6942002547a14e3
55
+Date:  2016-06-13 22:23:25 +0000
56
+Version: 1.0_minimal.1
57
+
58
+
59
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
60
+Date:  2016-06-07 14:06:17 +0000
61
+Version: 1.0_minimal 
62
+```
63
+
64
+Notice that now we have a new reference, that corresponds to the newly deployed image.
65
+```
66
+root@photon-host [ ~ ]# ostree refs
67
+ostree/1/1/0
68
+ostree/1/1/1
69
+photon:photon/1.0/x86_64/minimal
70
+```
71
+
72
+Let's look at the status. The new filetree version .1 has the expected Commit ID and a newer timestamp, that is actually the server date/time when the image has been generated, not the time/date when it was downloaded or installed at the host. The old image has a star next to it, showing that's the image the system is booted currently into. 
73
+```
74
+root@photon-host [ ~ ]# rpm-ostree status
75
+  TIMESTAMP (UTC)        VERSION          ID            OSNAME    REFSPEC                              
76
+  2016-06-13 22:23:25    1.0_minimal.1    184d9bbcec    photon    photon:photon/1.0/x86_64/minimal     
77
+* 2016-06-07 14:06:17    1.0_minimal      56ef687f13    photon    photon:photon/1.0/x86_64/minimal     
78
+```
79
+
80
+Now let's type 'reboot'. Grub will list the new filetree as the first image, marked with a star, as the default bootable image. If the keyboard is not touched and order is not changed, grub will timeout and will boot into that image.
81
+
82
+![Grub-dual-boot-1-0](https://cloud.githubusercontent.com/assets/13158414/16056451/68275a40-322a-11e6-8289-b1c82d617a9c.png)
83
+
84
+Let's look again at the status. It's identical, just that the star is next to the newer image, to show it's the current image it has booted from.
85
+```
86
+root@photon-host [ ~ ]# rpm-ostree status
87
+  TIMESTAMP (UTC)        VERSION          ID            OSNAME    REFSPEC                              
88
+* 2016-06-13 22:23:25    1.0_minimal.1    184d9bbcec    photon    photon:photon/1.0/x86_64/minimal     
89
+  2016-06-07 14:06:17    1.0_minimal      56ef687f13    photon    photon:photon/1.0/x86_64/minimal         
90
+```
91
+
92
+Also, the current deployment directory is based on the new 82bca commit:
93
+```
94
+root@photon-host-def [ ~ ]# ostree admin config-diff --print-current-dir
95
+/ostree/deploy/photon/deploy/82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.0
96
+```
97
+A fresh upgrade for a new version will delete the older, original image and bring a new one, that will become the new default image. The previous 'default' image will move down one position as the backup image.
98
+
99
+## 5.3 Listing file differences   
100
+Now we can look at what files have been **A**dded, **M**odified, **D**eleted due to the addition of those three packages and switching of the boot directories, by comparing the two commits.
101
+```
102
+root@photon-host-def [ ~ ]# ostree diff 2940 82bc
103
+M    /usr/etc/group-
104
+M    /usr/etc/gshadow
105
+M    /usr/etc/passwd-
106
+M    /usr/etc/shadow
107
+M    /usr/share/rpm/Basenames
108
+M    /usr/share/rpm/Conflictname
109
+M    /usr/share/rpm/Dirnames
110
+M    /usr/share/rpm/Group
111
+M    /usr/share/rpm/Installtid
112
+M    /usr/share/rpm/Name
113
+M    /usr/share/rpm/Obsoletename
114
+M    /usr/share/rpm/Packages
115
+M    /usr/share/rpm/Providename
116
+M    /usr/share/rpm/Requirename
117
+M    /usr/share/rpm/Sha1header
118
+M    /usr/share/rpm/Sigmd5
119
+M    /usr/share/rpm/Triggername
120
+M    /usr/share/rpm-ostree/treefile.json
121
+D    /boot/initramfs-4.0.9.img-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
122
+D    /boot/vmlinuz-4.0.9-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
123
+D    /usr/etc/gshadow-
124
+D    /usr/etc/shadow-
125
+D    /usr/lib/ostree-boot/initramfs-4.0.9.img-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
126
+D    /usr/lib/ostree-boot/vmlinuz-4.0.9-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
127
+A    /boot/initramfs-4.0.9.img-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
128
+A    /boot/vmlinuz-4.0.9-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
129
+A    /usr/bin/awk
130
+A    /usr/bin/gawk
131
+A    /usr/bin/gawk-4.1.0
132
+A    /usr/bin/igawk
133
+A    /usr/bin/sudo
134
+A    /usr/bin/sudoedit
135
+A    /usr/bin/sudoreplay
136
+A    /usr/bin/wget
137
+A    /usr/etc/pam.d/sudo
138
+A    /usr/etc/group.rpmnew
139
+A    /usr/etc/passwd.rpmnew
140
+A    /usr/etc/sudoers
141
+A    /usr/etc/wgetrc
142
+A    /usr/etc/sudoers.d
143
+A    /usr/include/gawkapi.h
144
+A    /usr/include/sudo_plugin.h
145
+A    /usr/lib/ostree-boot/initramfs-4.0.9.img-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
146
+A    /usr/lib/ostree-boot/vmlinuz-4.0.9-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
147
+A    /usr/lib/gawk
148
+A    /usr/lib/gawk/filefuncs.so
149
+A    /usr/lib/gawk/fnmatch.so
150
+A    /usr/lib/gawk/fork.so
151
+A    /usr/lib/gawk/inplace.so
152
+A    /usr/lib/gawk/ordchr.so
153
+A    /usr/lib/gawk/readdir.so
154
+A    /usr/lib/gawk/readfile.so
155
+A    /usr/lib/gawk/revoutput.so
156
+A    /usr/lib/gawk/revtwoway.so
157
+A    /usr/lib/gawk/rwarray.so
158
+A    /usr/lib/gawk/testext.so
159
+A    /usr/lib/gawk/time.so
160
+A    /usr/lib/sudo
161
+A    /usr/lib/sudo/group_file.so
162
+A    /usr/lib/sudo/libsudo_util.so
163
+A    /usr/lib/sudo/libsudo_util.so.0
164
+A    /usr/lib/sudo/libsudo_util.so.0.0.0
165
+A    /usr/lib/sudo/sudo_noexec.so
166
+A    /usr/lib/sudo/sudoers.so
167
+A    /usr/lib/sudo/system_group.so
168
+A    /usr/libexec/awk
169
+A    /usr/libexec/awk/grcat
170
+A    /usr/libexec/awk/pwcat
171
+A    /usr/sbin/visudo
172
+A    /usr/share/doc/gawk-4.1.0
173
+A    /usr/share/doc/gawk-4.1.0/api-figure1.eps
174
+A    /usr/share/doc/gawk-4.1.0/api-figure1.pdf
175
+A    /usr/share/doc/gawk-4.1.0/api-figure2.eps
176
+A    /usr/share/doc/gawk-4.1.0/api-figure2.pdf
177
+A    /usr/share/doc/gawk-4.1.0/api-figure3.eps
178
+A    /usr/share/doc/gawk-4.1.0/api-figure3.pdf
179
+A    /usr/share/doc/gawk-4.1.0/awkforai.txt
180
+A    /usr/share/doc/gawk-4.1.0/general-program.eps
181
+A    /usr/share/doc/gawk-4.1.0/general-program.pdf
182
+A    /usr/share/doc/gawk-4.1.0/lflashlight.eps
183
+A    /usr/share/doc/gawk-4.1.0/lflashlight.pdf
184
+A    /usr/share/doc/gawk-4.1.0/process-flow.eps
185
+A    /usr/share/doc/gawk-4.1.0/process-flow.pdf
186
+A    /usr/share/doc/gawk-4.1.0/rflashlight.eps
187
+A    /usr/share/doc/gawk-4.1.0/rflashlight.pdf
188
+A    /usr/share/doc/gawk-4.1.0/statist.eps
189
+A    /usr/share/doc/gawk-4.1.0/statist.jpg
190
+A    /usr/share/doc/gawk-4.1.0/statist.pdf
191
+A    /usr/share/doc/sudo-1.8.11p1
192
+A    /usr/share/doc/sudo-1.8.11p1/CONTRIBUTORS
193
+A    /usr/share/doc/sudo-1.8.11p1/ChangeLog
194
+A    /usr/share/doc/sudo-1.8.11p1/HISTORY
195
+A    /usr/share/doc/sudo-1.8.11p1/LICENSE
196
+A    /usr/share/doc/sudo-1.8.11p1/NEWS
197
+A    /usr/share/doc/sudo-1.8.11p1/README
198
+A    /usr/share/doc/sudo-1.8.11p1/TROUBLESHOOTING
199
+A    /usr/share/doc/sudo-1.8.11p1/UPGRADE
200
+A    /usr/share/doc/sudo-1.8.11p1/sample.pam
201
+A    /usr/share/doc/sudo-1.8.11p1/sample.sudo.conf
202
+A    /usr/share/doc/sudo-1.8.11p1/sample.sudoers
203
+A    /usr/share/doc/sudo-1.8.11p1/sample.syslog.conf
204
+A    /usr/share/locale/be/LC_MESSAGES/wget.mo
205
+A    /usr/share/locale/bg/LC_MESSAGES/wget.mo
206
+A    /usr/share/locale/ca/LC_MESSAGES/sudo.mo
207
+A    /usr/share/locale/ca/LC_MESSAGES/sudoers.mo
208
+A    /usr/share/locale/ca/LC_MESSAGES/wget.mo
209
+A    /usr/share/locale/cs/LC_MESSAGES/sudo.mo
210
+A    /usr/share/locale/cs/LC_MESSAGES/sudoers.mo
211
+A    /usr/share/locale/cs/LC_MESSAGES/wget.mo
212
+A    /usr/share/locale/da/LC_MESSAGES/gawk.mo
213
+A    /usr/share/locale/da/LC_MESSAGES/sudo.mo
214
+A    /usr/share/locale/da/LC_MESSAGES/sudoers.mo
215
+A    /usr/share/locale/da/LC_MESSAGES/wget.mo
216
+A    /usr/share/locale/de/LC_MESSAGES/gawk.mo
217
+A    /usr/share/locale/de/LC_MESSAGES/sudo.mo
218
+A    /usr/share/locale/de/LC_MESSAGES/sudoers.mo
219
+A    /usr/share/locale/de/LC_MESSAGES/wget.mo
220
+A    /usr/share/locale/el/LC_MESSAGES/sudoers.mo
221
+A    /usr/share/locale/el/LC_MESSAGES/wget.mo
222
+A    /usr/share/locale/en_GB/LC_MESSAGES/wget.mo
223
+A    /usr/share/locale/eo/LC_MESSAGES/sudo.mo
224
+A    /usr/share/locale/eo/LC_MESSAGES/sudoers.mo
225
+A    /usr/share/locale/eo/LC_MESSAGES/wget.mo
226
+A    /usr/share/locale/es/LC_MESSAGES/gawk.mo
227
+A    /usr/share/locale/es/LC_MESSAGES/sudo.mo
228
+A    /usr/share/locale/es/LC_MESSAGES/wget.mo
229
+A    /usr/share/locale/et/LC_MESSAGES/wget.mo
230
+A    /usr/share/locale/eu/LC_MESSAGES/sudo.mo
231
+A    /usr/share/locale/eu/LC_MESSAGES/sudoers.mo
232
+A    /usr/share/locale/eu/LC_MESSAGES/wget.mo
233
+A    /usr/share/locale/fi/LC_MESSAGES/gawk.mo
234
+A    /usr/share/locale/fi/LC_MESSAGES/sudo.mo
235
+A    /usr/share/locale/fi/LC_MESSAGES/sudoers.mo
236
+A    /usr/share/locale/fi/LC_MESSAGES/wget.mo
237
+A    /usr/share/locale/fr/LC_MESSAGES/gawk.mo
238
+A    /usr/share/locale/fr/LC_MESSAGES/sudo.mo
239
+A    /usr/share/locale/fr/LC_MESSAGES/wget.mo
240
+A    /usr/share/locale/ga/LC_MESSAGES/wget.mo
241
+A    /usr/share/locale/gl/LC_MESSAGES/sudo.mo
242
+A    /usr/share/locale/gl/LC_MESSAGES/wget.mo
243
+A    /usr/share/locale/he/LC_MESSAGES/wget.mo
244
+A    /usr/share/locale/hr/LC_MESSAGES/sudo.mo
245
+A    /usr/share/locale/hr/LC_MESSAGES/sudoers.mo
246
+A    /usr/share/locale/hr/LC_MESSAGES/wget.mo
247
+A    /usr/share/locale/hu/LC_MESSAGES/wget.mo
248
+A    /usr/share/locale/id/LC_MESSAGES/wget.mo
249
+A    /usr/share/locale/it/LC_MESSAGES/gawk.mo
250
+A    /usr/share/locale/it/LC_MESSAGES/sudo.mo
251
+A    /usr/share/locale/it/LC_MESSAGES/sudoers.mo
252
+A    /usr/share/locale/it/LC_MESSAGES/wget.mo
253
+A    /usr/share/locale/ja/LC_MESSAGES/gawk.mo
254
+A    /usr/share/locale/ja/LC_MESSAGES/sudo.mo
255
+A    /usr/share/locale/ja/LC_MESSAGES/sudoers.mo
256
+A    /usr/share/locale/ja/LC_MESSAGES/wget.mo
257
+A    /usr/share/locale/lt/LC_MESSAGES/sudoers.mo
258
+A    /usr/share/locale/lt/LC_MESSAGES/wget.mo
259
+A    /usr/share/locale/ms/LC_MESSAGES/gawk.mo
260
+A    /usr/share/locale/nb/LC_MESSAGES/sudo.mo
261
+A    /usr/share/locale/nb/LC_MESSAGES/sudoers.mo
262
+A    /usr/share/locale/nb/LC_MESSAGES/wget.mo
263
+A    /usr/share/locale/nl/LC_MESSAGES/gawk.mo
264
+A    /usr/share/locale/nl/LC_MESSAGES/sudo.mo
265
+A    /usr/share/locale/nl/LC_MESSAGES/sudoers.mo
266
+A    /usr/share/locale/nl/LC_MESSAGES/wget.mo
267
+A    /usr/share/locale/pl/LC_MESSAGES/gawk.mo
268
+A    /usr/share/locale/pl/LC_MESSAGES/sudo.mo
269
+A    /usr/share/locale/pl/LC_MESSAGES/sudoers.mo
270
+A    /usr/share/locale/pl/LC_MESSAGES/wget.mo
271
+A    /usr/share/locale/pt/LC_MESSAGES/wget.mo
272
+A    /usr/share/locale/pt_BR/LC_MESSAGES/sudo.mo
273
+A    /usr/share/locale/pt_BR/LC_MESSAGES/sudoers.mo
274
+A    /usr/share/locale/pt_BR/LC_MESSAGES/wget.mo
275
+A    /usr/share/locale/ro/LC_MESSAGES/wget.mo
276
+A    /usr/share/locale/ru/LC_MESSAGES/sudo.mo
277
+A    /usr/share/locale/ru/LC_MESSAGES/wget.mo
278
+A    /usr/share/locale/sk/LC_MESSAGES/wget.mo
279
+A    /usr/share/locale/sl/LC_MESSAGES/sudo.mo
280
+A    /usr/share/locale/sl/LC_MESSAGES/sudoers.mo
281
+A    /usr/share/locale/sl/LC_MESSAGES/wget.mo
282
+A    /usr/share/locale/sr/LC_MESSAGES/sudo.mo
283
+A    /usr/share/locale/sr/LC_MESSAGES/sudoers.mo
284
+A    /usr/share/locale/sr/LC_MESSAGES/wget.mo
285
+A    /usr/share/locale/sv/LC_MESSAGES/gawk.mo
286
+A    /usr/share/locale/sv/LC_MESSAGES/sudo.mo
287
+A    /usr/share/locale/sv/LC_MESSAGES/sudoers.mo
288
+A    /usr/share/locale/sv/LC_MESSAGES/wget.mo
289
+A    /usr/share/locale/tr/LC_MESSAGES/sudo.mo
290
+A    /usr/share/locale/tr/LC_MESSAGES/sudoers.mo
291
+A    /usr/share/locale/tr/LC_MESSAGES/wget.mo
292
+A    /usr/share/locale/uk/LC_MESSAGES/sudo.mo
293
+A    /usr/share/locale/uk/LC_MESSAGES/sudoers.mo
294
+A    /usr/share/locale/uk/LC_MESSAGES/wget.mo
295
+A    /usr/share/locale/vi/LC_MESSAGES/gawk.mo
296
+A    /usr/share/locale/vi/LC_MESSAGES/sudo.mo
297
+A    /usr/share/locale/vi/LC_MESSAGES/sudoers.mo
298
+A    /usr/share/locale/vi/LC_MESSAGES/wget.mo
299
+A    /usr/share/locale/zh_CN/LC_MESSAGES/sudo.mo
300
+A    /usr/share/locale/zh_CN/LC_MESSAGES/sudoers.mo
301
+A    /usr/share/locale/zh_CN/LC_MESSAGES/wget.mo
302
+A    /usr/share/locale/zh_TW/LC_MESSAGES/wget.mo
303
+A    /usr/share/man/man1/gawk.1.gz
304
+A    /usr/share/man/man1/igawk.1.gz
305
+A    /usr/share/man/man1/wget.1.gz
306
+A    /usr/share/man/man3/filefuncs.3am.gz
307
+A    /usr/share/man/man3/fnmatch.3am.gz
308
+A    /usr/share/man/man3/fork.3am.gz
309
+A    /usr/share/man/man3/ordchr.3am.gz
310
+A    /usr/share/man/man3/readdir.3am.gz
311
+A    /usr/share/man/man3/readfile.3am.gz
312
+A    /usr/share/man/man3/revoutput.3am.gz
313
+A    /usr/share/man/man3/revtwoway.3am.gz
314
+A    /usr/share/man/man3/rwarray.3am.gz
315
+A    /usr/share/man/man3/time.3am.gz
316
+A    /usr/share/man/man5/sudo.conf.5.gz
317
+A    /usr/share/man/man5/sudoers.5.gz
318
+A    /usr/share/man/man8/sudo.8.gz
319
+A    /usr/share/man/man8/sudo_plugin.8.gz
320
+A    /usr/share/man/man8/sudoedit.8.gz
321
+A    /usr/share/man/man8/sudoreplay.8.gz
322
+A    /usr/share/man/man8/visudo.8.gz
323
+A    /usr/share/awk
324
+A    /usr/share/awk/assert.awk
325
+A    /usr/share/awk/bits2str.awk
326
+A    /usr/share/awk/cliff_rand.awk
327
+A    /usr/share/awk/ctime.awk
328
+A    /usr/share/awk/ftrans.awk
329
+A    /usr/share/awk/getopt.awk
330
+A    /usr/share/awk/gettime.awk
331
+A    /usr/share/awk/group.awk
332
+A    /usr/share/awk/inplace.awk
333
+A    /usr/share/awk/join.awk
334
+A    /usr/share/awk/libintl.awk
335
+A    /usr/share/awk/noassign.awk
336
+A    /usr/share/awk/ord.awk
337
+A    /usr/share/awk/passwd.awk
338
+A    /usr/share/awk/quicksort.awk
339
+A    /usr/share/awk/readable.awk
340
+A    /usr/share/awk/rewind.awk
341
+A    /usr/share/awk/round.awk
342
+A    /usr/share/awk/strtonum.awk
343
+A    /usr/share/awk/walkarray.awk
344
+A    /usr/share/awk/zerofile.awk
345
+```
346
+ 
347
+## 5.4 Listing package differences
348
+We can also look at package differences, as you expect, using the right tool for the job.
349
+```
350
+root@photon-host-def [ ~ ]# rpm-ostree db diff 2940 82bc    
351
+ostree diff commit old: 2940 (2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8)
352
+ostree diff commit new: 82bc (82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817)
353
+Added:
354
+ gawk-4.1.0-2.ph1.x86_64
355
+ sudo-1.8.11p1-4.ph1.x86_64
356
+ wget-1.15-1.ph1.x86_64
357
+```
358
+
359
+## 5.5 Rollback
360
+If we want to go back to the previous image, we can rollback. The order of the images will be changed, so the old filetree will become the default bootable image. If -r option is passed, the rollback will continue with a reboot.
361
+```
362
+root@photon-host-def [ ~ ]# rpm-ostree rollback
363
+Moving '2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0' to be first deployment
364
+Transaction complete; bootconfig swap: yes deployment count change: 0
365
+Removed:
366
+  gawk-4.1.0-2.ph1.x86_64
367
+  sudo-1.8.11p1-4.ph1.x86_64
368
+  wget-1.15-1.ph1.x86_64
369
+Successfully reset deployment order; run "systemctl reboot" to start a reboot
370
+```
371
+In fact, we can repeat the rollback operation as many times as we want before reboot. On each execution, it's going to change the order. It will not delete any image.  
372
+However, an upgrade will keep the current default image and will eliminate the other image, whichever that is. So if Photon installation rolled back to an older build, an upgrade will keep that, eliminate the newer version and will replace it with an even newer version at the next upgrade.  
373
+
374
+![grub-boot-0-1](https://cloud.githubusercontent.com/assets/13158414/9673725/3d33162a-525c-11e5-8292-5b79c48e0c6b.png)  
375
+The boot order moved back to original:
376
+```
377
+root@photon-host-def [ ~ ]# rpm-ostree status
378
+  TIMESTAMP (UTC)       VERSION             ID           OSNAME   REFSPEC                              
379
+* 2015-08-20 22:27:43   1.0_minimal     2940e10c4d   photon   photon:photon/1.0/x86_64/minimal     
380
+  2015-09-03 00:34:41   1.0_minimal.1   82bca728ea   photon   photon:photon/1.0/x86_64/minimal   
381
+```
382
+The current bootable image path moved also back to the original value:
383
+```
384
+root@photon-host-def [ ~ ]# ostree admin config-diff --print-current-dir
385
+/ostree/deploy/photon/deploy/2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0 
386
+```
387
+
388
+## 5.6 Deleting a deployed filetree
389
+It is possible to delete a deployed tree. You won't need to do that normally, as upgrading to a new image will delete the old one, but if for some reason deploying failed (loss of power, networking issues), you'll want to delete the partially deployed image.  
390
+The only supported index is 1. (If multiple bootable images will be supported in the future, a larger than one, zero-based index of the image to delete will be supported).  
391
+You cannot delete the default bootable filetree, so passing 0 will result in an error.  
392
+```
393
+root@photon-host-def [ ~ ]# ostree admin undeploy -v 1
394
+OT: Using bootloader: OstreeBootloaderGrub2
395
+Transaction complete; bootconfig swap: yes deployment count change: -1
396
+Deleted deployment 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.0
397
+
398
+root@photon-host-cus1 [ ~ ]# ostree admin undeploy -v 0
399
+error: Cannot undeploy currently booted deployment 0
400
+```
401
+Now, we can see that the newer image is gone, the deployment directory for commit 82bc has been removed.  
402
+```
403
+root@photon-host-def [ ~ ]# rpm-ostree status
404
+  TIMESTAMP (UTC)        VERSION        ID            OSNAME    REFSPEC                              
405
+* 2015-08-20 22:27:43    1.0_minimal    2940e10c4d    photon    photon:photon/1.0/x86_64/minimal 
406
+root@photon-host-cus1 [ ~ ]# ls /ostree/deploy/photon/deploy/                                        
407
+2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0
408
+2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0.origin   
409
+```
410
+However the commit is still there in the OSTree repo.
411
+```
412
+root@photon-host-def [ ~ ]# ostree log 82bc                 
413
+commit 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817
414
+Date:  2015-09-03 00:34:41 +0000
415
+Version: 1.0_minimal.1
416
+
417
+
418
+commit 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8
419
+Date:  2015-08-20 22:27:43 +0000
420
+Version: 1.0_minimal
421
+```
422
+But there is nothing to rollback to.
423
+```
424
+root@photon-host-def [ ~ ]# rpm-ostree rollback
425
+error: Found 1 deployments, at least 2 required for rollback
426
+```
427
+If we were to upgrade again, it would bring these packages back, but let's just check the differeneces.
428
+```
429
+root@photon-host-def [ ~ ]# rpm-ostree upgrade --check-diff
430
+Updating from: photon:photon/1.0/x86_64/minimal
431
+
432
+
433
++gawk-4.1.0-2.ph1.x86_64
434
++sudo-1.8.11p1-4.ph1.x86_64
435
++wget-1.15-1.ph1.x86_64
436
+```
437
+
438
+## 5.7 Version skipping upgrade
439
+
440
+Let's assume that after a while, VMware releases version 2 that removes **sudo** and adds **bison** and **tar**. Now, an upgrade will skip version 1 and go directly to 2. Let's first look at what packages are pulled (notice sudo missing, as expected), then upgrade with reboot option.
441
+```
442
+root@photon-host-def [ ~ ]# rpm-ostree upgrade --check-diff
443
+Updating from: photon:photon/1.0/x86_64/minimal
444
+
445
+7 metadata, 13 content objects fetched; 1287 KiB transferred in 0 seconds
446
++bison-3.0.2-2.ph1.x86_64
447
++gawk-4.1.0-2.ph1.x86_64
448
++tar-1.27.1-1.ph1.x86_64
449
++wget-1.15-1.ph1.x86_64
450
+
451
+root@photon-host-def [ ~ ]# rpm-ostree upgrade -r          
452
+Updating from: photon:photon/1.0/x86_64/minimal
453
+
454
+107 metadata, 512 content objects fetched; 13064 KiB transferred in 1 seconds
455
+Copying /etc changes: 5 modified, 0 removed, 16 added
456
+Transaction complete; bootconfig swap: yes deployment count change: 1
457
+Freed objects: 19.3 MB
458
+```
459
+After reboot, let's check the booting filetrees, the current dir for the current filetree and look at commit differences:
460
+```
461
+root@photon-host-def [ ~ ]# rpm-ostree status 
462
+  TIMESTAMP (UTC)        VERSION          ID            OSNAME    REFSPEC                              
463
+* 2015-09-04 00:36:37    1.0_minimal.2    092e21d292    photon    photon:photon/1.0/x86_64/minimal
464
+  2015-08-20 22:27:43    1.0_minimal      2940e10c4d    photon    photon:photon/1.0/x86_64/minimal
465
+
466
+root@photon-host-cus1 [ ~ ]# ostree admin config-diff --print-current-dir
467
+/ostree/deploy/photon/deploy/092e21d2928090d507ce711d482e4402e310b5a7f46532c5e24e0789590d0373.0
468
+
469
+root@photon-host-cus1 [ ~ ]# rpm-ostree db diff  2940 092e
470
+ostree diff commit old: 2940 (2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8)
471
+ostree diff commit new: 092e (092e21d2928090d507ce711d482e4402e310b5a7f46532c5e24e0789590d0373)
472
+Added:
473
+ bison-3.0.2-2.ph1.x86_64
474
+ gawk-4.1.0-2.ph1.x86_64
475
+ tar-1.27.1-1.ph1.x86_64
476
+ wget-1.15-1.ph1.x86_64
477
+
478
+root@photon-host-cus1 [ ~ ]# rpm-ostree db diff  82bc 092e
479
+error: Refspec '82bc' not found
480
+```
481
+Interesting fact: The metadata for commit 82bc has been removed from the local repo!  
482
+
483
+## 5.8 Tracking parent commits
484
+OSTree will display limited commit history - maximum 2 levels, so if you want to traverse the history even though it may not find a commitment by its ID, you can refer to its parent using '^' suffix, grandfather via '^^' and so on. We know that 82bc is the parent of 092e:
485
+```
486
+root@photon-host-def [ ~ ]# rpm-ostree db diff  092e^ 092e
487
+error: No such metadata object 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.commit
488
+error: Refspec '82cb' not found
489
+root@photon-host-def [ ~ ]# rpm-ostree db diff  092e^^ 092e
490
+error: No such metadata object 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.commit
491
+````
492
+So commit 092e knows who its parent is, but its metadata is no longer in the local repo, so it cannot traverse further to its parent to find an existing grandfather.
493
+
494
+## 5.9 Resetting a branch to a previous commit
495
+We can reset the head of a branch in a local repo to a previous commit, for example corresponding to version 0 (1.0_minimal).
496
+```
497
+root@photon-host-def [ ~ ]# ostree reset photon:photon/1.0/x86_64/minimal 2940
498
+```
499
+Now if wee look again at the branch commit history, the head is at version 0.  
500
+```
501
+root@photon-host-def [ ~ ]# ostree log photon/1.0/x86_64/minimal
502
+commit 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8
503
+Date:  2015-08-20 22:27:43 +0000
504
+Version: 1.0_minimal
505
+```
506
+
507
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata]] | [[ Next page >|Photon-RPM-OSTree:-6-Installing-a-server]]
0 508
\ No newline at end of file
1 509
new file mode 100644
... ...
@@ -0,0 +1,49 @@
0
+# Installing a server
1
+
2
+This is the server that is going to be used by a system administrator or a package installer developer to compose filesystem trees and make them available to hosts (or clients) to pull (download) and deploy.  
3
+
4
+The first step is to download the ISO for the desired release, if you have not done that already:  
5
+[Photon 1.0 GA ISO file](https://bintray.com/artifact/download/vmware/photon/photon-1.0-13c08b6.iso)  
6
+[Photon 1.0 Rev2 ISO file](https://bintray.com/artifact/download/vmware/photon/photon-1.0-62c543d.iso)  
7
+[Photon OS 2.0 Beta ISO file](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fiso%2Fphoton-2.0-8553d58.iso)  
8
+
9
+Installation steps are the same to all Photon OS versions, except that under the hood:
10
+* Photon 1.0 sets up a 'minimal' sample file tree, so it's ready to accept host pull/install requests right away.
11
+* Photon 2.0 does not set up a file tree, so there are several steps needed post-install to have a completely functional server that host can deploy from; they will be explained in detail in Chapter 8 and 9, but a quick setup is provided for you later in this chapter.  
12
+
13
+## 6.1 Manual install of a server
14
+First, create a new VM in Fusion, Workstation or ESXi box, and go through the [steps common to all installation profiles](Running-Project-Photon-on-Fusion), then select the "Photon OSTree Server" option.
15
+
16
+![PhotonChooseServer](https://cloud.githubusercontent.com/assets/13158414/14802949/1c5f92b8-0b0a-11e6-8d69-96e62218dfcb.png)
17
+
18
+Continue with setting up a host name (like photon-srv) and a root password and that's all you need. Installation took about 40 seconds for Fusion running on my Mac with SSD, but it should take longer time for spin hard drives.  
19
+
20
+For Photon 1.0, once the server boots, the RPM-OSTree repository is ready to accept pull request from hosts, because setting up a 'minimal' tree is part of installation. This ostree 'minimal' configuration is almost identical, as far as packages list, to the 'Photon Minimal' installation profile from 'Select Installation' menu. 
21
+
22
+![PhotonServerLogin](https://cloud.githubusercontent.com/assets/13158414/14802957/2f5ed7e8-0b0a-11e6-960d-04c6202b0c4e.png)
23
+
24
+
25
+In order for hosts to access server's OSTree repo via http, an Apache web server is configured as part of installation. If you want to also serve https, you need to take additional steps - configure the web server, open port 443 via iptables and install certificates specific to your organization, that I won't cover here.  
26
+
27
+The server's IP address will be passed to the Photon RPM-OSTree hosts that want to connect to this server.  
28
+You may ask your network administrator for a static IP, registered to your company's DNS, so your users who install Photon RPM-OSTree hosts will enter a pretty name like http://photon-srv.yourcompany.com, rather than remember a numeric IP address.
29
+
30
+Having the server configured, you may advance to next chapter to [install your own host from this server's repository](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md). That's a way to verify right away that all components (server, network) are running correctly and test the 'minimal' server filetree image by downloading and installing it at the host.
31
+
32
+## 6.2 Composing your first OSTree repo  
33
+If you've installed Photon 2.0 OSTree server, the server did not setup a tree as part of an installation, but configuration files for starter 'base', 'minimal' and 'full' tree are there for you. To create a 'minimal' tree, you only need two commands - one to initialize a new repo, the other one to compose it.
34
+```
35
+root [ ~ ]# cd /srv/rpm-ostree
36
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2
37
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
38
+```
39
+You are now ready to deploy a host, explained in next chapter. Skip to [Chapter 8: File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md) and [Chapter 9: Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md) to learn create your own customized file tree.   
40
+
41
+## 6.2 Automated install of a server via kickstart
42
+All Photon OS versions support unattended install, in other words installer will display its progress, but will not prompt for any keys to be clicked, and will boot at the end of installation. This will create an identical server as installing via UI.
43
+
44
+If not familiar with the way kickstart works, visit [Kickstart Support in Photon OS](kickstart.md). The kickstart json config for OSTree is similar to minimal or full, except for this setting:  
45
+```
46
+"type": "ostree_server"
47
+```
48
+
0 49
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+# Installing a Photon RPM-OStree host against a custom server repository
1
+
2
+Organizations that maintain their own OSTree servers create custom image trees suited to their needs from which hosts can be deployed and upgraded. One single server may make available several branches to install, for example "base", "minimal" and "full". Or, if you think in terms of Windows OS SKUs - "Home", "Professional" or "Enterprise" edition.
3
+
4
+So in fact there are two pieces of information the OSTree host installer needs - the server URL and the branch ref. Also, there are two ways to pass this info - manually via keyboard, when prompted and automated, by reading from a config file.
5
+
6
+## 7.1 Manual install of a custom host
7
+For Photon 1.0 or 1.0 Revision 2, installing a Photon RPM-OSTree host that will pull from a server repository of your choice is very similar to the way we installed the host against the default server repo in [Chapter 2](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md).  
8
+We will follow the same steps, selecting "Photon OSTree Host", and after assigning a host name like **photon-host** and a root password, this time we will click on "Custom RPM-OSTree Server".  
9
+
10
+![PhotonHostCustom](https://cloud.githubusercontent.com/assets/13158414/14804629/fe17c7d4-0b19-11e6-9cc6-7e79f768b7b1.png)
11
+
12
+An additional screen will ask for the URL of server repo - just enter the IP address or fully qualified domain name of the [server installed in the previous step](Photon-RPM-OSTree-6-Installing-a-server.md).  
13
+
14
+![PhotonHostCustomURL](https://cloud.githubusercontent.com/assets/13158414/14804647/185f1aa2-0b1a-11e6-9e44-e2f54592da35.png)
15
+
16
+You will then be asked to enter a Refspec. Leave the default 'photon/1.0/x86_64/minimal' value, unless you've created a new branch at the server (we will see later how to do that).  
17
+
18
+![PhotonHostCustomRefspec](https://cloud.githubusercontent.com/assets/13158414/14804653/1f0d31cc-0b1a-11e6-8f56-e8cac1f72852.png)
19
+
20
+Once this is done and the installation finished, reboot and you are ready to use it.  
21
+You may verify - just like in [Chapter 3.1](Photon-RPM-OStree-3-Concepts-in-action#31-querying-the-deployed-filetrees.md) - that you can get an rpm-ostree status. The value for the CommitID should be identical to the [host that installed from default repo](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md), if the [server](Photon-RPM-OSTree-6-Installing-a-server.md) has been installed fresh, from the same ISO.  
22
+
23
+Photon 2.0 does not provide the UI option to install an RPM-OSTree host, but supports automated, UI-less install, that we'll explore next.
24
+
25
+## 7.2 Automated install of a custom host via kickstart
26
+Photon 1.0, 1.0 Revision 2 and Photon OS 2.0 support automated install that will not interact with the user, in other words installer will display its progress, but will not prompt for any keys to be clicked, and will boot at the end of installation.  
27
+
28
+If not familiar with the way kickstart works, visit [Kickstart Support in Photon OS](kickstart.md). The kickstart json config for OSTree is similar to minimal or full, except for these settings that should sound familiar: 
29
+```
30
+    ...
31
+    "type": "ostree_host",
32
+    "ostree_repo_url": "http://192.168.218.249",
33
+    "ostree_repo_ref": "photon/1.0/x86_64/minimal",
34
+    ...
35
+```
36
+If the server is Photon OS 2.0, and the administrator composed trees for the included json files, the ostree_repo_ref will take either value: **photon/2.0/x86_64/base**, **photon/2.0/x86_64/minimal**, or **photon/2.0/x86_64/full**.
37
+
38
+In most situations, kickstart file is accessed via http from PXE boot. That enables booting from network and end to end install of hosts from pre-defined server URL and branch without assistance from user. 
0 39
new file mode 100644
... ...
@@ -0,0 +1,321 @@
0
+# Package Oriented Server Operations
1
+
2
+Now that we have a Photon RPM-OSTree server up and running (if not, see how to [install](Photon-RPM-OSTree-6-Installing-a-server.md)), we will learn how to provide the desired set of packages as input and instruct rpm-ostree to compose a filetree, that will result in creation (or update) of an OSTree repo.   
3
+The simplest way to explain is to take a look at the files installed by the Photon RPM-OSTree server during setup.  
4
+```  
5
+root [ ~ ]# cd /srv/rpm-ostree/
6
+root [ /srv/rpm-ostree ]# ls -l
7
+total 16
8
+lrwxrwxrwx 1 root root   31 Aug 28 19:06 lightwave-ostree.repo -> /etc/yum.repos.d/lightwave.repo
9
+-rw-r--r-- 1 root root 7356 Aug 28 19:06 ostree-httpd.conf
10
+-rw-r--r-- 1 root root 1085 Aug 28 19:06 photon-base.json
11
+lrwxrwxrwx 1 root root   35 Aug 28 19:06 photon-extras-ostree.repo -> /etc/yum.repos.d/photon-extras.repo
12
+lrwxrwxrwx 1 root root   32 Aug 28 19:06 photon-iso-ostree.repo -> /etc/yum.repos.d/photon-iso.repo
13
+lrwxrwxrwx 1 root root   28 Aug 28 19:06 photon-ostree.repo -> /etc/yum.repos.d/photon.repo
14
+lrwxrwxrwx 1 root root   36 Aug 28 19:06 photon-updates-ostree.repo -> /etc/yum.repos.d/photon-updates.repo
15
+drwxr-xr-x 7 root root 4096 Aug 20 22:27 repo
16
+```
17
+## 9.1 JSON configuration file
18
+How can we tell rpm-ostree what packages we want to include, where to get them from and how to compose the filetree? There is JSON file for that. Let's take a look at photon-base.json used by the Photon OS team.  
19
+```
20
+root [ /srv/rpm-ostree ]# cat photon-base.json 
21
+{
22
+    "comment": "Photon Minimal OSTree",
23
+
24
+    "osname": "photon",
25
+
26
+    "ref": "photon/1.0/x86_64/minimal",
27
+
28
+    "automatic_version_prefix": "1.0_minimal",
29
+
30
+    "repos": ["photon"],
31
+
32
+    "selinux": false,
33
+
34
+    "initramfs-args": ["--no-hostonly"],
35
+
36
+    "bootstrap_packages": ["filesystem"],
37
+
38
+    "packages": ["glibc", "zlib", "binutils", "gmp", "mpfr", "libgcc", "libstdc++","libgomp",
39
+                "pkg-config", "ncurses", "bash", "bzip2", "cracklib", "cracklib-dicts", "shadow",
40
+                "procps-ng", "iana-etc", "readline", "coreutils", "bc", "libtool", "inetutils",
41
+                "findutils", "xz", "grub2", "iproute2", "util-linux", "linux",
42
+                "attr", "libcap", "kmod", "expat", "dbus", "file",
43
+                "sed", "grep", "cpio", "gzip",
44
+                "openssl", "ca-certificates", "curl",
45
+                "systemd",
46
+                "openssh", "iptables",
47
+                "photon-release",
48
+                "vim", "tdnf",
49
+                "docker","bridge-utils",
50
+                "dracut", "dracut-tools", "rpm-ostree", "nss-altfiles", "which"]
51
+}
52
+``` 
53
+There are some mandatory settings, some optional. I'm only going to explain the most important ones for our use case.  
54
+**osname** and **ref** should be familiar, they have been explained in previous sections [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#34-osname) and [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#35-refspec). Basicaly, we are asking `rpm-ostree` to compose a tree for photon OS and photon/1.0/x86_64/minimal branch.
55
+
56
+## 9.2 Package addition, removal, upgrade 
57
+**packages** is the list of packages that are to be added, in this case, in the "minimal" installation profile, on top of the packages already included by default. This is not quite the identical set of RPMS you get when you select the minimal profile in the ISO installer, but it's pretty close and that's why it's been named the same. 
58
+Let's add to the list three new packages: gawk, sudo and wget using `vim photon-base.json`
59
+
60
+**!!!Warning: do not remove any packages from the default list, even an "innocent" one, as it may bring the system to an unstable condition.  During my testing, I've removed "which"; it turns out it was used to figure out the grub booting roots: on reboot, the system was left hanging at grub prompt.**
61
+
62
+## 9.3 RPMS repository
63
+But where are these packages located? RPM-OStree uses the same standard RPMS repositories, that yum installs from.
64
+``` 
65
+root [ /srv/rpm-ostree ]# ls /etc/yum.repos.d/
66
+lightwave.repo  photon-iso.repo  photon-updates.repo  photon.repo
67
+```
68
+Going back to our JSON file, **repos** is a multi-value setting that tells RPM-OSTree in what RPMS repositories to look for packages. In this case, it looks in the current directory for a "photon" repo configuration file, that is a .repo file starting with a [photon] section. There is such a file: **photon-ostree.repo**, that is in fact a link to **photon.repo** in /etc/yum.repos.d directory.
69
+``` 
70
+root [ /srv/rpm-ostree ]# cat /etc/yum.repos.d/photon.repo 
71
+[photon]
72
+name=VMware Photon Linux 1.0(x86_64)
73
+baseurl=https://dl.bintray.com/vmware/photon_release_1.0_x86_64
74
+gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY
75
+gpgcheck=1
76
+enabled=1
77
+skip_if_unavailable=True
78
+```
79
+In this case, `rpm-ostree` is instructed to download its packages in RPM format from the bintray URL, that is the location of an online RPMS repo maintained by the WMware Photon OS team. To make sure those packages are genuine, signed by VMware, the signature is checked against the official VMware public key.
80
+
81
+So what's in an RPMS repository? If we point the browser to https://dl.bintray.com/vmware/photon_release_1.0_x86_64, we can see there are three top directories:
82
+* noarch - where all packages that don't depend on the architecture reside. Those may contain scripts, platform neutral source files, configuration.
83
+* x86_64 - platform dependent packages for Intel 32 and 64 bits CPUs.
84
+* repodata - internal repo management data, like a catalog of all packages, and for every package its name, id, version, architecture and full path file/directory list. There is also a compressed XML file containing the history of changelogs extracted from github, as packages in RPM format were built by Photon OS team members from sources.
85
+
86
+Fortunately, in order to compose a tree, you don't need to download the packages from the online repository (which is time consuming - in the order of minutes), unless there are some new ones or updated versions of them, added by the Photon team after shipping 1.0 version or the 1.0 Refresh. A copy of the starter RPMS repository (as of 1.0 shipping date) has been included on the CD-ROM and you can access it.
87
+```
88
+root [ /srv/rpm-ostree ]# mount /dev/cdrom
89
+root [ /srv/rpm-ostree ]# ls /mnt/cdrom/RPMS
90
+noarch  repodata  x86_64
91
+```
92
+All you have to do now is to replace the `"repos": ["photon"]` entry by `"repos": ["photon-iso"]`, which will point to the RPMS repo on CD-ROM, rather than the online repo. This way, composing saves time, bandwidth and reduces to zero the risk of failure because of a networking issue. 
93
+
94
+_**Note**_: Check from time to time if the [known issue](Photon-RPM-OSTree-Appendix-A:-Known-issues.md#error-composing-when-photon-iso-repo-is-selected) has been fixed.
95
+```
96
+root [ /srv/rpm-ostree ]# cat /etc/yum.repos.d/photon-iso.repo 
97
+[photon-iso]
98
+name=VMWare Photon Linux 1.0(x86_64)
99
+baseurl=file:///mnt/cdrom/RPMS
100
+gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY
101
+gpgcheck=1
102
+enabled=0
103
+skip_if_unavailable=True
104
+```
105
+
106
+There are already in current directory links created to all repositories in /etc/yum.repos.d, so they are found when tree compose command is invoked. You may add any other repo to the list and include packages found in that repo to be part of the image. 
107
+
108
+
109
+## 9.4 Composing a tree
110
+After so much preparation, it's time to execute a tree compose. We've only added 3 new packages and changed the RPMS repo source. Assuming you've already edited the JSON file, let's do it.
111
+```
112
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
113
+Previous commit: 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8
114
+
115
+Downloading metadata [=========================================================================] 100%
116
+
117
+Transaction: 117 packages
118
+  Linux-PAM-1.1.8-2.ph1.x86_64
119
+  attr-2.4.47-1.ph1.x86_64
120
+  ...
121
+  gawk-4.1.0-2.ph1.x86_64
122
+  ...
123
+  sudo-1.8.11p1-4.ph1.x86_64
124
+  ...
125
+  wget-1.15-1.ph1.x86_64
126
+  which-2.20-1.ph1.x86_64
127
+  xz-5.0.5-2.ph1.x86_64
128
+  zlib-1.2.8-2.ph1.x86_64
129
+Installing packages [==========================================================================] 100%
130
+Writing '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/usr/share/rpm-ostree/treefile.json'
131
+Preparing kernel
132
+Creating empty machine-id
133
+Executing: /usr/bin/dracut -v --tmpdir=/tmp -f /var/tmp/initramfs.img 4.0.9 --no-hostonly
134
+...
135
+*** Including module: bash ***
136
+*** Including module: kernel-modules ***
137
+*** Including module: resume ***
138
+*** Including module: rootfs-block ***
139
+*** Including module: terminfo ***
140
+*** Including module: udev-rules ***
141
+Skipping udev rule: 91-permissions.rules
142
+Skipping udev rule: 80-drivers-modprobe.rules
143
+*** Including module: ostree ***
144
+*** Including module: systemd ***
145
+*** Including module: usrmount ***
146
+*** Including module: base ***
147
+/etc/os-release: line 1: Photon: command not found
148
+*** Including module: fs-lib ***
149
+*** Including module: shutdown ***
150
+*** Including modules done ***
151
+*** Installing kernel module dependencies and firmware ***
152
+*** Installing kernel module dependencies and firmware done ***
153
+*** Resolving executable dependencies ***
154
+*** Resolving executable dependencies done***
155
+*** Stripping files ***
156
+*** Stripping files done ***
157
+*** Store current command line parameters ***
158
+*** Creating image file ***
159
+*** Creating image file done ***
160
+Image: /var/tmp/initramfs.img: 11M
161
+========================================================================
162
+Version: dracut-041-1.ph1
163
+
164
+Arguments: -v --tmpdir '/tmp' -f --no-hostonly
165
+
166
+dracut modules:
167
+bash
168
+kernel-modules
169
+resume
170
+rootfs-block
171
+terminfo
172
+udev-rules
173
+ostree
174
+systemd
175
+usrmount
176
+base
177
+fs-lib
178
+shutdown
179
+========================================================================
180
+drwxr-xr-x  12 root     root            0 Sep  1 00:52 .
181
+crw-r--r--   1 root     root       5,   1 Sep  1 00:52 dev/console
182
+crw-r--r--   1 root     root       1,  11 Sep  1 00:52 dev/kmsg
183
+...   (long list of files removed)
184
+========================================================================
185
+Initializing rootfs
186
+Migrating /etc/passwd to /usr/lib/
187
+Migrating /etc/group to /usr/lib/
188
+Moving /usr to target
189
+Linking /usr/local -> ../var/usrlocal
190
+Moving /etc to /usr/etc
191
+Placing RPM db in /usr/share/rpm
192
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/lib/nss_db/Makefile'
193
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/cache/ldconfig/aux-cache'
194
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/btmp'
195
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/lastlog'
196
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/wtmp'
197
+Moving /boot
198
+Using boot location: both
199
+Copying toplevel compat symlinks
200
+Adding tmpfiles-ostree-integration.conf
201
+Committing '/var/tmp/rpm-ostree.TVO089/rootfs.tmp' ...
202
+photon/1.0/x86_64/minimal => c505f4bddb4381e8b5213682465f1e5bb150a18228aa207d763cea45c6a81bbe
203
+```
204
+I've cut a big part of logging, but as you can see, the new filetree adds to the top of the previous (initial) commit 2940e10c4d and produces a new commit c505f4bddb. Our packages gawk-4.1.0-2.ph1.x86_64, sudo-1.8.11p1-4.ph1.x86_64 and wget-1.15-1.ph1.x86_64 have been added.  
205
+
206
+During compose, `rpm-ostree` checks out the file tree into its uncompressed form, applies the package changes, places the updated RPM repo into /usr/share/rpm  and calls `ostree` to commit its changes back into the OSTree repo. If we were to look at the temp directory during this time:
207
+```
208
+root [ /srv/rpm-ostree ]# ls /var/tmp/rpm-ostree.TVO089/rootfs.tmp
209
+bin   dev   lib    media  opt     proc  run   srv  sysroot  usr
210
+boot  home  lib64  mnt    ostree  root  sbin  sys  tmp      var
211
+```
212
+If we repeat the command, and there is no change in the JSON file settings and no change in metadata, rpm-ostree will figure out that nothing has changed and stop. You can force however to redo the whole composition.
213
+```
214
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
215
+Previous commit: c505f4bddb4381e8b5213682465f1e5bb150a18228aa207d763cea45c6a81bbe
216
+
217
+Downloading metadata [=========================================================================] 100%
218
+
219
+
220
+No apparent changes since previous commit; use --force-nocache to override
221
+```
222
+
223
+This takes several minutes. Then why is the RPM-OSTree server installing so fast, in 45 seconds on my SSD? The server doesn't compose the tree, it uses a pre-created OSTree repo that is stored on the CD-ROM. It comes of course at the expense of larger CD-ROM size. This OSTree repo is created from the same set of RPMS on the CD-ROM, so if you compose fresh, you will get the same exact tree, with same commit ID for the "minimal" ref. 
224
+
225
+
226
+## 9.5 Automatic version prefix
227
+If you recall the filetree version explained earlier, this is where it comes into play. When a tree is composed from scratch, the first version (0) associated to the initial commit is going to get that human readable value. Any subsequent compose operation will auto-increment to .1, .2, .3 and so on.  
228
+It's a good idea to start a versionning scheme of your own, so that your customized Photon builds that may get different packages of your choice don't get the same version numbers as the official Photon team builds, coming from VMware's bintray OSTree repository. There is no conflict, it's just confusing to have same name for different commits coming from different repos!  
229
+So if you work for a company named Big Data Inc., you may want to switch to a new versioning scheme `"automatic_version_prefix": "1.0_bigdata"`.
230
+
231
+
232
+## 9.6 Installing package updates
233
+If you want to provide hosts with the package updates that VMware periodically releases, all that you need to do is to add the photon-updates.repo to the list of repos in photon-base.json and then re-compose the usual way. 
234
+```
235
+"repos": ["photon", "photon-updates"],
236
+```
237
+
238
+Even though you may have not modified the "packages" section in the json file, the newer versions of existing packages will be included in the new image and then downloaded by the host the usual way. Note that upgrading a package shows differently than adding (+) or removing (-). You may still see packages added (or removed) though because they are new dependencies (or no longer dependencies) for the newer versions of other packages, as libssh2 in the example below.
239
+```
240
+root [ ~ ]# rpm-ostree upgrade --check-diff
241
+Updating from: photon:photon/1.0/x86_64/minimal
242
+
243
+8 metadata, 13 content objects fetched; 1002 KiB transferred in 0 seconds
244
+!bridge-utils-1.5-2.ph1.x86_64
245
+=bridge-utils-1.5-3.ph1.x86_64
246
+!bzip2-1.0.6-5.ph1.x86_64
247
+=bzip2-1.0.6-6.ph1.x86_64
248
+!curl-7.47.1-2.ph1.x86_64
249
+=curl-7.51.0-2.ph1.x86_64
250
+!docker-1.11.0-5.ph1.x86_64
251
+=docker-1.12.1-1.ph1.x86_64
252
+...
253
++libssh2-1.8.0-1.ph1.x86_64
254
+...
255
+
256
+root [ ~ ]# rpm-ostree upgrade             
257
+Updating from: photon:photon/1.0/x86_64/minimal
258
+
259
+258 metadata, 1165 content objects fetched; 76893 KiB transferred in 8 seconds
260
+Copying /etc changes: 6 modified, 0 removed, 14 added
261
+Transaction complete; bootconfig swap: yes deployment count change: 1
262
+Changed:
263
+  bridge-utils 1.5-2.ph1 -> 1.5-3.ph1
264
+  bzip2 1.0.6-5.ph1 -> 1.0.6-6.ph1
265
+  curl 7.47.1-2.ph1 -> 7.51.0-2.ph1
266
+  docker 1.11.0-5.ph1 -> 1.12.1-1.ph1
267
+  ...
268
+Added:
269
+  libssh2-1.8.0-1.ph1.x86_64
270
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot
271
+```
272
+
273
+Now if we want to see what packages have been updated and what issues have been fixed, just run at the host the command that we learned about in chapter 5.4.
274
+
275
+```
276
+root [ ~ ]# rpm-ostree db diff 56ef 396e
277
+ostree diff commit old: 56e (56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4)
278
+ostree diff commit new: 396 (396e1116ad94692b8c105edaee4fa12447ec3d8f73c7b3ade4e955163d517497)
279
+Upgraded:
280
+ bridge-utils-1.5-3.ph1.x86_64
281
+* Mon Sep 12 2016 Alexey Makhalov <amakhalov@vmware.com> 1.5-3
282
+-	Update patch to fix-2.
283
+
284
+ bzip2-1.0.6-6.ph1.x86_64
285
+* Fri Oct 21 2016 Kumar Kaushik <kaushikk@vmware.com> 1.0.6-6
286
+-       Fixing security bug CVE-2016-3189.
287
+
288
+ curl-7.51.0-2.ph1.x86_64
289
+* Wed Nov 30 2016 Xiaolin Li <xiaolinl@vmware.com> 7.51.0-2
290
+-   Enable sftp support.
291
+
292
+* Wed Nov 02 2016 Anish Swaminathan <anishs@vmware.com> 7.51.0-1
293
+-   	Upgrade curl to 7.51.0
294
+
295
+* Thu Oct 27 2016 Anish Swaminathan <anishs@vmware.com> 7.47.1-4
296
+-   	Patch for CVE-2016-5421
297
+
298
+* Mon Sep 19 2016 Xiaolin Li <xiaolinl@vmware.com> 7.47.1-3
299
+-   	Applied CVE-2016-7167.patch.
300
+
301
+ docker-1.12.1-1.ph1.x86_64
302
+* Wed Sep 21 2016 Xiaolin Li <xiaolinl@vmware.com> 1.12.1-1
303
+-   Upgraded to version 1.12.1
304
+
305
+* Mon Aug 22 2016 Alexey Makhalov <amakhalov@vmware.com> 1.12.0-2
306
+-   Added bash completion file
307
+
308
+* Tue Aug 09 2016 Anish Swaminathan <anishs@vmware.com> 1.12.0-1
309
+-   Upgraded to version 1.12.0
310
+
311
+* Tue Jun 28 2016 Anish Swaminathan <anishs@vmware.com> 1.11.2-1
312
+-   Upgraded to version 1.11.2
313
+...
314
+Added:
315
+ libssh2-1.8.0-1.ph1.x86_64
316
+``` 
317
+
318
+## 9.7 Composing for a different branch
319
+RPM-OSTree makes it very easy to create and update new branches, by composing using json config files that include the Refspec as the new branch name, the list of packages and the other settings we are now familiar with.  Photon OS 2.0 RPM-OSTRee Server installer adds two extra files photon-minimal.json and photon-full.json in addition to photon-base.json, that correspond almost identically to the minimal and full profiles installed via tdnf. It also makes 'photon-base' a smaller set of starter branch.  
320
+Of course, you can create your own config files for your branches with desired lists of packages. You may compose on top of the existing tree, or you can [start fresh your own OSTRee repo](Photon-RPM-OSTree-8-File-oriented-server-operations.md#81-starting-a-fresh-ostree-repo), using your own customized versioning.
0 321
new file mode 100644
... ...
@@ -0,0 +1,52 @@
0
+# Appendix
1
+
2
+## Photon 1.0 GA: systemd-networkd and systemd-resolved not starting in the updated image, on reboot
3
+This issue has been fixed in 1.0 Revision 2 and above.
4
+If you compose a custom image at the server, download at the RPM-OSTree host the updated image and reboot, systemd-networkd may report an access denied error, in which case your network interface is not properly configured, and ifconfig will not list an external IP address. This is a bug that was discovered very late and we didn't have time to address it for Photon 1.0. The easy workaround is to temporary relax the server permissions before  composing the tree (image) and revert back to the secure umask after that. Here are the steps to recover, that work even after you've already composed a "bad" image and some hosts have downloaded and booted into it:  
5
+At server:  
6
+  1. Execute **umask 022**.  
7
+  2. Execute **rpm-ostree compose tree --force-nocache ...** to create a new, good image.  
8
+  3. Execute **umask 027** to tighten back the server permissions as good security practice.  
9
+
10
+At every host that booted into the bad image, from console:  
11
+  1. Execute **rpm-ostree rollback**, then reboot into the older good image.  
12
+  2. Login after reboot, then execute **rpm-ostree upgrade** to download the new, good image from server. It's going to skip the bad image version.  
13
+  3. Reboot into new good image and execute ifconfig, notice you now have an external IP address. Also, your host will have the recommended secure umask 0027 set.
14
+ 
15
+## OSTree repo is no longer accessible via http after RPM-OSTree server has updated httpd package
16
+If server itself is updated via tdnf that brings a newer version of httpd package, httpd.service file will be overwritten to a default value (not valid for OSTree repo), and hosts trying to install or upgrade will report an "invalid or missing config".  To fix the problem:  
17
+
18
+* Replace the content of /usr/lib/systemd/system/httpd.service with:
19
+```
20
+[Unit]
21
+Description=The Apache HTTP Server
22
+After=network.target remote-fs.target nss-lookup.target
23
+
24
+[Service]
25
+Type=forking
26
+ExecStart=/usr/sbin/httpd -f /srv/rpm-ostree/ostree-httpd.conf -DFORGROUND
27
+ExecReload=/usr/sbin/httpd -f /srv/rpm-ostree/ostree-httpd.conf -k graceful
28
+KillSignal=SIGWINCH
29
+KillMode=mixed
30
+Restart=always
31
+
32
+[Install]
33
+WantedBy=multi-user.target
34
+```
35
+* systemctl daemon-reload
36
+* systemctl restart httpd
37
+
38
+## Error composing when photon-iso repo is selected
39
+If you are doing the trick explained in 9.3 to speed up composing by getting the RPMS from cdrom instead of the online repo, you may encounter an **error: cache too old:**. We are investigating - it could be an rpm-ostree bug or some incompatibility between the caching in tdnf vs. libhif used by ostree, but meanwhile just leave **"repos": ["photon"],** in photon-base.json.  
40
+  
41
+## Package differences between RPM-OSTree "minimal" and minimal installation profile
42
+This is not an actual issue, I'm only mentioning because of naming - people may expect that installing an RPM-OSTree host using the **photon/1.0/x86_64/minimal** reftag will create an exact equivalent, albeit read-only replica of the Photon minimal, when in fact you get fewer packages. That is because we were constrained by size of the starter ostree repo included on the cdrom, needed in order to install fast the server and the default host, yet still small enough for the ISO installer to run in 384 MB RAM in Fusion and Workstation, 512 MB in ESX.
43
+
44
+That's easy to overcome - just add the wanted package names in the photon-base.json and re-compose the tree.
45
+
46
+
47
+
48
+## Manual pages not included for installed packages
49
+The packages in photon-base.json don't have their manual pages installed. This is for the same reason - keep the cdrom included ostree repo size small. If the manual pages are desired, just change to true the **documentation** setting in photon-base.json and re-compose.
50
+
51
+
0 52
new file mode 100644
... ...
@@ -0,0 +1,193 @@
0
+# Install or rebase to Photon OS 2.0
1
+
2
+Photon OS 2.0 release has a different focus and while it provides full RPM-OSTree functionality (updated to 2017), it lets the user drive it, rather than provide a pre-defined solution as part of the installation.  
3
+
4
+The number of packages included in the RPMS repo in Photon OS 2.0 increased significantly, compared to 1.0. To keep the ISO at reasonable size, Photon OS 2.0 no longer includes the compressed ostree.repo file, that helped optimize both the server and host install in 1.0 or 1.0 Rev2. That decision affected the OSTree features we ship out of the box. Customer could achieve the same results by several additional simple steps, that will be explained in this chapter. In addition, there is a new way to create a host raw image at server.
5
+
6
+## 12.1 Installing an RPM-OSTree server
7
+Photon OS 2.0 installer contains an option to install an OSTree server, just like Photon 1.0 OS does. It will not run, however, the server 'compose tree' as part of installation, as most users will want to start from scratch to create their own image anyway, using different package set and customized settings.
8
+In addition to starter photon-base.json, we provide photon-minimal.json and photon-full.json, updated with a 2.0 Refspec. We still fire up an Apache web server, that will point to an empty site initially at the repo directory. Assuming you've customized photon-base.json to you liking, all you need to do is to run the commands you are already familiar with from [Chapter 9](Photon-RPM-OSTree-9-Package-oriented-server-operations.md).
9
+```
10
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2
11
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
12
+```
13
+Now if you point a browser to http://<server_IP_address>, you should see the familiar directory structure of an OSTree repo.
14
+
15
+## 12.2 Installing an RPM-OSTree host
16
+Photon OS 2.0 installer no longer includes a UI option to deploy a host manually - either against a default or a custom server repo, and also there is no official online Photon OS 2.0 OSTree repo published. This is now completely customer driven.  
17
+Automated host install is supported, as explained in [Chapter 7.2 Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#72-automated-install-of-a-custom-host-via-kickstart).  
18
+
19
+## 12.3 Rebasing a host from Photon 1.0 to 2.0
20
+If kickstart sounds too complicated and we still want to go the UI way like in 1.0, fortunately, there is a workaround that requires an extra step. Also, if you have an installed Photon 1.0 or 1.0 Rev2 that you want to carry to 2.0, you need to rebase it. Notice that I didn't say "upgrade".   
21
+
22
+Basically the OSTree repo will switch to a different branch on a different server, following the new server's branch versioning scheme. The net result is that the lots of packages will get changed to newer versions from newer OSTree repo, that has been composed from a newer Photon OS 2.0 RPMS repo. Again, I didn't say "upgraded", neither the rebase command output, that lists "changed" packages. Some obsolete packages will be removed, new packages will be added, either because they didn't exist in 1.0 repo, or because the new config file includes them.  
23
+The OS name is the same (Photon), so the content in /var and /etc will be transferred over.  
24
+
25
+1. To install fresh, deploy a Photon 1.0 Rev2 host default, as described in [Chapter 2](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md). Of course, if you already have an existing Photon OS 1.0 host that you want to move to 2.0, skip this step.
26
+2. Edit /ostree/repo/config and substitute the url, providing the IP address for the Photon OS 2.0 RPM-OSTree server installed above. This was explained in [Chapter 10](Photon-RPM-OSTree-10-Remotes.md#102-switching-repositories).  
27
+ostree should confirm that is the updated server IP for the "photon" remote.
28
+```
29
+root@ostree-host [ ~ ]# ostree remote show-url photon
30
+http://10.118.101.180
31
+```
32
+3. Rebase your host to the new 2.0 server and Refspec.
33
+```
34
+root@ostree-host [ ~ ]# rpm-ostree rebase photon/2.0/x86_64/minimal
35
+
36
+549 metadata, 2654 content objects fetched; 119853 KiB transferred in 17 seconds
37
+Copying /etc changes: 6 modified, 0 removed, 14 added
38
+Transaction complete; bootconfig swap: yes deployment count change: 1
39
+Deleting ref 'photon:photon/1.0/x86_64/minimal'
40
+Changed:
41
+  Linux-PAM 1.2.1-3.ph1 -> 1.3.0-1.ph2
42
+  attr 2.4.47-3.ph1 -> 2.4.47-4.ph2
43
+  autogen-libopts 5.18.7-2.ph1 -> 5.18.12-2.ph2
44
+  bash 4.3.30-4.ph1 -> 4.4-5.ph2
45
+  bc 1.06.95-3.ph1 -> 1.06.95-3.ph2
46
+  binutils 2.25.1-2.ph1 -> 2.29-3.ph2
47
+  bridge-utils 1.5-3.ph1 -> 1.6-1.ph2
48
+  bzip2 1.0.6-6.ph1 -> 1.0.6-8.ph2
49
+  ca-certificates 20160109-5.ph1 -> 20170406-3.ph2
50
+  coreutils 8.25-2.ph1 -> 8.27-2.ph2
51
+  cpio 2.12-2.ph1 -> 2.12-3.ph2
52
+  cracklib 2.9.6-2.ph1 -> 2.9.6-8.ph2
53
+  cracklib-dicts 2.9.6-2.ph1 -> 2.9.6-8.ph2
54
+  curl 7.51.0-2.ph1 -> 7.54.1-1.ph2
55
+  dbus 1.8.8-5.ph1 -> 1.11.12-1.ph2
56
+  device-mapper 2.02.141-5.ph1 -> 2.02.171-3.ph2
57
+  device-mapper-libs 2.02.141-5.ph1 -> 2.02.171-3.ph2
58
+  docker 1.12.1-1.ph1 -> 17.06.0-1.ph2
59
+  dracut 044-3.ph1 -> 045-4.ph2
60
+  dracut-tools 044-3.ph1 -> 045-4.ph2
61
+  elfutils-libelf 0.165-2.ph1 -> 0.169-1.ph2
62
+  expat 2.2.0-1.ph1 -> 2.2.0-2.ph2
63
+  file 5.24-2.ph1 -> 5.30-2.ph2
64
+  filesystem 1.0-8.ph1 -> 1.0-13.ph2
65
+  findutils 4.6.0-2.ph1 -> 4.6.0-3.ph2
66
+  flex 2.5.39-3.ph1 -> 2.6.4-2.ph2
67
+  glib 2.47.6-2.ph1 -> 2.52.1-2.ph2
68
+  glib-networking 2.46.1-2.ph1 -> 2.50.0-1.ph2
69
+  glibc 2.22-9.ph1 -> 2.26-1.ph2
70
+  gmp 6.0.0a-3.ph1 -> 6.1.2-2.ph2
71
+  gnutls 3.4.11-2.ph1 -> 3.5.10-1.ph2
72
+  gobject-introspection 1.46.0-2.ph1 -> 1.52.1-4.ph2
73
+  gpgme 1.6.0-2.ph1 -> 1.9.0-2.ph2
74
+  grep 2.21-2.ph1 -> 3.0-3.ph2
75
+  grub2 2.02-5.ph1 -> 2.02-9.ph2
76
+  gzip 1.6-2.ph1 -> 1.8-1.ph2
77
+  iana-etc 2.30-2.ph1 -> 2.30-2.ph2
78
+  iproute2 4.2.0-2.ph1 -> 4.10.0-3.ph2
79
+  iptables 1.6.0-5.ph1 -> 1.6.1-4.ph2
80
+  json-glib 1.0.4-2.ph1 -> 1.2.8-1.ph2
81
+  kmod 21-4.ph1 -> 24-3.ph2
82
+  krb5 1.14-4.ph1 -> 1.15.1-2.ph2
83
+  libarchive 3.1.2-7.ph1 -> 3.3.1-1.ph2
84
+  libassuan 2.4.2-2.ph1 -> 2.4.3-1.ph2
85
+  libcap 2.25-2.ph1 -> 2.25-7.ph2
86
+  libffi 3.2.1-2.ph1 -> 3.2.1-5.ph2
87
+  libgcc 5.3.0-3.ph1 -> 6.3.0-3.ph2
88
+  libgcrypt 1.6.5-2.ph1 -> 1.7.6-1.ph2
89
+  libgomp 5.3.0-3.ph1 -> 6.3.0-3.ph2
90
+  libgpg-error 1.21-2.ph1 -> 1.27-1.ph2
91
+  libgsystem 2015.1-2.ph1 -> 2015.2-1.ph2
92
+  librepo 1.7.17-2.ph1 -> 1.7.20-2.ph2
93
+  libselinux 2.5-2.ph1 -> 2.6-4.ph2
94
+  libsepol 2.5-2.ph1 -> 2.6-1.ph2
95
+  libsolv 0.6.19-2.ph1 -> 0.6.26-3.ph2
96
+  libsoup 2.53.90-2.ph1 -> 2.57.1-2.ph2
97
+  libssh2 1.8.0-1.ph1 -> 1.8.0-1.ph2
98
+  libstdc++ 5.3.0-3.ph1 -> 6.3.0-3.ph2
99
+  libtasn1 4.7-3.ph1 -> 4.10-1.ph2
100
+  libtool 2.4.6-2.ph1 -> 2.4.6-3.ph2
101
+  libxml2 2.9.4-3.ph1 -> 2.9.4-11.ph2
102
+  linux 4.4.41-1.ph1 -> 4.9.43-2.ph2
103
+  m4 1.4.17-2.ph1 -> 1.4.18-1.ph2
104
+  mkinitcpio 19-2.ph1 -> 23-3.ph2
105
+  mpfr 3.1.3-2.ph1 -> 3.1.5-1.ph2
106
+  ncurses 6.0-2.ph1 -> 6.0-10.ph2
107
+  net-tools 1.60-7.ph1 -> 1.60-10.ph2
108
+  nettle 3.2-2.ph1 -> 3.3-1.ph2
109
+  nspr 4.12-2.ph1 -> 4.15-1.ph2
110
+  nss-altfiles 2.19.1-2.ph1 -> 2.23.0-1.ph2
111
+  openssh 7.4p1-1.ph1 -> 7.5p1-4.ph2
112
+  openssl 1.0.2j-1.ph1 -> 1.0.2l-1.ph2
113
+  ostree 2015.7-5.ph1 -> 2017.5-1.ph2
114
+  pcre 8.39-1.ph1 -> 8.40-4.ph2
115
+  photon-release 1.0-6.ph1 -> 2.0-1.ph2
116
+  pkg-config 0.28-2.ph1 -> 0.29.2-1.ph2
117
+  popt 1.16-2.ph1 -> 1.16-4.ph2
118
+  procps-ng 3.3.11-3.ph1 -> 3.3.12-2.ph2
119
+  readline 6.3-4.ph1 -> 7.0-2.ph2
120
+  rpm-ostree 2015.7-2.ph1 -> 2017.5-1.ph2
121
+  sed 4.2.2-2.ph1 -> 4.4-2.ph2
122
+  shadow 4.2.1-8.ph1 -> 4.2.1-13.ph2
123
+  systemd 228-32.ph1 -> 233-7.ph2
124
+  util-linux 2.27.1-2.ph1 -> 2.29.2-3.ph2
125
+  vim 7.4-6.ph1 -> 8.0.0533-3.ph2
126
+  which 2.21-2.ph1 -> 2.21-3.ph2
127
+  xz 5.2.2-2.ph1 -> 5.2.3-2.ph2
128
+  zlib 1.2.8-3.ph1 -> 1.2.11-1.ph2
129
+Removed:
130
+  db-6.1.26-2.ph1.x86_64
131
+  e2fsprogs-1.42.13-2.ph1.x86_64
132
+  gdbm-1.11-2.ph1.x86_64
133
+  hawkey-2014.1-4.ph1.x86_64
134
+  iputils-20151218-3.ph1.x86_64
135
+  libhif-0.2.2-2.ph1.x86_64
136
+  lua-5.3.2-2.ph1.x86_64
137
+  nss-3.25-1.ph1.x86_64
138
+  python2-2.7.11-8.ph1.x86_64
139
+  python2-libs-2.7.11-8.ph1.x86_64
140
+  rpm-4.11.2-11.ph1.x86_64
141
+  sqlite-autoconf-3.11.0-2.ph1.x86_64
142
+  tcsh-6.19.00-4.ph1.x86_64
143
+Added:
144
+  bubblewrap-0.1.8-1.ph2.x86_64
145
+  bzip2-libs-1.0.6-8.ph2.x86_64
146
+  ca-certificates-pki-20170406-3.ph2.x86_64
147
+  curl-libs-7.54.1-1.ph2.x86_64
148
+  e2fsprogs-libs-1.43.4-2.ph2.x86_64
149
+  expat-libs-2.2.0-2.ph2.x86_64
150
+  fuse-2.9.7-2.ph2.x86_64
151
+  gnupg-2.1.20-2.ph2.x86_64
152
+  libdb-5.3.28-1.ph2.x86_64
153
+  libksba-1.3.5-1.ph2.x86_64
154
+  libltdl-2.4.6-3.ph2.x86_64
155
+  libseccomp-2.3.2-1.ph2.x86_64
156
+  ncurses-libs-6.0-10.ph2.x86_64
157
+  ncurses-terminfo-6.0-10.ph2.x86_64
158
+  npth-1.3-1.ph2.x86_64
159
+  nss-libs-3.31-2.ph2.x86_64
160
+  openssh-clients-7.5p1-4.ph2.x86_64
161
+  openssh-server-7.5p1-4.ph2.x86_64
162
+  pcre-libs-8.40-4.ph2.x86_64
163
+  pinentry-1.0.0-2.ph2.x86_64
164
+  rpm-libs-4.13.0.1-5.ph2.x86_64
165
+  sqlite-libs-3.19.3-1.ph2.x86_64
166
+  util-linux-libs-2.29.2-3.ph2.x86_64
167
+  xz-libs-5.2.3-2.ph2.x86_64
168
+
169
+root@ostree-host [ ~ ]# rpm-ostree status
170
+  TIMESTAMP (UTC)         VERSION           ID             OSNAME     REFSPEC                              
171
+  2017-08-31 18:19:36     2.0_minimal       f4497b1948     photon     photon:photon/2.0/x86_64/minimal
172
+* 2017-01-11 02:18:42     1.0_minimal.1     4a21972b29     photon     photon:photon/1.0/x86_64/minimal
173
+```
174
+That's it! You may now reboot to the new Photon OS 2.0 image. The updated ostree and rpm-ostree packages have a slightly changed output format:
175
+```
176
+root@ph2-ostree-host [ ~ ]# rpm-ostree status
177
+State: idle
178
+Deployments:
179
+* photon:photon/2.0/x86_64/minimal
180
+             Version: 2.0_minimal (2017-08-31 18:19:36)
181
+              Commit: f4497b194826adb0db6e17a6867df04edd1dc1ebe796a73db9f19b973b5658df
182
+
183
+  photon:photon/1.0/x86_64/minimal
184
+             Version: 1.0_minimal.1 (2017-01-11 02:18:42)
185
+              Commit: 4a21972b293978d39777017ccb33dde45713dd435b3cb77ee42161e7e849e5e4
186
+```
187
+
188
+There are some side effects of installing Photon OS 2.0 based on the skeleton of a 1.0. For one, the custom disk partitioning is not available in 1.0. There could be others, I cannot think of now.
189
+
190
+## 12.4 Creating a host raw image
191
+It is now possible to run at server a script that is part of RPM-OStree package, to create a host raw mage.
192
+
0 193
new file mode 100644
... ...
@@ -0,0 +1,80 @@
0
+# Photon RPM OSTree: a simple guide
1
+
2
+## Contents  
3
+***
4
+
5
+
6
+1. [Introduction](Photon-RPM-OSTree-1-Introduction.md)  
7
+  1. [What is OSTree? How about RPM-OSTree?](Photon-RPM-OSTree-1-Introduction.md#11-what-is-ostree-how-about-rpm-ostree)
8
+  1. [Why use RPM-OSTree in Photon?](Photon-RPM-OSTree-1-Introduction.md#12-why-use-rpm-ostree-in-photon)
9
+  1. [Photon with RPM-OSTree installation profiles](Photon-RPM-OSTree-1-Introduction.md#13-photon-with-rpm-ostree-installation-profiles)
10
+  1. [Terminology](Photon-RPM-OSTree-1-Introduction.md#14-terminology)
11
+  1. [Sample code](Photon-RPM-OSTree-1-Introduction.md#15-sample-code)
12
+  1. [How to read this book](Photon-RPM-OSTree:-1-Introduction#16-how-to-read-this-book)
13
+  1. [RPM-OSTree in Photon OS 2.0](Photon-RPM-OSTree:-1-Introduction#17-rpm-ostree-in-photon-os-20)
14
+2. [Installing a Photon RPM-OSTree host against default server repository](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md)  
15
+    1. [Who is this for?](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#21-who-is-this-for)
16
+    1. [Installing the ISO, step by step](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#22-installing-the-iso-step-by-step)
17
+3. [Concepts in action](Photon-RPM-OStree-3-Concepts-in-action.md)  
18
+    1. [Querying the deployed filetrees](Photon-RPM-OStree-3-Concepts-in-action.md#31-querying-the-deployed-filetrees)
19
+    1. [Bootable filetree version](Photon-RPM-OStree-3-Concepts-in-action.md#32-bootable-filetree-version)
20
+    1. [Commit ID](Photon-RPM-OStree-3-Concepts-in-action.md#33-commit-id)
21
+    1. [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#34-osname)
22
+    1. [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#35-refspec)
23
+    1. [Deployments](Photon-RPM-OStree-3-Concepts-in-action.md#36-deployments)
24
+4. [Querying for commit, file and package metadata](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md)  
25
+    1. [Commit history](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#41-commit-history)
26
+    1. [Listing file mappings](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#42-listing-file-mappings)
27
+    1. [Listing configuration changes](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#43-listing-configuration-changes)
28
+    1. [Listing packages](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#44-listing-packages)
29
+    1. [Querying for package details](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#45-querying-for-package-details)
30
+    1. [Why am I unable to install, update or delete packages?](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#46-why-am-i-unable-to-install-update-or-delete-packages)
31
+5. [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md)  
32
+    1. [Is it an update or an upgrade?](Photon-RPM-OSTree-5-Host-updating-operations.md#51-is-it-an-update-or-an-upgrade)
33
+    1. [Incremental upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#52-incremental-upgrade)
34
+    1. [Listing file differences](Photon-RPM-OSTree-5-Host-updating-operations.md#52-listing-file-differences)
35
+    1. [Listing package differences](Photon-RPM-OSTree-5-Host-updating-operations.md#52-listing-package-differences)
36
+    1. [Rollback](Photon-RPM-OSTree-5-Host-updating-operations.md#55-rollback)
37
+    1. [Deleting a deployed filetree](Photon-RPM-OSTree-5-Host-updating-operations.md#56-deleting-a-deployed-filetree)
38
+    1. [Version skipping upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#57-version-skipping-upgrade)
39
+    1. [Tracking parent commits](Photon-RPM-OSTree-5-Host-updating-operations.md#58-tracking-parent-commits)
40
+    1. [Resetting a branch to a previous commit](Photon-RPM-OSTree-5-Host-updating-operations.md#59-resetting-a-branch-to-a-previous-commit)
41
+6. [Installing a Photon RPM-OSTree server](Photon-RPM-OSTree-6-Installing-a-server.md)  
42
+7. [Installing a Photon RPM-OStree host against a custom server repository](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md)  
43
+    1. [Manual install of a custom host](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#71-manual-install-of-a-custom-host)
44
+    1. [Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#72-automated-install-of-a-custom-host-via-kickstart)
45
+8. [File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md)
46
+    1. [Starting a fresh OSTree repo](Photon-RPM-OStree-8-File-oriented-server-operations.md#81-starting-a-fresh-ostree-repo)
47
+    1. [Checking out a filetree](Photon-RPM-OStree-8-File-oriented-server-operations.md#82-checking-out-a-filetree)
48
+    1. [Committing changes to a filetree](Photon-RPM-OStree-8-File-oriented-server-operations.md#83-committing-changes-to-a-filetree)
49
+    1. [Downloading the changes at the host](Photon-RPM-OStree-8-File-oriented-server-operations.md#84-downloading-the-changes-at-the-host)
50
+    1. [Creating summary metadata](Photon-RPM-OStree-8-File-oriented-server-operations.md#85-creating-summary-metadata)
51
+9. [Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md)  
52
+    1. [JSON configuration file](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#91-json-configuration-file)
53
+    1. [Package addition, removal, upgrade](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#92-package-addition-removal-upgrade)
54
+    1. [RPMS repository](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#93-rpms-repository)
55
+    1. [Composing a tree](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#94-composing-a-tree)
56
+    1. [Automatic version prefix](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#95-automatic-version-prefix)
57
+    1. [Installing package updates](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#96-installing-package-updates)
58
+    1. [Creating server metadata](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#97-creating-server-metadata)
59
+    1. [Starting a fresh OSTree repo](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#98-starting-a-fresh-ostree-repo)
60
+10. [Remotes](Photon-RPM-OSTree-10-Remotes.md)  
61
+    1. [Listing remotes](Photon-RPM-OSTree-10-Remotes.md#101-listing-remotes)
62
+    1. [GPG signature verification](Photon-RPM-OSTree-10-Remotes.md#102-gpg-signature-verification)
63
+    1. [Switching repositories](Photon-RPM-OSTree-10-Remotes.md#103-switching-repositories)
64
+    1. [Adding and removing remotes](Photon-RPM-OSTree-10-Remotes.md#104-adding-and-removing-remotes)
65
+    1. [List available branches](Photon-RPM-OSTree-10-Remotes.md#105-list-available-branches)
66
+11. [Running container applications between bootable images](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md)  
67
+    1. [Downloading a docker container appliance](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#111-downloading-a-docker-container-appliance)
68
+    1. [Rebooting into an existing image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#112-rebooting-into-an-existing-image)
69
+    1. [Reboot into a newly created image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#113-reboot-into-a-newly-created-image)
70
+12. [Install or rebase to Photon OS 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md)  
71
+    1. [Installing an RPM-OSTree server](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#121-installing-an-rpm-ostree-server)
72
+    1. [Installing an RPM-OSTree host](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#122-installing-an-rpm-ostree-host)
73
+    1. [Rebasing a host from Photon 1.0 to 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#123-rebasing-a-host-from-photon-10-to-20)
74
+    1. [Creating a host raw image](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#124-creating-a-host-raw-image)
75
+
76
+[Appendix A: Known issues](Photon-RPM-OSTree-Appendix-A-Known-issues.md)  
77
+
78
+
79
+
0 80
new file mode 100644
... ...
@@ -0,0 +1,115 @@
0
+# Concepts in Action
1
+
2
+Now that we have a fresh installed host (either as [[default|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository]] or [[custom|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository]]), I can explain better the OStree concepts and see them in action.  
3
+## 3.1 Querying the deployed filetrees
4
+The first thing to do is to run a command that tells us what is installed on the machine and when. Since it's a fresh install from the CD, there is only one bootable filetree image deployed.
5
+``` 
6
+root@photon-host [ ~ ]# rpm-ostree status
7
+  TIMESTAMP (UTC)       VERSION       ID           OSNAME  REFSPEC               
8
+* 2016-06-07 14:06:17   1.0_minimal   56ef687f13   photon  photon:photon/1.0/x86_64/minimal
9
+```  
10
+## 3.2 Bootable filetree version
11
+**1.0_minimal** is not the Linux Photon OS release version, nor daily build, but rather a human readable, self-incrementing version associated with every commit that brings file/package updates. Think of this as version 0. The following versions are going to be 1.0_minimal.1, 1.0_minimal.2, 1.0_minimal.3 and so on.
12
+
13
+## 3.3 Commit ID
14
+The ID listed is actually the first 5 bytes (10 hex digits) of the commit hash. If you want to see the entire 32 bytes hex number, just add the 'pretty' formatting option. The .0 at the end means that this is the default bootable deployment. This will change to 1 when another deployment will take its place as the default.
15
+```
16
+root@photon-host [ ~ ]# rpm-ostree status -p
17
+============================================================
18
+  * DEFAULT ON BOOT
19
+----------------------------------------
20
+  version    1.0_minimal
21
+  timestamp  2016-06-07 14:06:17
22
+  id         56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0
23
+  osname     photon     
24
+  refspec    photon:photon/1.0/x86_64/minimal
25
+============================================================
26
+```
27
+## 3.4 OSname
28
+The OS Name identifies the operating system installed. All bootable filetrees for the same OS will share the /var directory, in other words applications installed in one booted image into this directory will be available in all other images.  
29
+If a new set of images are created for a different OS, they will receive a fresh copy of /var that is not shared with the previous OS images for the initial OS. In other words, if a machine is dual boot for different operating systems, they will not share each other's /var content, however they will still merge 3-way /etc.
30
+
31
+## 3.5 Refspec
32
+The **Refspec** is a branch inside the repo, expressed in a hierarchical way. In this case, it's the default branch that will receive package updates for the Photon OS 1.0 Minimal installation profile on Intel platforms. There could be other branches in the future, for example photon/1.0/x86_64/full that will match the Full installation profile (full set of packages installed).  
33
+Think of Refspec as the head of the minimal branch (just like in git) at the origin repo. On the replicated, local repo at the host, **minimal** is a file that contains the latest commit ID known for that branch.  
34
+```
35
+root@photon-host [ ~ ]# cat /ostree/repo/refs/remotes/photon/photon/1.0/x86_64/minimal 
36
+56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
37
+```
38
+Why are there two 'photon' directory levels in the remotes path? The **photon:** prefix in the Refspec listed by `rpm-ostree status` corresponds to the first **photon** directory in the remotes path and is actually the name given to the remote that the host is connected to, which points to an http or https URL. We'll talk about remotes later, but for now think of it as a namespace qualifier.  The second **photon** is part of the Refspec path itself.
39
+
40
+## 3.6 Deployments
41
+We've used so far `rpm-ostree`. The same information can be obtained running an `ostree` command:
42
+```
43
+root@photon-host [ ~ ]# ostree admin status
44
+* photon 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0
45
+    Version: 1.0_minimal
46
+    origin refspec: photon:photon/1.0/x86_64/minimal
47
+```
48
+But where is this information stored? As you may have guessed, the local repo stores the heads of the deployed trees - the most recent commitment ID, just like Git does:  
49
+```
50
+root@photon-host [ ~ ]# cat /ostree/repo/refs/heads/ostree/0/1/0 
51
+56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
52
+```
53
+This also where this command that lists the references (local heads and remotes) takes its data from:
54
+```
55
+root@photon-host [ ~ ]# ostree refs
56
+photon:photon/1.0/x86_64/minimal
57
+ostree/0/1/0
58
+```
59
+Based on that, it could find the root of the deployment that it boots from. The actual filetree is deployed right here:
60
+```
61
+root@photon-host [ ~ ]# ls -l /ostree/deploy/photon/deploy/56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0
62
+total 36
63
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 bin -> usr/bin
64
+drwxr-xr-x  4 root root 4096 Jan  1  1970 boot
65
+drwxr-xr-x  2 root root 4096 Jan  1  1970 dev
66
+drwxr-xr-x 33 root root 4096 Jun 12 23:04 etc
67
+lrwxrwxrwx  1 root root    8 Jun  9 18:26 home -> var/home
68
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 lib -> usr/lib
69
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 lib64 -> usr/lib
70
+lrwxrwxrwx  1 root root    9 Jun  9 18:26 media -> run/media
71
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 mnt -> var/mnt
72
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 opt -> var/opt
73
+lrwxrwxrwx  1 root root   14 Jun  9 18:26 ostree -> sysroot/ostree
74
+drwxr-xr-x  2 root root 4096 Jan  1  1970 proc
75
+lrwxrwxrwx  1 root root   12 Jun  9 18:26 root -> var/roothome
76
+drwxr-xr-x  2 root root 4096 Jan  1  1970 run
77
+lrwxrwxrwx  1 root root    8 Jun  9 18:26 sbin -> usr/sbin
78
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 srv -> var/srv
79
+drwxr-xr-x  2 root root 4096 Jan  1  1970 sys
80
+drwxr-xr-x  2 root root 4096 Jan  1  1970 sysroot
81
+lrwxrwxrwx  1 root root   11 Jun  9 18:26 tmp -> sysroot/tmp
82
+drwxr-xr-x 10 root root 4096 Jan  1  1970 usr
83
+drwxr-xr-x  7 root root 4096 Jun  9 18:26 var
84
+```  
85
+So how is a deployment linked to a specific branch, originating from a remote repo? Well, there is a file next to the deployed filetree root directory with the same name and **.origin** suffix, that contains exactly this info:
86
+```
87
+root@photon-host [ ~ ]# cat /ostree/deploy/photon/deploy/56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0.origin 
88
+[origin]
89
+refspec=photon:photon/1.0/x86_64/minimal
90
+```  
91
+Fast forwarding a bit, if there is a new deployment due to an upgrade or rebase, a new filetree will be added at the same level, and a new .origin file will tie it to the remote branch it originated from.  
92
+
93
+The **photon** directory in the path is the actual OSname. Multiple deployments of same OS will share a writable /var folder.  
94
+```
95
+root@photon-host [ ~ ]# ls -l /ostree/deploy/photon/var/
96
+total 52
97
+drwxr-xr-x  4 root root 4096 Jun  9 18:26 cache
98
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 home
99
+drwxr-xr-x 13 root root 4096 Jun  9 18:26 lib
100
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 local
101
+lrwxrwxrwx  1 root root   11 Jun  9 18:26 lock -> ../run/lock
102
+drwxr-xr-x  3 root root 4096 Jun  9 18:26 log
103
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 mail
104
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 mnt
105
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 opt
106
+drwx------  2 root root 4096 Jun 12 23:06 roothome
107
+lrwxrwxrwx  1 root root    6 Jun  9 18:26 run -> ../run
108
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 spool
109
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 srv
110
+drwxrwxrwt  4 root root 4096 Jun 12 23:04 tmp
111
+drwxr-xr-x 11 root root 4096 Jun  9 18:26 usrlocal
112
+```
113
+
114
+
0 115
new file mode 100644
... ...
@@ -0,0 +1,37 @@
0
+# File Oriented Server Operations
1
+
2
+In this chapter, we will checkout a filetree into a writable directory structure on disk, make several file changes and commit the changes back into the repository. Then we will download this commit and apply at the host. As you may have guessed, this chapter is mostly about OSTree - the base technology. I've not mentioned anything about packages, although it is quite possible to install packages (afler all, packages are made of files, right?) and commit without the help of rpm-ostree, but it's too much of a headache and not worth the effort, since rpm-ostree does it simpler and better.  
3
+
4
+When would you want to do that? When you want for all your hosts to get an application or configuration customization that is not encapsulated as part of a package upgrade.
5
+
6
+## 8.1 Starting a fresh OSTree repo  
7
+If you want to start fresh with your own branch and/or versioning scheme, you can delete the OSTree repo created during the Photon 1.0 RPM-OSTree server install and re-create it empty. For Photon OS 2.0 RPM-OSTree, this is a required step, as the installer will not create an OSTree repo for you, as you can see in 12.1.  
8
+```
9
+root [ /srv/rpm-ostree ]# rm -rf repo
10
+
11
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2
12
+
13
+root [ /srv/rpm-ostree ]# ls repo                                  
14
+config  objects  refs  state  tmp  uncompressed-objects-cache
15
+
16
+root [ /srv/rpm-ostree ]# cat repo/config
17
+[core]
18
+repo_version=1
19
+mode=archive-z2
20
+```
21
+
22
+## 8.2 Checking out a filetree
23
+[content to be added]
24
+
25
+## 8.3 Committing changes to a filetree
26
+[content to be added]
27
+
28
+## 8.4 Downloading the changes at the host
29
+[content to be added]
30
+
31
+## 8.5 Creating summary metadata
32
+A newer ostree feature, available in Photon OS 2.0 and higher, allows the OSTree server admin to create server summary metadata, that includes among other things the list of available branches and the list of static deltas, so they could be discovered by hosts. To create a summary, run this command after you committed for your branches:
33
+```
34
+root [ /srv/rpm-ostree ]# ostree summary -u "This is BigData's OSTree server, it has three branches"
35
+```  
36
+We will find out later how the [hosts query for branches list](Photon-RPM-OSTree-10-Remotes.md#105-list-available-branches). 
0 37
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+# Photon OS Documentation
1
+
2
+The Photon OS Documentation provides information about how to install, configure, and use VMware Photon OS&trade;.
3
+
4
+ ![PhotonOS Logo](photon-logo.png)
5
+
6
+**Product version: 1.0 and 2.0**
7
+
8
+This documentation applies to all 1.0.x and 2.0.x releases.
9
+
10
+## Intended Audiences
11
+
12
+This information is intended for Photon OS developers.
13
+
14
+----------
15
+
16
+Copyright &copy; 2016-2018 VMware, Inc. All rights reserved. [Copyright and trademark information](http://pubs.vmware.com/copyright-trademark.html). Any feedback you provide to VMware is subject to the terms at [www.vmware.com/community_terms.html](http://www.vmware.com/community_terms.html).
17
+
18
+**VMware, Inc.**<br>
19
+3401 Hillview Ave.<br>
20
+Palo Alto, CA 94304
21
+
22
+[www.vmware.com](http://www.vmware.com)
0 23
new file mode 100644
... ...
@@ -0,0 +1,49 @@
0
+# Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed
1
+
2
+After you have a configured the Photon Management Daemon (PMD) on multiple machines, you can remotely upgrade any installed package on these machines.
3
+
4
+Upgrade process uses `copenapi_cli` that is supported from both Lightwave and Photon Management Daemon. You can initiate the upgrade process from any machine that has Photon Management Daemon installed.   
5
+
6
+## Prerequisites
7
+
8
+- Have an installed Lightwave server with configured domain controller on it.
9
+- Have installed Lightwave clients that are joined to the domain.
10
+- Have installed Photon Management Daemon on the clients.
11
+
12
+## Procedure
13
+
14
+1. To initiate remote upgrade, log in to a Photon OS machine over SSH to install the Photon Management Daemon CLI.
15
+
16
+	`# tdnf install pmd-cli` 
17
+2. Edit the `copenapi_cli` spec files so that you can specify the machines you want to upgrade and credentials to be used.
18
+	1. Edit the `.netrc` file to specify machines to be upgraded and credentials for the PMD service.
19
+
20
+		`# vi ~/.netrc`  
21
+	3. In the file, enter the IP addresses for the machines and administrative credentials, save and close the file.
22
+
23
+		`# machine <IP-address> login <pmd-administrative-user> password <pmd-administrative user-password>`
24
+
25
+	1. (Optional) Get the location of the `restapispec.json` file.
26
+
27
+		`# cat ~/.copenapi`
28
+
29
+		This command returns `apispec=/root/restapispec.json` as path for the spec file.
30
+ 
31
+	3. Edit the `restapispec.json` file to enter the IP address of the machine to be upgraded.
32
+	
33
+		`# vi /root/restapispec.json`
34
+	4. Change the `host` value to the IP address or the hostname of the machine, leave the port number, and save and close the file.
35
+	
36
+		`"host":"<ip-address>:2081"` 
37
+	
38
+
39
+4. Initiate the upgrade, in this example of the `sed` package and wait for the command to complete.
40
+
41
+	Specify `-k` to force blind trust of certificates and `-n` to use the credentials from the `.netrc` file. 
42
+	`# copenapi_cli pkg update --packages sed -kn`
43
+
44
+5. (Optional) Verify that the package was upgraded successfully.
45
+	1. Log in to the machine that was upgraded over SSH.
46
+	2. List the installed version of the `sed` package.
47
+		
48
+		`# tdnf list installed sed`
0 49
\ No newline at end of file
1 50
new file mode 100644
... ...
@@ -0,0 +1,35 @@
0
+# Remotely Upgrade a Single Photon OS Machine With Lightwave Client and Photon Management Daemon Installed 
1
+
2
+After you have a configured the Photon Management Daemon on a machine, you can remotely upgrade any installed package on that machine. You can use the `root` user credentials.
3
+
4
+Upgrade process uses `pmd-cli` that is supported from both Lightwave and Photon Management Daemon. You can initiate the upgrade process from any machine that has Photon Management Daemon CLI installed.
5
+
6
+## Prerequisites
7
+
8
+- Have an installed Lightwave server with configured domain controller on it.
9
+- Have an installed Lightwave client that is joined to the domain.
10
+- Have an installed Photon Management Daemon on the client.
11
+- Have in installed Photon Management Daemon CLI (pmd-cli) on a machine from which you perform the updates.
12
+
13
+## Procedure
14
+
15
+1. To initiate remote upgrade, log in to a machine that has Photon Management Daemon CLI installed over SSH.
16
+2. Identify packages that can be upgraded on the client machine.
17
+	2. List the available updates for the machine.
18
+		
19
+		`# pmd-cli --server-name <machine-IP-address> --user root pkg list updates`
20
+	3. Verify the currently installed version of a package, for example `sed`.
21
+
22
+		`# `# pmd-cli --server-name <machine-IP-address> --user root pkg installed sed`
23
+		The installed version number shows as earlier than the one listed under the available updates.
24
+
25
+
26
+4. Initiate the upgrade, in this example of the `sed` package, enter password, and wait for the command to complete.
27
+ 
28
+	`# pmd-cli --server-name <machine-IP-address> --user root pkg update sed`
29
+
30
+5. (Optional) Verify that the client machine package was upgraded successfully.
31
+	1. Log in to the machine that was upgraded over SSH.
32
+	2. List the installed version of the `sed` package.
33
+		
34
+		`# pmd-cli --server-name <machine-IP-address> --user root pkg installed sed`
0 35
\ No newline at end of file
1 36
new file mode 100644
... ...
@@ -0,0 +1,46 @@
0
+# Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed
1
+
2
+After you have a configured the Photon Management Daemon (PMD) on multiple machines, you can remotely upgrade any installed package on these machines.
3
+
4
+Upgrade process uses `copenapi_cli` that is supported from both Lightwave and Photon Management Daemon. You can initiate the upgrade process from any machine that has Photon Management Daemon installed.   
5
+
6
+## Prerequisites
7
+
8
+- Have an installed Lightwave server with configured domain controller on it.
9
+- Have installed Lightwave clients that are joined to the domain.
10
+- Have installed Photon Management Daemon on the clients.
11
+
12
+## Procedure
13
+
14
+1. To initiate remote upgrade, log in to a Photon OS machine over SSH to install the Photon Management Daemon CLI.
15
+
16
+	`# tdnf install pmd-cli` 
17
+2. Edit the `copenapi_cli` spec files so that you can specify the machines you want to upgrade and credentials to be used.
18
+	1. Edit the `.netrc` file to specify machines to be upgraded and credentials for the PMD service.
19
+
20
+		`# vi ~/.netrc`  
21
+	2. In the file, enter the IP addresses for the machines and administrative credentials, save and close the file.
22
+
23
+		`# machine <IP-address> login <pmd-administrative-user> password <pmd-administrative user-password>`
24
+
25
+	3. Go to [https://raw.githubusercontent.com/vmware/pmd/master/conf/restapispec.json](https://raw.githubusercontent.com/vmware/pmd/master/conf/restapispec.json "the following link") and save the `restapispec.json` file locally to the `root` folder.
26
+
27
+ 
28
+	4. Edit the `restapispec.json` file to enter the IP address of the machine to be upgraded.
29
+	
30
+		`# vi /root/restapispec.json`
31
+	5. Change the `host` value to the IP address or the hostname of the machine, leave the port number, and save and close the file.
32
+	
33
+		`"host":"<ip-address>:2081"` 
34
+	
35
+
36
+4. Initiate the upgrade, in this example of the `sed` package and wait for the command to complete.
37
+
38
+	Specify `-k` to force blind trust of certificates and `-n` to use the credentials from the `.netrc` file. 
39
+	`# copenapi_cli pkg update  --packages sed -kn`
40
+
41
+5. (Optional) Verify that the client machine package was upgraded successfully.
42
+	1. Log in to the machine that was upgraded over SSH.
43
+	2. List the installed version of the `sed` package.
44
+		
45
+		`# tdnf list installed sed`
0 46
\ No newline at end of file
1 47
new file mode 100644
... ...
@@ -0,0 +1,35 @@
0
+# Remotely Upgrade a Single Photon OS Machine With Lightwave Client and Photon Management Daemon Installed
1
+
2
+After you have a configured the Photon Management Daemon on a machine, you can remotely upgrade any installed package on that machine. You can use the `root` user credentials.
3
+
4
+Upgrade process uses `pmd-cli` that is supported from both Lightwave and Photon Management Daemon. You can initiate the upgrade process from any machine that has Photon Management Daemon CLI installed.
5
+
6
+## Prerequisites
7
+
8
+- Have an installed Lightwave server with configured domain controller on it.
9
+- Have an installed Lightwave client that is joined to the domain.
10
+- Have an installed Photon Management Daemon on the client.
11
+- Have in installed Photon Management Daemon CLI (pmd-cli) on a machine from which you perform the updates.
12
+
13
+## Procedure
14
+
15
+1. To initiate remote upgrade, log in to a machine that has Photon Management Daemon CLI installed over SSH.
16
+2. Identify packages that can be upgraded on the client machine.
17
+	2. List the available updates for the machine.
18
+		
19
+		`# pmd-cli --server-name <machine-IP-address> --user root pkg list updates`
20
+	3. Verify the currently installed version of a package, for example `sed`.
21
+
22
+		`# `# pmd-cli --server-name <machine-IP-address> --user root pkg installed sed`
23
+		The installed version number shows as earlier than the one listed under the available updates.
24
+
25
+
26
+4. Initiate the upgrade, in this example of the `sed` package, enter password, and wait for the command to complete.
27
+ 
28
+	`# pmd-cli --server-name <machine-IP-address> --user root pkg update sed`
29
+
30
+5. (Optional) Verify that the client machine package was upgraded successfully.
31
+	1. Log in to the machine that was upgraded over SSH.
32
+	2. List the installed version of the `sed` package.
33
+		
34
+		`# pmd-cli --server-name <machine-IP-address> --user root pkg installed sed`
0 35
\ No newline at end of file
1 36
new file mode 100644
... ...
@@ -0,0 +1,262 @@
0
+# Running Photon OS on Amazon Elastic Cloud Compute
1
+
2
+This guide describes how to get Photon OS up and running on Amazon Web Services Elastic Cloud Compute (EC2), customize Photon with cloud-init, connect to it with SSH, and run a containerized application.
3
+ 
4
+## About Photon OS?
5
+Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see [https://vmware.github.io/photon/](#https://vmware.github.io/photon/).
6
+
7
+## Prerequisites
8
+
9
+Using Photon OS within AWS EC2 requires the following resources:
10
+
11
+- **AWS account**. Working with EC2 requires an Amazon account for AWS with valid payment information. Keep in mind that, if you try the examples in this document, you will be charged by Amazon. See [Setting Up with Amazon EC2](#http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/get-set-up-for-amazon-ec2.html).
12
+- **Amazon tools**. The following examples also assume that you have installed and configured the Amazon AWS CLI and the EC2 CLI and AMI tools, including ec2-ami-tools.
13
+
14
+See [Installing the AWS Command Line Interface](#http://docs.aws.amazon.com/cli/latest/userguide/installing.html), [Setting Up the Amazon EC2 Command Line Interface Tools on Linux](#http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html), and [Configuring AWS Command-Line Interface](#http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html). Also see [Setting Up the AMI Tools](#http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-up-ami-tools.html).
15
+This article uses an Ubuntu 14.04 workstation to generate the keys and certificates that AWS requires.
16
+
17
+## Downloading the Photon OS Image for Amazon
18
+
19
+VMware packages Photon OS as a cloud-ready Amazon machine image (AMI) that you can download for free from [Bintray](https://bintray.com/vmware/photon).
20
+
21
+Download the Photon OS AMI now and save it on your workstation. For instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
22
+
23
+**Note**: The AMI version of Photon is a virtual appliance with the information and packages that Amazon needs to launch an instance of Photon in the cloud. To build the AMI version, VMware starts with the minimal version of Photon OS and adds the sudo and tar packages to it. 
24
+
25
+## Getting Photon OS Up and Running on EC2
26
+
27
+To run Photon OS on EC2, you must use cloud-init with an EC2 data source. The cloud-init service configures the cloud instance of a Linux image. An _instance_ is a virtual server in the Amazon cloud. 
28
+
29
+The examples in this article show how to generate SSH and RSA keys for your Photon instance, upload the Photon OS `.ami` image to the Amazon cloud, and configure it with cloud-init. In many of the examples, you must replace information with your own paths, account details, or other information from Amazon. 
30
+
31
+### Step 1: Create a Key Pair
32
+
33
+The first step is to generate SSH keys on, for instance, an Ubuntu workstation: 
34
+
35
+	ssh-keygen -f ~/.ssh/mykeypair
36
+
37
+The command generates a public key in the file with a `.pub` extension and a private key in a file with no extension. Keep the private key file and remember the name of your key pair; the name is the file name of the two files without an extension. You'll need the name later to connect to the Photon instance.
38
+
39
+Change the mode bits of the public key pair file to protect its security. In the command, include the path to the file if you need to. 
40
+
41
+	chown 600 mykeypair.pub
42
+
43
+Change the mode bits on your private key pair file so that only you can view it:
44
+
45
+	chmod 400 mykeypair
46
+
47
+To import your public key pair file (but not your private key pair file), connect to the EC2 console at https://console.aws.amazon.com/ec2/ and select the region for the key pair. A key pair works in only one region, and the instance of Photon that will be uploaded later must be in the same region as the key pair. Select `key pairs` under `Network & Security`, and then import the public key pair file that you generated earlier. 
48
+
49
+For more information, see [Importing Your Own Key Pair to Amazon EC2](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws).
50
+
51
+### Step 2: Generate a Certificate
52
+
53
+When you bundle up an image for EC2, Amazon requires an RSA user signing certificate. You create the certificate by using openssl to first generate a private RSA key and then to generate the RSA certificate that references the private RSA key. Amazon uses the pairing of the private key and the user signing certificate for  handshake verification. 
54
+
55
+First, on Ubuntu 14.04 or another workstation that includes openssl, run the following command to generate a private key. If you change the name of the key, keep in mind that you will need to include the name of the key in the next command, which generates the certificate. 
56
+
57
+	openssl genrsa 2048 > myprivatersakey.pem
58
+
59
+Remember where you store your private key locally; you'll need it again later. 
60
+
61
+Second, run the following command to generate the certificate. The command prompts you to provide more information, but because you are generating a user signing certificate, not a server certificate, you can just type `Enter` for each prompt to leave all the fields blank. 
62
+
63
+	openssl req -new -x509 -nodes -sha256 -days 365 -key myprivatersakey.pem -outform PEM -out certificate.pem
64
+
65
+For more information, see the Create a Private Key and the Create the User Signing Certificate sections of [Setting Up the AMI Tools](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-up-ami-tools.html#ami-upload-bundle).
66
+
67
+Third, upload to AWS the certificate value from the `certificate.pem` file that you created in the previous command. Go to the Identity and Access Management console at https://console.aws.amazon.com/iam/, navigate to the name of your user, open the `Security Credentials` section, click `Manage Signing Certificates`, and then click `Upload Signing Certificate`. Open `certificate.pem` in a text editor, copy and paste the contents of the file into the `Certificate Body` field, and then click `Upload Signing Certificate`.
68
+
69
+For more information, see the Upload the User Signing Certificate section of [Setting Up the AMI Tools](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-up-ami-tools.html#ami-upload-bundle).
70
+
71
+### Step 3: Create a Security Group
72
+
73
+The next prerequisite is to create a security group and set it to allow SSH, HTTP, and HTTPS connections over ports 22, 80, and 443, respectively. Connect to the EC2 command-line interface and run the following commands: 
74
+
75
+	aws ec2 create-security-group --group-name photon-sg --description "My Photon security group"
76
+	{
77
+	    "GroupId": "sg-d027efb4"
78
+	}
79
+	aws ec2 authorize-security-group-ingress --group-name photon-sg --protocol tcp --port 22 --cidr 0.0.0.0/0
80
+
81
+The `GroupId` is returned by EC2. Write it down; you'll need it later.
82
+
83
+By using `0.0.0.0/0` for SSH ingress on Port 22, you are opening the port to all IP addresses--which is not a security best practice but a convenience for the examples in this article. For a production instance or other instances that are anything more than temporary machines, you should authorize only a specific IP address or range of addresses. See Amazon's document on [Authorizing Inbound Traffic for Linux Instances](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html).
84
+
85
+Repeat the command to allow incoming traffic on Port 80 and on Port 443: 
86
+
87
+	aws ec2 authorize-security-group-ingress --group-name photon-sg --protocol tcp --port 80 --cidr 0.0.0.0/0
88
+
89
+	aws ec2 authorize-security-group-ingress --group-name photon-sg --protocol tcp --port 443 --cidr 0.0.0.0/0
90
+
91
+Check your work: 
92
+
93
+	aws ec2 describe-security-groups --group-names photon-sg
94
+
95
+### Step 4: Extract the Tarball 
96
+
97
+Next, make a directory to store the image, and then extract the Photon OS image from its archive by running the following `tar` command. (You might have to change the file name to match the version you have.)    
98
+
99
+	mkdir bundled
100
+	tar -zxvf ./photon-ami.tar.gz
101
+
102
+### Step 5: Bundle the Image
103
+
104
+The next step is to run the `ec2-bundle-image` command to create an instance store-backed Linux AMI from the Photon OS image that you extracted in the previous step. The result of the `ec2-bundle-image` command is a manifest that describes the machine in an XML file. 
105
+
106
+The command uses the certificate path to your PEM-encoded RSA public key certificate file; the path to your PEM-encoded RSA private key file; your EC2 user account ID; the correct architecture for Photon OS; the path to the Photon OS AMI image extracted from its tar file; and the `bundled` directory from the previous step. 
107
+
108
+You must replace the values of the certificate path, the private key, and the user account with your own values.
109
+
110
+	$ ec2-bundle-image --cert certificate.pem --privatekey myprivatersakey.pem --user <EC2 account id>  --arch x86_64 --image photon-ami.raw --destination ./bundled/
111
+
112
+### Step 6: Put the Bundle in a Bucket
113
+
114
+Next, make an S3 bucket, replacing `<bucket-name>` with the name that you want. The command creates the bucket in the region specified in your Amazon configuration file, which should be the same region in which you are using your key pair file: 
115
+
116
+	$ aws s3 mb s3://<bucket-name>
117
+
118
+Now upload the bundle to the Amazon S3 cloud. The following command includes the path to the XML file containing the manifest for the Photon OS machine created during the previous step, though you might have to change the file name to match the version you have. The manifest file is typically located in the same directory as the bundle. 
119
+
120
+The command also includes the name of the Amazon S3 bucket in which the bundle is to be stored; your AWS access key ID; and your AWS secret access key.
121
+
122
+	$ ec2-upload-bundle --manifest ./bundled/photon-ami.manifest.xml --bucket <bucket-name> --access-key <Account Access Key> --secret-key <Account Secret key>
123
+
124
+### Step 7: Register the Image
125
+
126
+The final step in creating an AMI before you can launch it is to register it. The following command includes a name for the AMI, its architecture, and its virtualization type. The virtualization type for Photon OS is `hvm`.
127
+
128
+	$ ec2-register <bucket-name>/photon-ami.manifest.xml --name photon-ami --architecture x86_64 --virtualization-type hvm
129
+
130
+Once registered, you can launch as many new instances as you want.
131
+
132
+### Step 8: Run an Instance of the Image with Cloud-Init
133
+
134
+Now things get a little tricky. In the following command, the `user-data-file` option instructs cloud-init to import the cloud-config data in `user-data.txt`.  
135
+
136
+The command also includes the ID of the AMI, which you can obtain by running `ec2-describe-images`; the instance type of `m3.medium`, which is a general purpose instance type; and the name of key pair, which should be replaced with your own--otherwise, you won't be able to connect to the instance. 
137
+
138
+Before you run the command, change directories to the directory containing the `mykeypair` file and add the path to the `user-data.txt`. 
139
+
140
+	$ ec2-run-instances <ami-ID> --instance-type m3.medium -g photon-sg --key mykeypair --user-data-file user-data.txt
141
+
142
+Here are the contents of the `user-data.txt` file that cloud-init applies to the machine the first time it boots up in the cloud.  
143
+
144
+	#cloud-config
145
+	hostname: photon-on-01
146
+	groups:
147
+	- cloud-admins
148
+	- cloud-users
149
+	users:
150
+	- default
151
+	- name: photonadmin
152
+	   gecos: photon test admin user
153
+	   primary-group: cloud-admins
154
+	   groups: cloud-users
155
+	   lock-passwd: false
156
+	   passwd: vmware
157
+	- name: photonuser
158
+	   gecos: photon test user
159
+	   primary-group: cloud-users
160
+	   groups: users
161
+	   passwd: vmware
162
+	packages:
163
+	- vim
164
+
165
+### Step 9: Get the IP Address of Your Image
166
+
167
+Now run the following command to check on the state of the instance that you launched: 
168
+
169
+	$ ec2-describe-instances
170
+
171
+Finally, you can obtain the external IP address of the instance by running the following query: 
172
+
173
+	$ aws ec2 describe-instances --instance-ids <instance-id> --query 'Reservations[*].Instances[*].PublicIpAddress' --output=text
174
+
175
+If need be, check the cloud-init output log file on EC2 at `/var/log/cloud-init-output.log` to see how EC2 handled the settings in the cloud-init data file. 
176
+
177
+For more information on using cloud-init user data on EC2, see [Running Commands on Your Linux Instance at Launch](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html).
178
+
179
+## Deploy a Containerized Application in Photon OS
180
+
181
+This section shows you how to connect to the Photon instance by using SSH and to launch a web server by running it in Docker.
182
+
183
+### Step 1: Connect with SSH
184
+
185
+Connect to the instance over SSH by specifying the private key (.pem) file and the user name for the Photon machine, which is `root`:
186
+
187
+	ssh -i ~/.ssh/mykeypair root@<public-ip-address-of-instance>
188
+
189
+For complete instructions, see [Connecting to Your Linux Instance Using SSH](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html). 
190
+
191
+### Step 2: Run Docker
192
+
193
+On the minimal version of Photon OS, the docker engine is enabled and running by default, which you can see by running the following command: 
194
+
195
+	systemctl status docker
196
+
197
+### Step 3: Start the Web Server
198
+
199
+**Note**: Please make sure that the proper security policies have been enabled on the Amazon AWS side to enable traffic to port 80 on the VM. 
200
+
201
+Since Docker is running, you can run an application in a container--for example, the Nginx Web Server. This example uses the popular open source web server Nginx. The Nginx application has a customized VMware package that the Docker engine can download directly from the Docker Hub.
202
+
203
+To pull Nginx from its Docker Hub and start it, run the following command: 
204
+
205
+	docker run -p 80:80 vmwarecna/nginx
206
+
207
+The Nginx web server should be bound to the public DNS value for  the instance of Photon OS--that is, the same address with which you connected over SSH. 
208
+
209
+### Step 4: Test the Web Server
210
+
211
+On your local workstation, open a web browser and go to the the public address of the Photon OS instance running Docker. The following screen should appear, showing that the web server is active:
212
+
213
+![Nginx](images/Nginx.jpg)
214
+
215
+When you're done, halt the Docker container by typing `Ctrl+c` in the SSH console where you are connected to EC2. 
216
+
217
+You can now run other containerized applications from the Docker Hub or your own containerized application on Photon OS in the Amazon cloud. 
218
+
219
+## Launching the Web Server with Cloud-Init
220
+
221
+To eliminate the manual effort of running Docker, you can add `docker run` and its arguments to the cloud-init user data file by using `runcmd`: 
222
+
223
+	#cloud-config
224
+	hostname: photon-on-01
225
+	groups:
226
+	- cloud-admins
227
+	- cloud-users
228
+	users:
229
+	- default
230
+	- name: photonadmin
231
+	   gecos: photon test admin user
232
+	   primary-group: cloud-admins
233
+	   groups: cloud-users
234
+	   lock-passwd: false
235
+	   passwd: vmware
236
+	- name: photonuser
237
+	   gecos: photon test user
238
+	   primary-group: cloud-users
239
+	   groups: users
240
+	   passwd: vmware
241
+	packages:
242
+	- vim
243
+	runcmd:
244
+	- docker run -p 80:80 vmwarecna/nginx
245
+
246
+To try this addition, you'll have to run another instance with this new cloud-init data source and then get the instance's public IP address to check that the Nginx web server is running. 
247
+
248
+## Terminating the AMI Instance
249
+
250
+Because Amazon charges you while the instance is running, make sure to shut it down when you're done.  
251
+
252
+First, get the ID of the AMI so you can terminate it: 
253
+
254
+	$ ec2-describe-instances
255
+
256
+Finally, terminate the Photon OS instance by running the following command, replacing the placeholder with the ID that the `ec2-describe-images` command returned. If you ran a second instance of Photon OS with the cloud-init file that runs docker, terminate that instance, too. 
257
+
258
+	$ ec2-terminate-instances <instance-id>
259
+
260
+
261
+
0 262
new file mode 100644
... ...
@@ -0,0 +1,117 @@
0
+# Running Photon OS on Google Compute Engine
1
+
2
+This guide describes how to get started using Photon OS as a virtual machine on Google Compute Engine (GCE). Once Photon OS is installed as an image on GCE, this document shows how to deploy a containerized application in Docker with a single command.
3
+
4
+- [About Photon OS](#about-photon-os)
5
+- [Prerequisites for Photon OS on GCE](#prerequisites-for-photon-os-on-gce)
6
+- [Downloading Photon OS](#downloading-photon-os)
7
+- [Installing Photon OS on Google Compute Engine](#installing-photon-os-on-google-compute-engine)
8
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
9
+
10
+## About Photon OS
11
+
12
+Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see  [https://vmware.github.io/photon/](https://vmware.github.io/photon/).
13
+
14
+## Prerequisites for Photon OS on GCE
15
+
16
+Using Photon OS on Google Compute Engine requires the following resources:
17
+
18
+* An account on Google Compute Engine
19
+* The Google Cloud SDK
20
+* The Photon OS image for GCE
21
+
22
+Keep in mind that, if you try the examples in this document, Google will charge your account for the cloud services that you use. The GCE-ready version of Photon OS, however, comes for free.
23
+
24
+## Downloading Photon OS
25
+
26
+VMware recommends that administrators use the Photon OS image for Google Compute Engine (GCE) to create Photon OS instances on GCE. Although earlier releases of Photon OS required heavy modification of the Photon instance to make the image compatible with GCE, Photon OS 1.0 comes with pre-modified images for popular cloud providers, including GCE.
27
+
28
+You can download the Photon OS image for GCE from the following URL:
29
+
30
+[https://bintray.com/vmware/photon](https://bintray.com/vmware/photon)
31
+
32
+For instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
33
+
34
+## Installing Photon OS on Google Compute Engine
35
+
36
+After you download the Photon OS image for GCE, log into GCE and complete the following steps.
37
+
38
+### Step 1: Create a New Bucket
39
+
40
+Create a new bucket to store your Photon OS image for GCE.
41
+
42
+![gce1](images/gce1.jpg)
43
+
44
+### Step 2: Upload the Photon OS Image
45
+
46
+Once you’ve created the bucket, you’re ready to upload the Photon OS image. While viewing the bucket that you’ve created, click the `Upload files` button, navigate to your Photon OS image and click the `Choose` button. 
47
+
48
+As the image below shows, when the upload finishes, you should see your Photon OS compressed image in the file list for the bucket that you created.
49
+
50
+![gce2](images/gce2.jpg)
51
+
52
+### Step 3: Create a New Image
53
+
54
+Next, you need to create a new image. Click on `Images` in the `Compute` category in the left panel; then, click on the `New Image` button. 
55
+
56
+Enter a name for the image in the `Name` field and change the `Source` to `Cloud Storage file` using the pull-down menu. Then, in the `Cloud Storage file` field, enter the bucket name and filename as the path to the Photon OS image for GCE. In this example, where the bucket was named `photon_storage,` the path is as follows:
57
+ 
58
+	photon_storage/photon-gce-2.0-tar.gz
59
+
60
+*Note: The new image form will autopopulate the `gs://` file path prefix.*
61
+
62
+After you’re finished completing the name and Cloud Storage object path, click the `Create` button to create your image. You should be returned to your Images catalog and your Photon OS image should be at the top of the list. 
63
+
64
+### Step 4: Create a New Instance
65
+
66
+To create an instance, check the box next to the Photon OS image and click the `Create Instance` button. 
67
+
68
+On the `Create a new instance` form, provide a name for this instance, confirm the zone into which this instance is to be deployed and, before clicking `Create,` place a check in the boxes for `Allow HTTP traffic` and `Allow HTTPS traffic.` 
69
+
70
+Outside of this demo, your application may or may not require these firewall rules. Please choose accordingly outside of this demo. However, since we will demonstrate a running web server container, we want these ports to be open for our instance. 
71
+
72
+![gce4](images/gce4.jpg)
73
+
74
+When the instance is created you will be returned to your list of VM instances. If you click on the instance, the status page for the instance will allow you to SSH into your Photon OS environment using the SSH button at the top of the panel. 
75
+
76
+At this point, your instance is running and you are ready to start the Docker engine and run a container workload.
77
+
78
+## Deploying a Containerized Application in Photon OS
79
+
80
+Now that you have your container runtime environment up and running, you can easily deploy a containerized application. For this example, you will deploy the popular open source Web Server Nginx. The Nginx application has a customized VMware package that is published as a dockerfile and can be downloaded directly through the Docker module from the Docker Hub.
81
+
82
+### Step 1: Run Docker
83
+
84
+To run Docker from the command prompt, enter the command below to initialize the Docker engine:
85
+
86
+    systemctl start docker
87
+
88
+To ensure Docker daemon service runs on every subsequent VM reboot, enter:
89
+ 
90
+    systemctl enable docker
91
+
92
+### Step 2: Run the Nginx Web Server
93
+
94
+Now that the Docker daemon service is running, it is a simple task to pull and then start the Nginx Web Server container from Docker Hub.  To do this, type the following command:
95
+ 
96
+    docker run -d -p 80:80 vmwarecna/nginx
97
+
98
+This command pulls the Nginx Web Server files and the dependent containers to ensure this containerized application can run.  You will see a screenshot similar to the one below, as the container and dependencies are downloaded and the container is prepared to run:
99
+
100
+![gce5](images/gce5.jpg)
101
+
102
+Once the `docker run` process is completed, you will be returned to the command prompt.  You now have a fully active website up and running through typing just a single command within Photon OS using containers.
103
+
104
+### Step 3: Test the Web Server
105
+
106
+**Note** : Please make sure that the proper security policies have been enabled on the Google GCE side to enable traffic to port 80 on the VM.
107
+
108
+To test that your web server is active, we need to get the IP address of the Photon OS virtual machine. To get the IP address, enter the following command:
109
+
110
+This command displays a list of network adapters connected to the virtual machine. Typically, the web server daemon will be bound to `eth0;` record the IP address associated with `eth0.` Alternatively, visit the status page of your Photon OS instance in GCE where the IP address is listed under `External IP.`
111
+
112
+Start a browser on your host machine and enter the IP address of your Photon OS virtual machine. The following screen should appear, showing that your web server is active:
113
+
114
+![gce6](images/gce6.jpg)
115
+
116
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
0 117
new file mode 100644
... ...
@@ -0,0 +1,247 @@
0
+# Running Photon OS on Microsoft Azure
1
+
2
+Photon OS can serve as a run-time environment for Linux containers on Microsoft Azure. This topic describes how to set up and run the cloud-ready version of Photon OS as an instance of a virtual machine in the Azure cloud. Once running, Docker can run a containerized application in the Photon OS instance.
3
+
4
+**Note:** These instructions apply to Photon OS 2.0. There is no Photon OS 1.0 distribution image for Microsoft Azure.
5
+
6
+- [About Photon OS](#about-photon-os)
7
+- [Prerequisites](#prerequisites)
8
+- [Downloading and Extracting the Photon OS VHD File](#downloading-and-extracting-the-photon-os-vhd-file)
9
+- [Setting Up Azure Storage and Uploading the VHD](#setting-up-azure-storage-and-uploading-the-vhd)
10
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
11
+
12
+# About Photon OS
13
+
14
+Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see  [https://vmware.github.io/photon/](https://vmware.github.io/photon/).
15
+
16
+# Prerequisites
17
+
18
+- Microsoft Azure account ([sign up](https://azure.microsoft.com) if you don&#39;t already have one)
19
+- Azure CLI 2.0 (install the latest version) - see  [Install Azure CLI 2.0](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) and  [Get started with Azure CLI 2.0](https://docs.microsoft.com/en-us/cli/azure/get-started-with-azure-cli?view=azure-cli-latest).
20
+- Pair of SSH public / private keys
21
+
22
+# Downloading and Extracting the Photon OS VHD File
23
+
24
+VMware packages Photon OS as a cloud-ready virtual hard disk (VHD file) that you can download for free from  [Bintray](https://bintray.com/vmware/photon). This VHD file is a virtual appliance with the information and packages that Azure needs to launch an instance of Photon in the cloud. After you have downloaded the distribution archive, extract the VHD file from it. You will later need to upload this VHD file to Azure, where it will be stored in an Azure storage account. For download instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
25
+
26
+# Setting Up Azure Storage and Uploading the VHD
27
+
28
+You can use either the Azure Portal or the Azure CLI to set up your Azure storage space, upload the Photon OS VHD file, and create the Photon OS VM.
29
+
30
+## Setting Up Using the Azure Portal
31
+
32
+You can use the Azure portal to set up Photon OS 2.0 in the Azure cloud. The following instructions are brief. Refer to the Azure documentation for details.
33
+
34
+1. Log in to the Azure portal at  [http://portal.azure.com](http://portal.azure.com/).
35
+2. Create a resource group. In the toolbar, choose Resource Groups, click **+Add** , fill in the resource group fields, and choose **Create**.
36
+3. Create a storage account. In the toolbar, choose Storage Accounts, click **+Add** , fill in the storage account fields (and the resource group you just created), and choose **Create**.
37
+4. Select the storage account.
38
+5. Scroll down the storage account control bar, click Containers (below BLOB SERVICE), click **+Container** , fill in the container fields, and choose **Create**.
39
+6. Select the container you just created.
40
+7. Click **Upload** and upload the Photon OS VHD image file to this container.
41
+8. Once the VHD file is uploaded, refer to the Azure documentation for instructions on how to create and manage your Photon OS VM.
42
+
43
+## Setting Up Using the Azure CLI
44
+
45
+You can use the Azure CLI 2.0 to set up Photon OS. You must first  [Install Azure CLI 2.0](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).
46
+
47
+**Note:**  Except where overridden with parameter values, these commands create objects with default settings.
48
+
49
+### Step 1: Create a Resource Group
50
+
51
+From the Azure CLI, create a resource group.
52
+````
53
+az group create \
54
+ --name &lt;your_resource_group&gt; \
55
+ --location westus
56
+````
57
+
58
+### Step 2: Create a Storage Account
59
+
60
+Create a storage account associated with this resource group.
61
+````
62
+az storage account create \
63
+    --resource-group &lt;your_resource_group&gt; \
64
+    --location westus \
65
+    --name &lt;your_account_name&gt; \
66
+    --kind Storage \
67
+    --sku Standard_LRS
68
+````
69
+### Step 3: List the Keys for the Storage Account
70
+
71
+Retrieve the keys associated with your newly created storage account.
72
+````
73
+az storage account keys list \
74
+    --resource-group &lt;your_resource_group&gt; \
75
+    --account-name &lt;your_account_name&gt;
76
+````
77
+### Step 4: Create the Storage Container
78
+
79
+Create a storage container associated with your newly created storage account.
80
+
81
+**Note:** The sample create.sh script, described below, does this for you programmatically.
82
+````
83
+az storage container create \
84
+    --account-name &lt;your_account_name&gt; \
85
+    --name &lt;your_container_name&gt;
86
+````
87
+### Step 5: Verify Your Setup in the Azure Portal
88
+
89
+1. Log into the Azure portal using your account credentials.
90
+2. From the left toolbar, click **Storage Accounts**. You should see your storage accounts.
91
+3. Select the storage account.
92
+4. Scroll down the storage account control bar and click **Containers** (below BLOB SERVICE). You should see the container you created.
93
+
94
+### Step 6: Upload the Photon OS Distribution to Your Storage Container
95
+
96
+The Photon OS distribution for Azure is 16GB. You can download it locally or to a mounted, shared location.
97
+````
98
+az storage blob upload \
99
+    --account-name &lt;your_account_name&gt; \
100
+    --account-key &lt;your_account_key&gt; \
101
+    --container-name &lt;your_container_name&gt; \
102
+    --type page \
103
+    --file &lt;vhd_path&gt; \
104
+    --name &lt;vm_name&gt;.vhd
105
+````
106
+### Example Setup Script
107
+
108
+You can use the following script (create.sh) to upload your VHD file programmatically and create the VM. Before you run it, specify the following settings:
109
+
110
+- resource_group name
111
+- account_name
112
+- account_key (public or private)
113
+- container_name
114
+- public_key_file
115
+- vhd_path and and vm_name of the Photon OS VHD distribution file
116
+
117
+This script returns the complete IP address of the newly created VM.
118
+````
119
+#!/bin/bash
120
+vhd_path=$1
121
+vm_name=$2
122
+export PATH=$PATH:/root/azure_new/bin/az
123
+echo PATH=$PATH
124
+resource_group=&quot;&quot;
125
+account_name=&quot;&quot;
126
+account_key=&quot;&quot;
127
+container_name=&quot;mydisks&quot;
128
+url=&quot;https://${account_name}.blob.core.windows.net/${container_name}/${vm_name}.vhd&quot;
129
+public_key_file=&quot;/root/azure_new/jenkins.pub&quot;
130
+echo &quot;########################&quot;
131
+echo &quot;#   Create container   #&quot;
132
+echo &quot;########################&quot;
133
+/root/azure_new/bin/az storage container create --account-name ${account_name} --name ${container_name}
134
+echo &quot;##################&quot;
135
+echo &quot;#   Upload vhd   #&quot;
136
+echo &quot;##################&quot;
137
+/root/azure_new/bin/az storage blob upload --account-name ${account_name} \
138
+    --account-key ${account_key} \
139
+    --container-name ${container_name} \
140
+    --type page \
141
+    --file ${vhd_path} \
142
+    --name ${vm_name}.vhd
143
+echo &quot;##################&quot;
144
+echo &quot;#   Create vm    #&quot;
145
+echo &quot;##################&quot;
146
+echo &quot;az vm create --resource-group ${resource_group} --location westus --name ${vm_name} --storage-account ${account_name} --os-type linux --admin-username michellew --ssh-key-value ${public_key_file} --image ${url} --use-unmanaged-disk ... ...&quot;
147
+/root/azure_new/bin/az vm create --resource-group ${resource_group} --location westus --name ${vm_name} --storage-account ${account_name} --os-type linux --admin-username michellew --ssh-key-value ${public_key_file} --image ${url} --use-unmanaged-disk
148
+````
149
+### Removing Photon OS from Azure
150
+
151
+You can use the following delete.sh script to programmatically (and silently) remove the VM instance, VHD file, and container.
152
+
153
+**Note:**  Consider deleting idle VMs so that you are not charged when not in use.
154
+
155
+Before you run it, specify the following settings:
156
+
157
+- resource_group name (from step 1, above)
158
+- account_name (from step 2, above)
159
+- account_key (public or private) (from step 3, above)
160
+- container_name (from step 4, above)
161
+- public_key_file
162
+- vm_name of the Photon OS VHD distribution file
163
+
164
+**delete.sh**
165
+
166
+````
167
+#!/bin/bash
168
+vm_name=$1
169
+resource_group=&quot;&quot;
170
+account_name=&quot;&quot;
171
+account_key=&quot;&quot;
172
+container_name=&quot;mydisks&quot;
173
+url=&quot;https://${account_name}.blob.core.windows.net/${container_name}/${vm_name}.vhd&quot;
174
+public_key_file=&quot;/root/azure_new/jenkins.pub&quot;
175
+exit_code=0
176
+echo &quot;##################&quot;
177
+echo &quot;#   Delete vm    #&quot;
178
+echo &quot;##################&quot;
179
+echo &quot;az vm list  --resource-group ${resource_group} ... ...&quot;
180
+/root/azure_new/bin/az vm list  --resource-group ${resource_group}
181
+echo &quot;az vm delete --resource-group ${resource_group} --name ${vm_name} --yes ... ...&quot;
182
+/root/azure_new/bin/az vm delete --resource-group ${resource_group} --name ${vm_name} --yes
183
+if [$? -ne 0];then
184
+   exit_code=1
185
+fi
186
+echo &quot;az vm list  --resource-group ${resource_group} ... ...&quot;
187
+/root/azure_new/bin/az vm list  --resource-group ${resource_group}
188
+echo &quot;##############$####&quot;
189
+echo &quot;#   Delete vhd    #&quot;
190
+echo &quot;###############$###&quot;
191
+echo &quot;az storage blob list --account-name ${account_name} --container-name ${container_name} ... ...&quot;
192
+/root/azure_new/bin/az storage blob list --account-name ${account_name} --container-name ${container_name}
193
+echo &quot;az storage blob delete --account-name ${account_name} --container-name ${container_name} --name ${vm_name}.vhd ... ...&quot;
194
+/root/azure_new/bin/az storage blob delete --account-name ${account_name} --container-name ${container_name} --name ${vm_name}.vhd
195
+if [$? -ne 0];then
196
+   exit_code=1
197
+fi
198
+echo &quot;az storage blob list --account-name ${account_name} --container-name ${container_name} ... ...&quot;
199
+/root/azure_new/bin/az storage blob list --account-name ${account_name} --container-name ${container_name}
200
+echo &quot;########################&quot;
201
+echo &quot;#   Delete container   #&quot;
202
+echo &quot;########################&quot;
203
+/root/azure_new/bin/az storage container delete --account-name ${account_name} --name ${container_name}
204
+/root/azure_new/bin/az storage container delete --account-name ${account_name} --name vhds
205
+exit ${exit_code}
206
+````
207
+
208
+## Deploying a Containerized Application in Photon OS
209
+
210
+Now that you have your container runtime environment up and running, you can easily deploy a containerized application. For this example, you will deploy the popular open source Web Server Nginx. The Nginx application has a customized VMware package that is published as a dockerfile and can be downloaded, directly, through the Docker module from the Docker Hub.
211
+
212
+### Step 1: Run Docker
213
+
214
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
215
+````
216
+systemctl start docker
217
+````
218
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
219
+````
220
+systemctl enable docker
221
+````
222
+### Step 2: Run the Nginx Web Server
223
+
224
+Now the Docker daemon service is running, it is a simple task to &quot;pull&quot; and start the Nginx Web Server container from Docker Hub. To do this, type the following command:
225
+````
226
+docker run -d -p 80:80 vmwarecna/nginx
227
+````
228
+
229
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
230
+
231
+![Azure docker run](images/azure-docker-run.png)
232
+
233
+After the "docker run" process completes, you return to the command prompt. You now have a fully active website up and running in a container.
234
+
235
+### Step 3: Test the Web Server
236
+
237
+**Note** : Please make sure that the proper security policies have been enabled on the Microsoft Azure side to enable traffic to port 80 on the VM.
238
+
239
+To test that your Web Server is active:
240
+
241
+1. Run the ifconfig command to get the IP address of the Photon OS Virtual Machine.
242
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on "eth0."
243
+2. Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine.
244
+3. You should see a screen confirming that the nginx web server is successfully installed and working.
245
+
246
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
0 247
new file mode 100644
... ...
@@ -0,0 +1,359 @@
0
+# Running Photon OS on Workstation 
1
+
2
+This guide describes how to get started using Photon OS as a virtual machine within VMware Workstation. It provides instructions for downloading Photon OS (as an OVA or ISO file), describes the various installation options, and walks through the steps of installing the Photon OS distribution on Workstation. Once Photon OS is installed, this document shows how to deploy a containerized application in Docker with a single command.
3
+
4
+- [About Photon OS](#about-photon-os)
5
+- [Requirements](#requirements)
6
+- [Deciding Whether to Use OVA or ISO](#deciding-whether-to-use-ova-or-iso)
7
+- [Downloading Photon OS](#downloading-photon-os)
8
+- [Importing the OVA for Photon OS 2.0](#importing-the-ova-for-photon-os-20)
9
+- [Installing the ISO Image for Photon OS 2.0](#installing-the-iso-image-for-photon-os-20)
10
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
11
+- [Installing Photon OS 1.0](#installing-photon-os-10)
12
+
13
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md). 
14
+
15
+# About Photon OS
16
+
17
+Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see  [https://vmware.github.io/photon/](https://vmware.github.io/photon/).
18
+
19
+# Requirements
20
+
21
+Using Photon OS within VMware Workstation requires the following resources:
22
+
23
+| **Resource** | **Description** |
24
+| --- | --- |
25
+| VMware Workstation | VMware Workstation must be installed (Workstation 10 or higher). The latest version is recommended. |
26
+| Memory | 2GB of free RAM (recommended) |
27
+| Storage | **Minimal Photon install** : 512MB of free space (minimum); **Full Photon install** : 4GB of free space (minimum); 8GB is recommended |
28
+| Distribution File | Photon OS ISO or OVA file downloaded from bintray ([https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)).
29
+
30
+Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware Workstation and VMware vSphere), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
31
+
32
+**Note:**  The setup instructions in this guide use VMware Workstation Professional version 12.5.7.
33
+
34
+![Workstation version](images/ws_version.png)
35
+
36
+# Deciding Whether to Use OVA or ISO
37
+
38
+The first step is decide whether to use the the OVA or ISO distribution to set up Photon OS.
39
+
40
+- **OVA import** : Because of the nature of an OVA, you're getting a pre-installed version of Photon OS. For Workstation, choose the OVA with Hardware Version 11 (_not_ 13). The OVA benefits from a simple import process and some kernel tuning for VMware environments. However, because it's a pre-installed version, the set of packages that are installed are predetermined. Any additional packages that you need can be installed using tdnf.
41
+- **ISO install** : The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
42
+
43
+If you're just looking for the fastest way to get up and running, start with the OVA.
44
+
45
+# Downloading Photon OS
46
+
47
+Once you've decided which way to install, you'll need to download the correct binaries. Go to the following Bintray URL and download the latest release of Photon OS:
48
+
49
+[https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
50
+
51
+For instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
52
+
53
+# Importing the OVA for Photon OS 2.0
54
+
55
+Using the OVA is the easiest way to create a Photon OS VM on VMware Workstation.
56
+
57
+## Step 1: Start the Import Process
58
+
59
+After you've downloaded the OVA file (OVA with Hardware Version 11), do one of the following:
60
+
61
+- Double-click it to start the import process, or
62
+- Start VMware Workstation and, from the File menu, choose **Open**.
63
+
64
+![OVA file](images/ws-ova-import.png)
65
+
66
+## Step 2: Specify the Name and Storage Location
67
+
68
+Change the name and storage location, if you want.
69
+
70
+![Name and Storage Location](images/ws-ova-path.png)
71
+
72
+Choose **Import**.
73
+
74
+![License](images/ws-ova-license.png)
75
+
76
+Review the License Agreement and choose **Accept**.
77
+
78
+## Step 3: Configure VM Settings
79
+
80
+Once the OVA is imported, Workstation displays a summary of the settings for your Photon OS VM.
81
+
82
+![Settings](images/ws-ova-settings.png)
83
+
84
+Choose **Edit virtual machine settings**. Workstation displays the Virtual Machine settings. You can either accept the defaults or change settings as needed.
85
+
86
+![OVA settings](images/ws-ova-settings-edit.png)
87
+
88
+Select the Options tab.
89
+
90
+![Options](images/ws-ova-settings-options.png)
91
+
92
+Under Guest operating system, select **Linux**.
93
+
94
+For Version, click the list and select **VMWare Photon 64-bit**.
95
+
96
+![Version](images/ws-ova-os.png)
97
+
98
+**Note:**  If you want to configure a secure boot for the Photon OS VM, select **Advanced**  and select (check) **Boot with EFI instead of BIOS**. The EFI boot ensures that the ISO content is signed by VMware and that the entire stack is secure.
99
+
100
+![EFI boot](images/ws-ova-settings-efi.png)
101
+
102
+Choose **OK**.
103
+
104
+## Step 4: Power on the VM
105
+
106
+From the tab, choose  **Power on this virtual machine**.
107
+
108
+![OVA splash](images/ws-ova-splash.png)
109
+
110
+After the splash screen, Workstation will prompt you to log in.
111
+
112
+## Step 5: Update Login Credentials
113
+
114
+**Note** : Because of limitations within OVA support on Workstation, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
115
+
116
+| **Setting** | **Value** |
117
+| --- | --- |
118
+| Username | ``root`` |
119
+| Password | ``changeme`` |
120
+
121
+After you provide these credentials, Workstation prompts you to create a new password and type it a second time to verify it. For security, Photon OS forbids common dictionary words for the root password. Once logged in, you will see the shell prompt.
122
+
123
+![OVA password](images/ws-ova-password.png)
124
+
125
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os).
126
+
127
+# Installing the ISO Image for Photon OS 2.0
128
+
129
+After you have downloaded the Photon OS ISO image into a folder of your choice, open VMware Workstation.
130
+
131
+## Step 1: Start the Installation Process
132
+
133
+From the File menu, choose **New Virtual Machine**  to create a new virtual machine.
134
+
135
+![New virtural machine](images/ws-iso-new.png)
136
+
137
+Select **Typical** or **Custom**, and then choose **Next**. These instructions refer to a Typical installation.
138
+
139
+![Typical installation](images/ws-iso-typical.png)
140
+
141
+## Step 2: Select the ISO Image
142
+
143
+Select **Installer disc image file (iso)**, choose **Browse** and select the Photon OS ISO file.
144
+
145
+![Photon ISO file](images/ws-iso-selected.png)
146
+
147
+## Step 3: Select the Operating System
148
+
149
+Choose **Next**. Select the Guest operating system.
150
+
151
+For the Guest operating system, select **Linux**.
152
+
153
+Click the Version dropdown and select **VMware Photon 64-bit**  from the list.
154
+
155
+![Operating System](images/ws-iso-os.png)
156
+
157
+## Step 4: Specify the VM Name and Location
158
+
159
+Choose **Next**. Specify a virtual machine name and location.
160
+
161
+![VM Name and Location](images/ws-iso-name.png)
162
+
163
+## Step 5: Specify Disk Options
164
+
165
+Choose **Next**. Specify the maximum disk size and whether you want to split the virtual disk into multiple files or store it as a single file.
166
+
167
+![Disk options](images/ws-iso-disk.png)
168
+
169
+## Step 6: Configure VM Settings
170
+
171
+Choose **Next**. Workstation displays a summary of your selections.
172
+
173
+![Workstation settings](images/ws-iso-summary.png)
174
+
175
+**Important** : _Before_ you finish creating the Photon OS Virtual Machine, we strongly recommend that you customize the virtual machine and remove any unwanted devices that are not needed for a container run-time environment. To remove unnecessary devices, choose **Customize hardware**.
176
+
177
+![Customize hardware](images/ws-iso-customize.png)
178
+
179
+Consider removing the following components, which are not used by Photon OS:
180
+
181
+- Select **Sound Card**, un-tick the **Connect at power on** option. Confirm your action and choose **Close** to return to the VM Settings by .
182
+- Select **USB Controller** and ensure that the **Share Bluetooth devices with the virtual machine** setting is unchecked (it should be unchecked, by default) and then choose **Close**.
183
+- Select **Display** and ensure that the **Accelerate 3D Graphics** option is unchecked (it should be unchecked, by default) and then choose **Close**.
184
+- At this stage we have now made all the necessary customizations and you are ready to select the Photon OS ISO image to boot and begin the installation process.
185
+- Choose  **Finish**.
186
+
187
+In Workstation, choose **Edit virtual machine settings**, select **CD/DVD (IDE)**, and verify that **Connect at power on** is selected.
188
+
189
+![CD/DVD](images/ws-iso-cd.png)
190
+
191
+## Step 7: Configure a Secure Boot (Optional)
192
+
193
+**Note:**  If you want to configure a secure boot for the Photon OS VM, in Workstation, choose  **Edit virtual machine settings**, select  **Options**, choose **Advanced**, and select **Boot with EFI instead of BIOS**.
194
+
195
+![Boot with EFI](images/ws-iso-efi.png)
196
+
197
+The EFI boot ensures that the ISO content is signed by VMware and that the entire stack is secure.
198
+
199
+Choose **OK**.
200
+
201
+![ISO settings](images/ws-iso-settings.png)
202
+
203
+## Step 8: Power On the VM
204
+
205
+Choose **Power on this virtual machine**.
206
+
207
+When you see the Photon Installer boot menu, press Enter on your keyboard to start installing.
208
+
209
+![Installer](images/ws-iso-installer.png)
210
+
211
+Review the license agreement.
212
+
213
+![License agreement](images/ws-iso-license.png)
214
+
215
+Choose **Accept** and press Enter.
216
+
217
+## Step 9: Configure the Partition
218
+
219
+The installer will detect one disk, which should be the 8GB volume configured as part of the virtual machine creation. Choose **Auto**  to have the installer automatically allocate the partition, or choose **Custom**  if you want to configure individual partitions, and then press the Enter key.
220
+
221
+![Partition](images/ws-iso-disk-partition.png)
222
+
223
+**Note:**  If you choose Custom, the installer displays the following screen.
224
+
225
+![Custom partition](images/ws-iso-disk-partition-custom.png)
226
+
227
+For each custom partition, choose **Create New**  and specify the following information:
228
+
229
+![New partition](images/ws-iso-disk-partition-new.png)
230
+
231
+**Size** - Preallocated size of this partition, in MB.
232
+
233
+**Type** - One of the following options:
234
+
235
+- **ext3** - ext3 file system
236
+- **ext4** - ext4 file system
237
+- **swap** - swap partition
238
+
239
+**Mountpoint** - Mount point for this partition.
240
+
241
+Choose **OK** and press the Enter key. When you are done defining custom partitions, choose **Next** and press the Enter key.
242
+
243
+The installer prompts you to confirm that you want to erase the entire disk. Choose  **Yes**  and press the Enter key.
244
+
245
+![Disk erase](images/ws-iso-disk-erase.png)
246
+
247
+## Step 10: Select an Installation Option
248
+
249
+After partitioning the disk, the installer will prompt you to select an installation option.
250
+
251
+![installation option](images/ws-iso-install-option.png)
252
+
253
+Each installation option provides a different run-time environment, depending on your requirements.
254
+
255
+| **Option** | **Description** |
256
+| --- | --- |
257
+| **Photon Minimal** | Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. |
258
+| **Photon Full** | Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. |
259
+| **Photon OSTree Server** | This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts. |
260
+
261
+**Note:**  The option you choose determines the disk and memory resources required for your installation.
262
+
263
+Select the option you want and press the Enter key.
264
+
265
+## Step 11: Select the Linux Kernel
266
+
267
+Select a Linux kernel to install.
268
+
269
+![Kernel](images/ws-iso-kernel.png)
270
+
271
+- **Hypervisor optimized** means that any components that are not needed for running under a VMware hypervisor have been removed for faster boot times.
272
+- **Generic** means that all components are included.
273
+
274
+Choose **Next** and press the Enter key.
275
+
276
+## Step 12: Specify the Hostname
277
+
278
+The installer prompts you for a hostname and suggest a randomly generated, unique hostname that you can change if you want.
279
+
280
+![Hostname](images/ws-iso-hostname.png)
281
+
282
+Press the Enter key.
283
+
284
+## Step 13: Specify the System root Password
285
+
286
+**_Note_** _: Photon OS will not permit commonly used dictionary words to be set as a root password._
287
+
288
+The installer prompts you to enter the system root password. Type the password and press the Enter key.
289
+
290
+![Password](images/ws-iso-root-password.png)
291
+
292
+The installer prompts you to confirm the root password by typing it a second time.
293
+
294
+![Confirm password](images/ws-iso-root-password-confirm.png)
295
+
296
+Press the Enter key. The installer proceeds to install the software. Installation times will vary based on the system hardware and installation options you selected. Most installations complete in less than one minute.
297
+
298
+## Step 14: Reboot the VM and Log In
299
+
300
+Once finished, the installer displays a confirmation message (which includes how long it took to install Photon OS) and prompts you to press a key on your keyboard to boot the new VM.
301
+
302
+![confirmation message](images/ws-iso-installed.png)
303
+
304
+Press any key on the keyboard and the virtual machine will reboot into Photon OS.
305
+
306
+As the initial boot process begins, the installer displays the Photon splash screen, and then a login prompt.
307
+
308
+![Splash screen](images/ws-iso-splash.png)
309
+
310
+At the login prompt, type **root**  as the username and provide the password chosen during the installation.
311
+
312
+![Password](images/ws-iso-login.png)
313
+
314
+You have now successfully set up Photon OS and are ready to use your container run-time environment. Proceed to the next section to deploy a containerized application.
315
+
316
+# Deploying a Containerized Application in Photon OS
317
+
318
+Now that you have your container runtime environment up and running, you can easily deploy a containerized application. For this example, you will deploy the popular open source Web Server Nginx. The Nginx application has a customized VMware package that is published as a dockerfile and can be downloaded directly through the Docker module from the Docker Hub.
319
+
320
+## Step 1: Run Docker
321
+
322
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
323
+
324
+    systemctl start docker
325
+
326
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
327
+
328
+    systemctl enable docker
329
+
330
+## Step 2: Run the Nginx Web Server
331
+
332
+Now the Docker daemon service is running, it is a simple task to "pull" and start the Nginx Web Server container from Docker Hub. To do this, type the following command:
333
+
334
+    docker run -d -p 80:80 vmwarecna/nginx
335
+
336
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
337
+
338
+![Docker run](images/ws-docker-run.png)
339
+
340
+After the **docker run**  process completes, you return to the command prompt. You now have a fully active website up and running in a container.
341
+
342
+## Step 3: Test the Web Server
343
+
344
+To test that your Web Server is active, run the **ifconfig** command to get the IP address of the Photon OS Virtual Machine.
345
+
346
+![IP config](images/ws-docker-ifconfig.png)
347
+
348
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on "**eth0**".
349
+
350
+Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine (the **inet addr** for eth0). You should see a screen similar to the following example as confirmation that your web server is active.
351
+
352
+![Confirmation](images/ws-docker-confirm.png)
353
+
354
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
355
+
356
+# Installing Photon OS 1.0
357
+
358
+Refer to the Photon OS 1.0 installation instructions in [Running Photon OS on Fusion](Running-Project-Photon-on-Fusion.md).
0 359
new file mode 100644
... ...
@@ -0,0 +1,503 @@
0
+# Running Photon OS on vSphere
1
+
2
+This guide describes how to get started using Photon OS as a virtual machine within VMware vSphere. It provides instructions for downloading Photon OS (as an OVA or ISO file), describes the various installation options, and walks through the steps of installing the Photon OS distribution on vSphere. Once Photon OS is installed, this document highlights how to deploy a containerized application in Docker with a single command.
3
+
4
+- [About Photon OS](#about-photon-os)
5
+- [Deciding Whether to Use OVA or ISO](#deciding-whether-to-use-ova-or-iso)
6
+- [Downloading Photon OS](#downloading-photon-os)
7
+- [Importing the OVA for Photon OS 2.0](#importing-the-ova-for-photon-os-20)
8
+- [Installing the ISO Image for Photon OS 2.0](#installing-the-iso-image-for-photon-os-20)
9
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
10
+- [Installing Photon OS v1.0](#installing-photon-os-10)
11
+
12
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md). 
13
+
14
+## About Photon OS
15
+
16
+Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see  [https://vmware.github.io/photon/](https://vmware.github.io/photon/).
17
+
18
+## Requirements
19
+
20
+Using Photon OS within VMware vSphere requires the following resources:
21
+
22
+| **Resources** | **Description** |
23
+| --- | --- |
24
+| VMware vSphere installed | VMware web client (v6.5) for ESXi hosts (recommended) **Note:** vSphere 6 and vSphere 5.5 (these clients provide limited support; not all features are available). |
25
+| Memory | ESXi host with 2GB of free RAM (recommended) |
26
+| Storage | **Minimal Photon install** : ESXi host with at least 512MB of free space (minimum); **Full Photon install** : ESXi host with at least 4GB of free space (minimum); 16GB is recommended |
27
+| Distribution File | Photon OS ISO or OVA file downloaded from Bintray |
28
+
29
+Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware vSphere and VMware Fusion), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
30
+
31
+**Note:** The setup instructions in this guide use VMware vSphere 6 and the vSphere web client.
32
+
33
+## Deciding Whether to Use OVA or ISO
34
+
35
+The first step is decide whether to use the OVA or ISO distribution to set up Photon OS.
36
+
37
+- **OVA import** : Because of the nature of an OVA, you're getting a pre-installed version of Photon OS. You can choose the hardware version you want (OVA with hardware version 13 or 11). The OVA benefits from a simple import process and some kernel tuning for VMware environments. However, because it's a pre-installed version, the set of packages that are installed are predetermined. Any additional packages that you need can be installed using tdnf.
38
+- **ISO install** : The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
39
+
40
+If you're just looking for the fastest way to get up and running, start with the OVA.
41
+
42
+## Downloading Photon OS
43
+
44
+Once you've decided which way to install, you'll need to download the correct binaries. Go to the following Bintray URL and download the latest release of Photon OS:
45
+
46
+[https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
47
+
48
+For instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
49
+
50
+**Note:** For ISO installation, you will need to upload to a datashare that is attached to the ESXi host, or mount the file share (where the ISO resides) as a data store.
51
+
52
+## Importing the OVA for Photon OS 2.0
53
+
54
+Using the OVA is a fast and easy way to create a Photon OS VM on VMware vSphere.
55
+
56
+After you've downloaded the OVA, log in to your vSphere environment.
57
+
58
+### Step 1: Start the Import Process
59
+
60
+From the Actions pull-down menu, choose **Create/Register VM**.
61
+
62
+![Create/Register VM](images/vs-ova-new-vm.png)
63
+
64
+In the Select creation type window, choose  **Deploy a virtual machine from an OVF or OVA file**.
65
+
66
+(images/vs-ova-new-vm-ova.png)
67
+
68
+Choose **Next**.
69
+
70
+### Step 2: Select the OVA File
71
+
72
+Enter a name for the virtual machine, and select the OVA file.
73
+
74
+![OVA file](images/vs-ova-name-selected.png)
75
+
76
+Choose **Next**.
77
+
78
+### Step 3: Specify the Target Datastore
79
+
80
+From the Select storage screen, select the target datastore for your VM.
81
+
82
+![Target datastore](images/vs-ova-storage.png)
83
+
84
+Choose  **Next**.
85
+
86
+### Step 4: Accept the License Agreement
87
+
88
+Read through the Photon OS License Agreement, and then choose **I Agree**.
89
+
90
+![License](images/vs-ova-license.png)
91
+
92
+Choose **Next**.
93
+
94
+### Step 5: Select Deployment Options
95
+
96
+Select deployment options.
97
+
98
+![Deployment Options](images/vs-ova-deployment-options.png)
99
+
100
+Photon OS is provisioned with a maximum disk size. By default, Photon OS uses only the portion of disk space that it needs, usually much less that the entire disk size ( **Thin** client). If you want to pre-allocate the entire disk size (reserving it entirely for Photon OS instead), select **Thick**  instead.
101
+
102
+Choose **Next**.
103
+
104
+### Step 6: Verify Deployment Settings
105
+
106
+Verify your deployment settings.
107
+
108
+![Deployment settings](images/vs-ova-settings.png)
109
+
110
+Click **Finish**. vSphere uploads and validates your OVA. Depending on bandwidth, this operation might take a while.
111
+
112
+When finished, vShield powers up a new VM based on your selections.
113
+
114
+### Step 7: Change Login Settings
115
+
116
+![Login settings](images/vs-ova-splash.png)
117
+
118
+After the VM is booted, open the command window. vSphere prompts you to log in.
119
+
120
+**Note**: Because of limitations within OVA support on vSphere, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
121
+
122
+| **Setting** | **Value** |
123
+| --- | --- |
124
+| Username | ``root`` |
125
+| Password | ``changeme`` |
126
+
127
+After you provide these credentials, vSphere prompts you to create a new password and type it a second time to verify it.
128
+
129
+**Note:** For security, Photon OS forbids common dictionary words for the root password.  
130
+
131
+Once logged in, you will see the shell prompt.
132
+
133
+![Shell prompt](images/vs-ova-login.png)
134
+
135
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os).
136
+
137
+### Step 9: Export the VM as a Template (Optional)
138
+
139
+Consider converting this imported VM into a template (from the Actions menu, choose **Export** ) so that you have a master Photon OS instance that can be combined with vSphere Guest Customization to enable rapid provisioning of Photon OS instances.
140
+
141
+## Installing the ISO Image for Photon OS 2.0
142
+
143
+After you have downloaded the Photon OS ISO image into a folder of your choice, complete the following steps.
144
+
145
+### Step 1: Upload the ISO Image
146
+
147
+Upload the ISO image to a datastore that is attached to the host on which you'll create the Photon OS virtual machine.
148
+
149
+### Step 2: Create a New VM
150
+
151
+Log in to your vSphere environment. In the Virtual Machines window, choose **Create/Register VM**.
152
+
153
+On the Select creation type screen, select **Create a new virtual machine**.
154
+
155
+![Create new virtual machine](images/vs-iso-new.png)
156
+
157
+Choose **Next**.
158
+
159
+### Step 3: Configure VM Settings
160
+
161
+Specify a VM name.
162
+
163
+![VM name](images/vs-iso-name.png)
164
+
165
+Specify a guest operating system.
166
+
167
+- For Compatibility, select **ESXi 6.5**.
168
+- For Guest OS family, select **Linux**.
169
+- For Guest OS version, select **VMware Photon OS (64-bit)**.
170
+
171
+![Guest operating system](images/vs-iso-os.png)
172
+
173
+Choose  **Next**.
174
+
175
+### Step 4: Select the Target Datastore
176
+
177
+Select the datastore where you want to store the VM.
178
+
179
+![Target datastore](images/vs-iso-datastore.png)
180
+
181
+Click **Next**.
182
+
183
+### Step 5: Customize VM Settings
184
+
185
+Customize the virtual machine settings.
186
+
187
+![v](images/vs-iso-customize.png)
188
+
189
+For CD/DVD Drive 1, click the drop-down and select **Datastore ISO file**.
190
+
191
+In the Datastore browser, select the ISO that you want to import.
192
+
193
+Change other settings as applicable.
194
+
195
+- The recommended virtual hardware settings for your Photon VM are heavily dependent upon the container load you intend to run within Photon OS – more containers or more intensive containers will require you to adjust these settings for your application load. VMware suggests 2 vCPU, 1024MB memory, 20GB hard disk. Any unwanted devices should be removed. Be sure to mount the Photon OS ISO on the CD/DVD Drive and put a check in the box next to, Connect At Power On.
196
+- If you want to configure a secure boot for the Photon OS VM you created, choose the VM Options tab, expand Boot Options, and select EFI from the firmware drop-down.  An EFI boot ensures that the ISO content is signed by VMware and that the entire stack is secure.
197
+
198
+Choose **Next**.
199
+
200
+### Step 6: Verify VM Settings
201
+
202
+The installer displays a summary of your selected settings.
203
+
204
+![Summary](images/vs-iso-ready.png)
205
+
206
+Click **Finish**. vSphere creates the VM.
207
+
208
+### Step 7: Power on the VM
209
+
210
+Select the VM and power it on.
211
+
212
+![Power on VM](images/vs-iso-install.png)
213
+
214
+When you see the Photon Installer boot menu, press Enter on your keyboard to start installing.
215
+
216
+### Step 8: Accept the License Agreement
217
+
218
+Read the License Agreement and press the Enter key to accept.
219
+
220
+![License Agreement](images/vs-iso-license.png)
221
+
222
+### Step 9: Configure the Partition
223
+
224
+The installer will detect one disk, which should be the 16GB volume configured as part of the virtual machine creation. Choose **Auto**  to have the installer automatically allocate the partition, or choose **Custom**  if you want to configure individual partitions, and then press the Enter key.
225
+
226
+![Partition](images/vs-iso-partition.png)
227
+
228
+**Note:**  If you choose Custom, the installer displays the following screen.
229
+
230
+![Custom Partition](images/vs-iso-partition-custom.png)
231
+
232
+For each custom partition, choose **Create New**  and specify the following information:
233
+
234
+![New Partition](images/vs-iso-partition-new.png)
235
+
236
+**Size** - Preallocated size of this partition, in MB.
237
+
238
+**Type** - One of the following options:
239
+
240
+- **ext3** - ext3 file system
241
+- **ext4** - ext4 file system
242
+- **swap** - swap partition
243
+
244
+**Mountpoint** - Mount point for this partition.
245
+
246
+Choose **OK** and press the Enter key. When you are done defining custom partitions, choose **Next** and press the Enter key.
247
+
248
+The installer prompts you to confirm that you want to erase the entire disk.
249
+
250
+![Erase disk](images/vs-iso-erase.png)
251
+
252
+Choose **Yes** and press the Enter key.
253
+
254
+### Step 10: Select an Installation Option
255
+
256
+After partitioning the disk, the installer will prompt you to select an installation option.
257
+
258
+![Installation Option](images/vs-iso-install-option.png)
259
+
260
+Each install option provides a different run-time environment, depending on your requirements.
261
+
262
+| **Option** | **Description** |
263
+| --- | --- |
264
+| **Photon Minimal** | Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. |
265
+| **Photon Full** | Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. |
266
+| **Photon OSTree Server** | This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts. |
267
+
268
+**Note:**  The option you choose determines the disk and memory resources required for your installation.
269
+
270
+Select the option you want and press the Enter key.
271
+
272
+### Step 11: Select the Linux Kernel
273
+
274
+Select a Linux kernel to install.
275
+
276
+![Linux Kernel](images/vs-iso-kernel.png)
277
+
278
+- **Hypervisor**  optimized means that any components that are not needed for running under a VMware hypervisor have been removed for faster boot times.
279
+- **Generic**  means that all components are included.
280
+
281
+Choose **Next** and press the Enter key.
282
+
283
+### Step 12: Specify the Hostname
284
+
285
+The installer prompts you for a hostname and suggest a randomly generated, unique hostname that you can change if you want.
286
+
287
+![Hostname](images/vs-iso-hostname.png)
288
+
289
+Press the Enter key.
290
+
291
+### Step 13: Specify the System root Password
292
+
293
+The installer prompts you to enter the system root password.
294
+
295
+_Note: Photon OS will not permit commonly used dictionary words to be set as a root password._
296
+
297
+![Root password](images/vs-iso-root-password.png)
298
+
299
+Type a password and press the Enter key.
300
+
301
+The installer prompts you to confirm your root password by typing it a second time.
302
+
303
+![Password confirmation](images/vs-iso-root-password-confirm.png)
304
+
305
+**Note:** If you have trouble with unintentional repeated characters in the Remote Console, follow VMware KB 196 ( [http://kb.vmware.com/kb/196](http://kb.vmware.com/kb/196)) for a setting to apply to the virtual machine.
306
+
307
+Press the Enter key. The installer proceeds to install the software. Installation times will vary based on the system hardware and installation options you selected. Most installations complete in less than one minute.
308
+
309
+### Step 14: Reboot the VM and Log In
310
+
311
+Once finished, the installer displays a confirmation message (which includes how long it took to install Photon OS) and prompts you to press a key on your keyboard to boot the new VM.
312
+
313
+![Boot VM](images/vs-iso-installed.png)
314
+
315
+As the initial boot process begins, the installer displays the Photon splash screen, and then a login prompt.
316
+
317
+![Login prompt](images/vs-iso-splash.png)
318
+
319
+At the login prompt, type **root**  as the username and provide the password chosen during the installation.
320
+
321
+![Password](images/vs-iso-login.png)
322
+
323
+You have now successfully setup Photon OS and are ready to use your container runtime environment. Proceed to the next section to deploy a containerized application.
324
+
325
+## Deploying a Containerized Application in Photon OS
326
+
327
+Now that you have your container runtime environment up and running, you can easily deploy a containerized application. For this example, you will deploy the popular open source Web Server Nginx. The Nginx application has a customized VMware package that is published as a dockerfile and can be downloaded, directly, through the Docker module from the Docker Hub.
328
+
329
+### Step 1: Run Docker
330
+
331
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
332
+
333
+    systemctl start docker
334
+
335
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
336
+
337
+    systemctl enable docker
338
+
339
+### Step 2: Run the Nginx Web Server
340
+
341
+Now the Docker daemon service is running, it is a simple task to "pull" and start the Nginx Web Server container from Docker Hub. To do this, type the following command:
342
+
343
+    docker run -d -p 80:80 vmwarecna/nginx
344
+
345
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
346
+
347
+![Docker run](images/vs-docker-run.png)
348
+
349
+After the **docker run**  process completes, you return to the command prompt. You now have a fully active website up and running in a container!
350
+
351
+### Step 3: Test the Web Server
352
+
353
+To test that your Web Server is active, run the ifconfig command to get the IP address of the Photon OS Virtual Machine.
354
+
355
+![IP address](images/vs-docker-ifconfig.png)
356
+
357
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on **eth0**.
358
+
359
+Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine. You should see a screen similar to the following example as confirmation that your web server is active.
360
+
361
+![Docker confirmation](images/vs-docker-confirm.png)
362
+
363
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
364
+
365
+## Installing Photon OS v1.0
366
+
367
+This section provides installation instructions for Photon OS v1.0.
368
+
369
+### Photon OS 1.0 Prerequisites
370
+
371
+In order to install and start using Photon OS with VMware vSphere, the following pre-requisites must be satisfied: 
372
+
373
+* VMware vSphere 5.5 or VMware vSphere 6.0 installed 
374
+* ESXi host with recommended 2GB of free RAM
375
+* ESXi host with recommended 8GB of free disk space
376
+* The Photon OS ISO downloaded from Bintray
377
+
378
+This document uses VMware vSphere 6. VMware recommends that you use the latest version, though vSphere 5.5 or later should work as well. 
379
+
380
+### Importing the Photon OS 1.0 OVA
381
+
382
+Using the OVA is a fast and easy way to create a Photon OS VM. Once you’ve downloaded the OVA, log in to your vSphere environment and, from the `Actions` pull-down menu, select, `Deploy OVF Template …` On the popup window, point vSphere to the OVA file that you’ve downloaded. 
383
+
384
+![vsphere1](images/vsphere1.jpg)
385
+
386
+Click the `Next` button at the bottom of the window and vSphere will upload and validate your OVA. Depending on bandwidth, this operation might take a while. 
387
+
388
+After validating the image, vSphere will present a summary of the details of the OVA. Click the `Next` button to proceed to selecting a location to store the imported Photon OS instance.
389
+
390
+Click `Finish`
391
+
392
+At this point, you’ve got a Photon OS instance ready to go; but before you power on that Photon OS instance, consider first converting this VM into a template. By converting this imported VM to a template, you have a master Photon OS instance that can be combined with vSphere Guest Customization to enable rapid provisioning of Photon OS instances. 
393
+
394
+The OVA contains a default password of "changeme" for the root account that must be changed upon initial login. For security, Photon OS forbids common dictionary words for the root password.
395
+ 
396
+### Installing the Photon OS 1.0 ISO Image
397
+
398
+Once the ISO image has been uploaded to a datastore that is attached to the host on which you’ll create the Photon OS virtual machine, start the installation process by creating a new virtual machine.
399
+When creating a new VM, the first thing you’ll need to specify is the compatibility of that VM with ESXi versions. Select a compatibility level for your VM, as shown below. Photon OS shouldn’t require any particular compatibility, but VMware recommends that you choose the latest available option for your release of vSphere.
400
+
401
+![vsphere2](images/vsphere2.jpg)
402
+
403
+When prompted for the `Guest OS Family,` choose `Linux` and, for Guest OS Version, choose `Other 3.x Linux (64-bit)`. 
404
+
405
+![vsphere3](images/vsphere3.jpg)
406
+
407
+The recommended virtual hardware settings for your Photon VM are heavily dependent upon the container load you intend to run within Photon OS – more containers or more intensive containers will require you to adjust these settings for your application load. VMware suggests 2 vCPU, 1024MB memory, 20GB hard disk. Any unwanted devices should be removed.  Be sure to mount the Photon OS ISO on the CD/DVD Drive and put a check in the box next to, `Connect At Power On.`
408
+
409
+![vsphere4](images/vsphere4.jpg)
410
+
411
+To summarize, these are the settings we recommend as a starting point for your Photon OS container runtime host: Thin provisioned, hardware compatibility: ESXi 6.0 and later (VM version 11).
412
+
413
+Power on the Photon OS virtual machine and, within a few seconds, the Photon Installer Boot Menu will appear.  Download and install the Remote Console if you do not have it already; otherwise, click `Launch Remote Console` to interact with the installer.
414
+
415
+![vsphere5](images/vsphere5.jpg)
416
+
417
+Once connected to the remote console, select `Install` to proceed.
418
+
419
+![vsphere6](images/vsphere6.png)
420
+
421
+After you accept the EULA, the installer will detect one disk, which should be the 20GB volume configured as part of the virtual machine creation. Select the disk and press enter.  When you are prompted to confirm that it is okay to erase the entire disk, select `Yes` to accept and proceed with the installation.
422
+
423
+![vsphere7](images/vsphere7.jpg)
424
+
425
+You will now be presented with several installation options:
426
+
427
+![vsphere8](images/vsphere8.png)
428
+
429
+Each install option provides a different runtime environment:
430
+
431
+* Photon Minimal: Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. 
432
+
433
+* Photon Full: Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. 
434
+
435
+* Photon OSTree Host: This installation profile creates a Photon OS instance that will source its packages from a central rpm-ostree server and continue to have the library and state of packages managed by the definition that is maintained on the central rpm-ostree server. Use Photon OStree Hosts when you are interested in experimenting with the concept of a centrally authored and maintained OS version. This concept of treating the OS as a versioned, atomic entity can simplify lifecycle management and security at scale. 
436
+
437
+* Photon OSTree Server: This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the Photon OSTree Host installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts.  
438
+
439
+For the purposes of this how-to guide, select the option to install Photon Minimal. Once `Photon Minimal` is highlighted, press the Enter key on your keyboard.
440
+
441
+You will now be prompted for a hostname. Photon OS will prepopulate a randomly generated, unique hostname; you can either use this suggestion or enter your own hostname, as shown in the screenshot below:
442
+
443
+![vsphere9](images/vsphere9.jpg)
444
+
445
+After selecting a hostname and pressing Enter, you will be prompted to first type and, then, confirm the system root password. If you have trouble with unintentional repeated characters in the Remote Console, follow VMware KB 196 (http://kb.vmware.com/kb/196) for a setting to apply to the virtual machine.
446
+
447
+*Note: Photon OS will not permit commonly used dictionary words to be set as a root password.*
448
+
449
+After confirming the password, the installation process should begin.
450
+
451
+Installation times will vary based on system hardware and installation options, but most installations complete in less than a minute. Once the installation completes, press any key and the virtual machine will reboot into Photon OS.
452
+
453
+As the initial boot process begins, you will see the Photon splash screen before you are taken to a login prompt.
454
+
455
+At the login prompt, enter `root` as the username and provide the password chosen during the installation. 
456
+
457
+You have now successfully setup Photon OS and are ready to use your container runtime environment.
458
+ 
459
+### Installing a Containerized Application in Photon OS 1.0
460
+Now that you have your container runtime environment up and running, you may be wondering, “what can I do now?” A command prompt is not the most exciting thing. To help demonstrate the ease with which you can deploy a containerized application, this section showcases how you can quickly get a web server up and running.
461
+
462
+For this example, we will use the popular open source web server Nginx. The Nginx application has a customized VMware package  published as a dockerfile that can be downloaded directly in Docker from the Docker Hub.
463
+
464
+To run Docker from the command prompt, enter the command below to initialize the docker engine:
465
+
466
+`systemctl start docker`
467
+
468
+To ensure the docker daemon service runs on every subsequent VM reboot, enter:
469
+
470
+`systemctl enable docker`
471
+
472
+Now that the docker daemon service is running, it is a simple task to pull and start the Nginx Web Server container from Docker Hub.  To do this, enter the following command:
473
+
474
+`docker run -d -p 80:80 vmwarecna/nginx`
475
+
476
+This will then pull the Nginx Web Server files and appropriate dependent containers to ensure this containerized application can run.  You will see a screenshot similar to below, as the container and dependencies are downloaded and the container is prepared to run: 
477
+
478
+![vsphere12](images/vsphere12.jpg)
479
+
480
+Once the `docker run` process is completed, you will be returned to the command prompt.  You now have a fully active web server up and running through typing just a single command within Photon OS using containers.
481
+
482
+To test that your web server is active, we need to get the IP address of the Photon OS Virtual Machine. To get the IP address, enter the following command: 
483
+
484
+	ifconfig
485
+
486
+This will now display a list of adapters connected to the virtual machine.  Typically, the web server daemon will be bound to `eth0.`  
487
+
488
+Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine.  The following screen will appear showing that your web server is active:
489
+
490
+![vsphere13](images/vsphere13.jpg)
491
+
492
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
493
+
494
+If you are having trouble viewing the screen that shows the web server is active, you might have to add an iptables rule to your container VM to allow traffic on Port 80:
495
+
496
+`iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT`
497
+
498
+In addition, you might have to modify /etc/httpd/httpd.conf to listen on Port 80 by adding the following line:  
499
+
500
+`Listen 0.0.0.0:80`
501
+
502
+
0 503
new file mode 100644
... ...
@@ -0,0 +1,514 @@
0
+# Running Photon OS on Fusion
1
+
2
+This guide describes how to get started using Photon OS as a virtual machine within VMware Fusion. It provides instructions for downloading Photon OS (as an OVA or ISO file), describes the various installation options, and walks through the steps of installing the Photon OS distribution on Fusion. Once Photon OS is installed, this document shows how to deploy a containerized application in Docker with a single command.
3
+
4
+- [About Photon OS](#about-photon-os)
5
+- [Requirements](#requirements)
6
+- [Deciding Whether to Use an OVA or ISO](#deciding-whether-to-use-an-ova-or-iso)
7
+- [Downloading Photon OS](#downloading-photon-os)
8
+- [Importing the OVA for Photon OS 2.0](#importing-the-ova-for-photon-os-20)
9
+- [Installing the ISO Image for Photon OS 2.0](#installing-the-iso-image-for-photon-os-20)
10
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
11
+- [Installing Photon OS 1.0](#installing-photon-os-10)
12
+
13
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md). 
14
+
15
+# About Photon OS
16
+
17
+Photon OS™ is an open source Linux container host optimized for cloud-native applications, cloud platforms, and VMware infrastructure. Photon OS provides a secure run-time environment for efficiently running containers. For an overview, see [https://vmware.github.io/photon/](https://vmware.github.io/photon/).
18
+
19
+# Requirements
20
+
21
+Using Photon OS within VMware Fusion requires the following resources:
22
+
23
+| **Resource** | **Description** |
24
+| --- | --- |
25
+| VMware Fusion | VMware Fusion (v7.0 or higher) must be installed. The latest version is recommended. |
26
+| Memory | 2GB of free RAM (recommended) |
27
+| Storage | **Minimal Photon install** : 512MB of free space (minimum); **Full Photon install** : 4GB of free space (minimum); 8GB recommended. |
28
+| Distribution File | Photon OS ISO or OVA file downloaded from bintray ( [https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)). |
29
+
30
+Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware Fusion and VMware vSphere), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
31
+
32
+**Note:** The setup instructions in this guide use VMware Fusion Professional version 8.5.8, as per the following screenshot.
33
+
34
+![Fusion version](images/fs-version.png)
35
+
36
+# Deciding Whether to Use an OVA or ISO
37
+
38
+The first step is decide whether to use the OVA or ISO distribution to set up Photon OS.
39
+
40
+- **OVA import**: Because of the nature of an OVA, you're getting a pre-installed version of Photon OS. Choose the OVA with Hardware Version 11 (_not_ 13). The OVA benefits from a simple import process and some kernel tuning for VMware environments. However, because it's a pre-installed version, the set of packages that are installed are predetermined. Any additional packages that you need can be installed using **tdnf**.
41
+- **ISO install**: The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
42
+
43
+If you're just looking for the fastest way to get up and running, start with the OVA.
44
+
45
+# Downloading Photon OS
46
+
47
+Once you've decided which way to install, you'll need to download the correct binaries. Go to the following Bintray URL and download the latest release of Photon OS:
48
+
49
+[https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
50
+
51
+For instructions, see  [Downloading Photon OS](Downloading-Photon-OS.md).
52
+
53
+# Importing the OVA for Photon OS 2.0
54
+
55
+Importing the OVA image is the easiest way to create a Photon OS VM.
56
+
57
+## Step 1: Start the Import Process
58
+
59
+After you have downloaded the latest Photon OS OVA image (OVA with Hardware Version 11) into a folder of your choice, open VMware Fusion. From the File menu, choose **Import …**. Fusion prompts you to choose an existing virtual machine.
60
+
61
+![Import process](images/fs-ova-import.png)
62
+
63
+Choose the **Choose File …**  button to locate and select the Photon OS OVA, then choose **Continue**.
64
+
65
+![Select OVA ](images/fs-ova-selected.png)
66
+
67
+## Step 2: Specify the Name and Storage Location
68
+
69
+Provide the name and storage location for your Photon OS VM, then choose **Save**.
70
+
71
+![Name and storage location](images/fs-ova-name.png)
72
+
73
+Review the Photon OS License Agreement, then choose **Accept** to start the import process.
74
+
75
+![License](images/fs-ova-license.png)
76
+
77
+## Step 3: Configure VM Settings
78
+
79
+After the OVA is imported, Fusion displays a confirmation that the import has completed and a summary of the settings for your Photon OS VM. The following screen shot is an example (your settings may vary).
80
+
81
+![VM settings](images/fs-ova-finish.png)
82
+
83
+**Important:** Choose **Customize Settings**  to change the operating system (as recognized by the hypervisor) for the newly imported VM.
84
+
85
+![Custom settings](images/fs-ova-settings.png)
86
+
87
+Choose **General**.
88
+
89
+Click the selection box next to **OS**, select **Linux** , and then select **VMware Photon 64-bit**.
90
+
91
+![Operating system](images/fs-ova-os.png)
92
+
93
+Close the settings window. Fusion prompts you to verify that you want to change the operating system.
94
+
95
+![Confirm settings](images/fs-ova-os-confirm.png)
96
+
97
+Click **Change**. Your Photon OS VM is ready to power on.
98
+
99
+## Step 4: Power on the VM
100
+
101
+Power on the Photon OS VM. Fusion may ask you whether you want to upgrade this VM.
102
+
103
+![Upgrade VM](images/fs-ova-upgrade.png)
104
+
105
+How you respond depends on which hardware version (13 or 11) that you want to use. Upgrade if you need to use devices supported only in hardware version 13. Don't upgrade if you want to be compatible with older tools that are supported in hardware version 11.
106
+
107
+## Step 5: Update Login Credentials
108
+
109
+![Splash screen](images/fs-ova-splash.png)
110
+
111
+After the VM is booted, Fusion prompts you to log in.
112
+
113
+**Note** : Because of limitations within OVA support on Fusion, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
114
+
115
+| **Setting** | **Value** |
116
+| --- | --- |
117
+| Username | ``root`` |
118
+| Password | ``changeme`` |
119
+
120
+After you provide these credentials, Fusion prompts you to create a new password and type it a second time to verify it. For security, Photon OS forbids common dictionary words for the root password. Once logged in, you will see the shell prompt.
121
+
122
+![Login](images/fs-ova-login.png)
123
+
124
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os).
125
+
126
+# Installing the ISO Image for Photon OS 2.0
127
+
128
+After you have downloaded the latest Photon OS ISO image into a folder of your choice, open VMware Fusion.
129
+
130
+## Step 1: Start the Installation Process
131
+
132
+From the File menu, choose  **New**.
133
+
134
+![Installation](images/fs-iso-new.png)
135
+
136
+From the Select the Installation Method dialog, select **Install from disc or image**, and then choose **Continue**.
137
+
138
+![Installation method](images/fs-iso-new-prompt.png)
139
+
140
+## Step 2: Select the ISO Image
141
+
142
+Drag a disc image onto the window or choose **Use another disc or disc image...**, choose the ISO file you want, and then choose **Continue**.
143
+
144
+![ISO image](images/fs-iso-new-selected.png)
145
+
146
+## Step 3: Select the Operating System
147
+
148
+On the Choose Operating System dialog, select **Linux**  in the left-hand column and **VMware Photon 64-bit**  in the right-hand column.
149
+
150
+![Operating system](images/fs-iso-os.png)
151
+
152
+Choose **Continue**.
153
+
154
+## Step 4: Select the Virtual Disk (Optional)
155
+
156
+If you are using a Fusion version that is older than Fusion 8, you might see the following dialog.
157
+
158
+![Virtual disk](images/fs-iso-virtual-disk.png)
159
+
160
+If you see this dialog, unless you're installing into an existing machine, choose **Create a new virtual disk**  from the Choose a Virtual Disk dialog, and then choose **Continue**.
161
+
162
+**Note:** Fusion v8 and later automatically defaults to creating a new 8GB disk and formats it automatically. If you want to use an existing disk, or if you want to pre-allocate all 8GB, go into VM Settings, choose **Add Device**, and choose either **New Hard Disk** or **Existing Hard Disk**. Expand **Advanced options**  and configure whether you want to pre-allocate disk space (disabled by default) or split into multiple files (enabled by default).
163
+
164
+## Step 5: Configure VM Settings
165
+
166
+**Important:** Before you finish creating the Photon OS Virtual Machine, we strongly recommend that you customize the virtual machine and remove any unwanted devices that are not needed for a container run-time environment.
167
+
168
+![VM settings](images/fs-iso-finish.png)
169
+
170
+To remove unnecessary devices, choose **Customize Settings**.
171
+
172
+First, choose a name for your Virtual Machine, along with the folder into which you create the Virtual Machine (or accept the default folder).
173
+
174
+![Custom settings](images/fs-iso-name.png)
175
+
176
+Choose **Save**. The virtual machine will be created. The Settings screen allows you to customize virtual hardware for the new virtual machine. If it does not automatically appear, open **Settings** from the Virtual Machine menu bar.
177
+
178
+![Settings](images/fs-iso-settings.png)
179
+
180
+You can remove (recommended) the following components that are not used by Photon OS:
181
+
182
+- Select **Display** and ensure that the **Accelerate 3D Graphics** option is unchecked (it should be unchecked, by default). Select **Show All** to return to the VM Settings.
183
+- Select **CD/DVD (IDE)** and ensure that the **Connect CD/DVD Drive** box is checked (it should be checked by default). Select **Show All** to return to the VM Settings.
184
+- Select **Sound Card**, un-check the **Connect Sound Card** Option, and click **Remove Sound Card.** Choose **Remove** to confirm your action. Select **Show All** to return to the VM Settings.
185
+- Select **USB &amp; Bluetooth** and uncheck the **Share Bluetooth devices with Linux** setting. Select **Show All** to return to the VM Settings.
186
+- Select **Printer** and press the **Remove Printer Port** button in the bottom left hand corner. Choose **Remove** to confirm your action. Select **Show All** to return to the VM Settings.
187
+- Select **Camera** and press the **Remove Camera** button in the bottom left hand corner. Choose **Remove** to confirm your action. Select **Show All** to return to the VM Settings.
188
+- Select **Advanced** and ensure that the **Pass Power Status to VM** option is unchecked (it should be unchecked, by default). Select **Show All,** but do not close the VM Settings window.
189
+
190
+By default, Photon OS is configured with a disk size of 8GB. However, Photon OS uses only the portion of disk space it needs, usually much less that the entire disk size. If you want to pre-allocate the entire disk size (reserving it entirely for Photon OS instead), select **Hard Disk**, expand **Advanced options**, and check **Pre-allocate disk space** (by default, it is unchecked). Select **Show All** to return to the VM Settings.
191
+
192
+## Step 6: Configure a Secure Boot (Optional)
193
+
194
+**Note:**  If you want to configure a secure boot for the Photon OS VM you created, edit its .vmx file  and add the following line:
195
+
196
+**firmware = "efi"**
197
+
198
+The EFI boot ensures that the ISO content is signed by VMware and that the entire stack is secure.
199
+
200
+After you have made the customizations you want, close the Virtual Machine Settings window. You are now ready to boot and begin the installation process.
201
+
202
+## Step 7: Power On the VM
203
+
204
+Return to the Fusion main menu, select the Photon OS Virtual Machine, and click **Start Up** (you can also choose **Start Up** from the Virtual Machine menu).
205
+
206
+Fusion powers on the host and starts the installation. Within a few seconds, Fusion displays the Photon OS installer boot menu.
207
+
208
+![Photon OS installer](images/fs-iso-install.png)
209
+
210
+Press the Enter key on your keyboard to start installing.
211
+
212
+![License](images/fs-iso-license.png)
213
+
214
+Read the License Agreement and press the Enter key to accept.
215
+
216
+## Step 8: Configure the Partition
217
+
218
+The Installer will detect one disk, which should be the 8GB volume configured as part of the virtual machine creation.
219
+
220
+![Partition](images/fs-iso-partition.png)
221
+
222
+Choose **Auto**  to have the installer automatically allocate the partition, or choose **Custom** if you want to configure individual partitions, and then press the Enter key.
223
+
224
+**Note:** If you choose **Custom**, the installer displays the following screen.
225
+
226
+![Custom partition](images/fs-iso-partition-custom.png)
227
+
228
+For each custom partition, choose **Create New**  and specify the following information:
229
+
230
+![New partition](images/fs-iso-partition-new.png)
231
+
232
+**Size** - Preallocated size of this partition, in MB.
233
+
234
+**Type** - One of the following options:
235
+
236
+- **ext3** - ext3 file system
237
+- **ext4** - ext4 file system
238
+- **swap** - swap partition
239
+
240
+**Mountpoint** - Mount point for this partition.
241
+
242
+Choose **OK** and press the Enter key. When you are done defining custom partitions, choose **Next**  and press the Enter key.
243
+
244
+The installer prompts you to confirm that you want to erase the entire disk.
245
+
246
+![Disk erase](images/fs-iso-disk-erase.png)
247
+
248
+Choose **Yes** and press the Enter key to accept and proceed with the installation.
249
+
250
+## Step 9: Select an Installation Option
251
+
252
+After partitioning, the installer prompts you to select one of three installation options:
253
+
254
+![Installation options](images/fs-iso-install-option.png)
255
+
256
+Each install option provides a different run-time environment. Select the option that best meets your requirements.
257
+
258
+| **Option** | **Description** |
259
+| --- | --- |
260
+| **Photon Minimal** | Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. |
261
+| **Photon Full** | Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. |
262
+| **Photon OSTree Server** | This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts. |
263
+
264
+**Note:** The option you choose determines the disk and memory resources required for your installation.
265
+
266
+Select the option you want and press the Enter key.
267
+
268
+## Step 10: Select the Linux Kernel
269
+
270
+The installer prompts you to select the Linux kernel to install:
271
+
272
+![Linux kernel](images/fs-iso-kernel.png)
273
+
274
+- **Hypervisor optimized** means that any components that are not needed for running under a VMware hypervisor have been removed for faster boot times.
275
+- **Generic** means that all components are included.
276
+
277
+## Step 11: Specify the Hostname
278
+
279
+The installer prompts you for a hostname and suggest a randomly generated, unique hostname that you can change if you want.
280
+
281
+![Hostname](images/fs-iso-hostname.png)
282
+
283
+Press the Enter key.
284
+
285
+## Step 12: Specify the System root Password
286
+
287
+_Note: Photon OS will not permit commonly used dictionary words to be set as a root password._
288
+
289
+The installer prompts you to enter the system root password. Type the password, and then press the Enter key.
290
+
291
+![Password](images/fs-iso-root-password.png)
292
+
293
+Confirm the root password by typing it a second time.
294
+
295
+![Password confirmation](images/fs-iso-root-password-confirm.png)
296
+
297
+Press the Enter key. The installer proceeds to install the software. Installation times will vary based on the system hardware and installation options you selected. Most installations complete in less than one minute.
298
+
299
+Once finished, the installer displays a confirmation message (which includes how long it took to install Photon OS) and prompts you to press a key on your keyboard to boot the new VM.
300
+
301
+![Confirmation](images/fs-iso-installed.png)
302
+
303
+## Step 13: Reboot the VM and Log In
304
+
305
+Press any key on the keyboard and the virtual machine will reboot into Photon OS.
306
+
307
+![Reboot](images/fs-iso-splash.png)
308
+
309
+As the initial boot process begins, the installer displays the Photon splash screen, and then a login prompt.
310
+
311
+At the login prompt, enter **root**  as the username and provide the password chosen during the installation.
312
+
313
+![Password](images/fs-iso-login.png)
314
+
315
+You have now successfully setup Photon OS and are ready to use your container run-time environment. Proceed to the next section to deploy a containerized application.
316
+
317
+# Deploying a Containerized Application in Photon OS
318
+
319
+Now that you have your container runtime environment up and running, you can easily deploy a containerized application. For this example, you will deploy the popular open source Web Server Nginx. The Nginx application has a customized VMware package that is published as a dockerfile and can be downloaded, directly, through the Docker module from the Docker Hub.
320
+
321
+## Step 1: Run Docker
322
+
323
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
324
+
325
+    systemctl start docker
326
+
327
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
328
+
329
+    systemctl enable docker
330
+
331
+## Step 2: Run the Nginx Web Server
332
+
333
+Now the Docker daemon service is running, it is a simple task to "pull" and start the Nginx Web Server container from Docker Hub. To do this, type the following command:
334
+
335
+    docker run -d -p 80:80 vmwarecna/nginx
336
+
337
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
338
+
339
+![Docker run](images/fs-docker-run.png)
340
+
341
+After the **docker run** process completes, you return to the command prompt. You now have a fully active website up and running in a container.
342
+
343
+## Step 3: Test the Web Server
344
+
345
+To test that your Web Server is active, run the ifconfig command to get the IP address of the Photon OS Virtual Machine.
346
+
347
+![IP Address](images/fs-docker-ifconfig.png)
348
+
349
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on "eth0."
350
+
351
+Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine. You should see a screen similar to the following example as confirmation that your web server is active.
352
+
353
+![Confirmation](images/fs-docker-confirm.png)
354
+
355
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
356
+
357
+# Installing Photon OS 1.0
358
+
359
+This section provides setup instructions for Photon OS 1.0.
360
+
361
+## Photon OS 1.0 Prerequisites
362
+In order to install and start using Photon OS with VMware Fusion the following pre-requisites must be satisfied:
363
+* VMware Fusion or VMware Workstation must be installed
364
+* Recommended 2GB of free RAM
365
+* Recommended at least 300MB of free disk space
366
+* Photon OS ISO or OVA
367
+
368
+## Importing the Photon OS 1.0 OVA 
369
+
370
+Using the OVA is the easiest way to create a Photon OS VM. Once you’ve downloaded the OVA, open VMware Fusion and select, “Import …” from the File menu. This will open the “Choose an Existing Virtual Machine” wizard. Use the “Choose File …” button to locate and select the Photon OS OVA.
371
+Note: The “Import” operation is specific to Fusion. For Workstation users, simply double-clicking on the OVA will start the import. 
372
+
373
+![Import](https://cloud.githubusercontent.com/assets/11306358/16094763/4ac80e12-3307-11e6-8e7b-10ea353ddbfc.png)
374
+
375
+Click “Continue” and provide the name and storage location for your Photon OS VM. Then, click "Save."
376
+
377
+![Save](https://cloud.githubusercontent.com/assets/11306358/16094759/4ac50000-3307-11e6-8a34-538f36b95f64.png)
378
+
379
+Clicking “Save” will immediately present the Photon OS EULA. In order to start the import process, you'll need to click "Accept" to accept the EULA. 
380
+
381
+![Accept](https://cloud.githubusercontent.com/assets/11306358/16094758/4ac50668-3307-11e6-86ce-943afa12946f.png)
382
+
383
+Once the import is complete, you should get confirmation that the import was Finished and a summary of the settings for your Photon OS VM. Click “Customize Settings” to change the operating system, as recognized by the hypervisor. Within the "General" System Settings for the newly imported VM, click the selection box next to "OS" and select, "VMware Photon 64-bit," as shown below.
384
+
385
+![Settings](https://cloud.githubusercontent.com/assets/11306358/16095187/24abc4f6-3309-11e6-9faa-c4e7b15ba63a.png) 
386
+
387
+Close the settings window and your Photon OS VM is ready to power on.
388
+
389
+![Confirmation](https://cloud.githubusercontent.com/assets/11306358/16094764/4acf69dc-3307-11e6-9d62-7dd37546a233.png)
390
+
391
+Clicking “Finish” will immediately power on your Photon OS VM. Once the VM is booted, you will be presented with a login prompt. Because of limitations within OVA support on Fusion and Workstation, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
392
+
393
+`Username: root`
394
+`Password: changeme`
395
+
396
+As soon as you enter these credentials, you will be forced to create a new password by entering the new password twice before you can access the shell prompt.
397
+
398
+![Login](https://cloud.githubusercontent.com/assets/11306358/16094765/4ad06ce2-3307-11e6-827f-e61107185f42.png)
399
+ 
400
+## Installing Photon OS 1.0 on VMware Fusion from an ISO Image	
401
+With the latest Photon OS ISO image downloaded into a folder of your choice, Open VMware Fusion and Select “File->New.” The following screen will appear: 
402
+
403
+![File->New](https://cloud.githubusercontent.com/assets/11306358/14651747/df593c52-0636-11e6-9cbe-bfd0db9bfa89.png)
404
+
405
+Select "Create a custom virtual machine" from the "Select the Installation Method" dialog, then, click continue. On the "Choose Operating System" dialog, select, "Linux" in the left-hand column and "VMware Photon 64-bit" in the right-hand column. 
406
+
407
+![fusion7](https://cloud.githubusercontent.com/assets/11306358/14651749/df6fbd74-0636-11e6-8070-a584bddf39f5.png)
408
+
409
+Unless you're installing into an existing machine, select, "Create a new virtual disk" from the "Choose a Virtual Disk dialog, then click "Continue."
410
+
411
+![fusion7b](https://cloud.githubusercontent.com/assets/11306358/14651751/df7428a0-0636-11e6-85b2-64e2dff9be84.png)
412
+
413
+You're almost finished; but, before finishing the Photon OS Virtual Machine Creation, we strongly recommend that you customize the virtual machine and remove any unwanted devices that are not needed for a container runtime environment.  
414
+
415
+![fusion9](https://cloud.githubusercontent.com/assets/11306358/14651750/df7385f8-0636-11e6-9310-0d7f375dd7b5.png) 
416
+
417
+To remove unnecessary devices, from the screen shown below, select “Customize Settings."
418
+
419
+First, choose a name for your Virtual Machine and the folder into which you would like to create the Virtual Machine.  If the default folder of “Virtual Machines” is acceptable, click “Save”.  
420
+
421
+![Save](https://cloud.githubusercontent.com/assets/11306358/16105478/724ea650-3350-11e6-8e69-272f6a1f6097.png)
422
+
423
+The virtual machine will be created and a new screen will appear, as shown below, that will allow virtual hardware customization to the new virtual machine. If it does not automatically appear, open "Settings" from the Virtual Machine menu bar. 
424
+
425
+![fusion11](https://cloud.githubusercontent.com/assets/11306358/14653053/cd434ffc-063c-11e6-9861-924489b26d75.png)
426
+
427
+It is our recommendation that the following components are removed, since they’re not used by Photon OS:
428
+* Select “Sound Card” and un-tick the “Connect Sound Card” Option and click "Remove Sound Card." Confirm your action and return to the VM Settings by clicking “Show All.”
429
+* Select “Camera” and press the “Remove Camera” button in the bottom left hand corner, confirm your action and then select “Show All” to return to the VM Settings.
430
+* Select “Printer” and press the “Remove Printer Port” button in the bottom left hand corner, confirm your action and then select “Show All” to return to the VM Settings.
431
+* Select “USB & Bluetooth” and uncheck the “Share Bluetooth devices with Linux” setting and then select “Show All”
432
+* Select “Display” and ensure that the “Accelerate 3D Graphics” option is unchecked (it should be unchecked, by default) and, then, return to the VM Settings by selecting “Show All.”
433
+* Select “Advanced” and ensure that the “Pass Power Status to VM” option is unchecked. Select “Show All," but do not close the VM Settings window.
434
+
435
+At this stage we have now made all the necessary customizations and we are ready to select the Photon OS ISO image to boot and begin the installation process. 
436
+
437
+From the Virtual Machine Settings menu in Fusion, select "CD/DVD (IDE)" and, as shown below, point to the downloaded Photon OS ISO and ensure that there is a check in the "Connect CD/DVD Drive" box.
438
+
439
+![Connect CD/DVD](https://cloud.githubusercontent.com/assets/11306358/16105475/72391e0c-3350-11e6-94a2-64587a06e838.png)
440
+
441
+Return to the Fusion main menu, select the Photon OS Virtual Machine and press the “Play” button to power on the host and start the installation.
442
+Within a few seconds the Photon OS Installer Boot Menu will appear.
443
+
444
+![Boot menu](https://cloud.githubusercontent.com/assets/11306358/16105477/724e902a-3350-11e6-8482-7544d2a6c3fb.png)
445
+
446
+Select – “Install” to proceed. 
447
+
448
+![Install](https://cloud.githubusercontent.com/assets/11306358/16105480/7251abca-3350-11e6-8f8e-d26244fd75ff.png)
449
+
450
+After you accept the EULA, the Installer will detect one disk, which should be the 8GB volume configured as part of the virtual machine creation. Select the disk and press enter.  You will be prompted to confirm it is okay to erase the entire disk, select “Yes” to accept and proceed with the installation.
451
+You will now be presented with four installation options:
452
+
453
+![fusion15](https://cloud.githubusercontent.com/assets/11306358/14651982/d464f31c-0637-11e6-938d-5d6132ccd63f.png)
454
+
455
+Each install option provides a different runtime environment, depending on your requirements:
456
+
457
+* Photon Minimal: Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. 
458
+
459
+* Photon Full: Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. 
460
+
461
+* Photon OSTree Host: This installation profile creates a Photon OS instance that will source its packages from a central rpm-ostree server and continue to have the library and state of packages managed by the definition that is maintained on the central rpm-ostree server. Use Photon OStree Hosts when you are interested in experimenting with the concept of a centrally authored and maintained OS version. This concept of treating the OS as a versioned, atomic entity can simplify lifecycle and security management at scale. 
462
+
463
+* Photon OSTree Server: This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the “Photon OSTree Host” installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts.  
464
+
465
+For the purposes of this how-to guide, select option 1, “Photon Minimal.”  Once this selection is highlighted, press the Enter key on your keyboard.
466
+
467
+You will now be prompted for a hostname. Photon OS will prepopulate a randomly generated, unique hostname; you can either use this suggestion or enter your own hostname. After selecting a hostname and pressing “Enter,” you will be prompted to first enter and, then, confirm the system root password.
468
+
469
+*Note: Photon OS will not permit commonly used dictionary words to be set as a root password.*
470
+
471
+After confirming the password, the installation process should begin.
472
+Installation times will vary based on system hardware and installation options, but most installations complete in less than one minute. Once the install is complete you will get a confirmation prompt on the screen stating “Congratulations, Photon has been installed in xx secs, Press any key to continue to boot…”  - Press any key and the virtual machine will reboot into Photon OS.
473
+
474
+![Reboot](https://cloud.githubusercontent.com/assets/11306358/16105476/724e70c2-3350-11e6-84af-0c487266108d.png)
475
+
476
+As the initial boot process begins, you will see the Photon splash screen before you are taken to a login prompt.
477
+
478
+![Login](https://cloud.githubusercontent.com/assets/11306358/16094764/4acf69dc-3307-11e6-9d62-7dd37546a233.png)
479
+
480
+At the login prompt, enter “root” as the username and provide the password chosen during the installation. 
481
+
482
+You have now successfully setup Photon OS and are ready to use your container runtime environment.
483
+
484
+## Installing a Containerized Application on Photon OS 1.0
485
+
486
+Now that you have your container runtime environment up and running, you may be wondering, “what can I do now?” A command prompt is not the most exciting!  To help to demonstrate the ease in which you can deploy a containerized application, we will showcase how you can quickly get a Web Server up and running.
487
+For this example, we will use the popular open source Web Server Nginx. The Nginx application has a customized VMware package and published as a dockerfile and can be downloaded, directly, through the Docker module from the Docker Hub.
488
+
489
+To run Docker from the command prompt, enter the command below to initialize the docker engine:
490
+
491
+`systemctl start docker`
492
+
493
+To ensure Docker daemon service runs on every subsequent VM reboot, enter:
494
+
495
+`systemctl enable docker`
496
+
497
+Now the Docker daemon service is running, it is a simple task to “pull” and start the Nginx Web Server container from Docker Hub.  To do this, type the following command:
498
+
499
+`docker run -d -p 80:80 vmwarecna/nginx`
500
+
501
+This will then pull the Nginx Web Server files and appropriate dependent container filesystem layers to ensure this containerized application can run.  You will see a screenshot similar to below, as the container and dependencies are downloaded and the container is prepared to run:
502
+
503
+![fusion19](https://cloud.githubusercontent.com/assets/11306358/9568066/b3950dd8-4f04-11e5-9333-ac0551a22ace.jpg)
504
+
505
+Once “docker run” process is completed, you will be returned to the command prompt.  You now have a fully active website up and running in a container!
506
+
507
+To test that your Web Server is active, we need to get the IP address of the Photon OS Virtual Machine. To get the IP address, enter the following command ifconfig. This will now display a list of adapters connected to the virtual machine.  Typically, the web server daemon will be bound on “eth0.”  
508
+ 
509
+Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine.  The following screen will appear and that will show that your web server is active: -
510
+
511
+![fusion20](https://cloud.githubusercontent.com/assets/11306358/9568067/b3b6e278-4f04-11e5-93f6-de8383530518.jpg)
512
+
513
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
0 514
new file mode 100644
... ...
@@ -0,0 +1,68 @@
0
+# Running Project Photon on vCloud Air
1
+
2
+Most of the contents are generally applicable, but some items have changed slightly. We're working through the catalog of changes. If you see something that's terribly out of sorts or incorrect, kindly either make the edit or raise an issue. Thanks - the Photon OS Team
3
+
4
+## What is Photon OS?
5
+Photon OS is a tech preview of an open source, Linux container host runtime optimized for vSphere. Photon OS is extensible, lightweight, and supports the most common container formats including Docker, Rocket (rkt) and Garden.
6
+Photon OS includes a small footprint, yum-compatible, package-based lifecycle management system – called “tdnf”- and, alternatively, supports an rpm-ostree image-based system versioning.
7
+
8
+When used with development tools and environments such as VMware Fusion, VMware Workstation, HashiCorp (Vagrant and Atlas) and production runtime environment (vSphere, vCloud Air), Photon OS allows seamless migration of container based apps from development to production.  
9
+
10
+## Introduction
11
+This document explains how to get started using Photon OS as a runtime environment for Linux containers by running Photon OS as a VM instance on vCloud Air.  This guide will provide instructions on deploying Photon OS from the vCloud Air public catalog. 
12
+
13
+Once Photon OS is installed, this guide will also provide instructions on how to demonstrate how simple it can be to deploy a containerized application with Docker and will highlight the installation of a web server simply by running one command!
14
+
15
+## Photon OS on vCloud Air Prerequisites
16
+The following items are required for preparing and launching Photon OS on Google Compute Engine:
17
+
18
+* An account on vCloud Air
19
+
20
+With the TP2 release, Photon OS is published in the vCloud Air catalog. Therefore, it is no longer to download a Photon OS image before getting started. 
21
+
22
+## Creating a Photon OS Instance
23
+Begin by logging into your vCloud Air account and selecting the Service into which you'd like to deploy your Photon OS instance. In this example, we'll use the Virtual Private Cloud OnDemand Service. 
24
+
25
+![Photon OS Instance](images/photon-os-instance.png)
26
+ 
27
+Once you've selected the Service for your instance, you'll need to specify the Location for your virtual datacenter from the list of vCloud Air locations. Clicking "Continue" will start the process of creating your virtual datacenter, an associated gateway and a routed network. 
28
+
29
+After vCloud Air is finished creating your virtual datacenter, you're ready to click the "Create your first virtual machine" button to create your Photon OS instance. 
30
+
31
+![Create virtual machine](images/create-virtual-machine.png)
32
+ 
33
+When you click the "Create your first virtual machine" button, you'll be presented the list of templates available in vCloud Air. Select the "64 Bit" option of VMware Photon OS - Tech Preview 2 and click the "Continue" button.
34
+
35
+![64-bit option](images/64-bit-option.png)
36
+ 
37
+Before vCloud Air can create your Photon OS VM, you need to confirm the hardware configuration. The defaults presented are the recommended values; adjust as necessary to accommodate the container workloads that you expect to run in this Photon OS instance. Once you're satisfied with the hardware configuration, click "Create Virtual Machine" Once complete, you should see your powered-on Photon OS instance ready to start the Docker engine and run a container workload.
38
+ 
39
+## Installing a Containerized Application to Help Demonstrate Capability
40
+Now that you have your container runtime environment up and running, you may be wondering, “what can I do now?” A command prompt is not the most exciting!  To help to demonstrate the ease in which you can deploy a containerized application, we will showcase how you can quickly get a Web Server up and running.
41
+
42
+For this example, we will use the popular open source Web Server Nginx. The Nginx application has a customized VMware package and published as a dockerfile and can be downloaded, directly, through the Docker module from the Docker Hub.
43
+
44
+To run Docker from the command prompt, enter the command below to initialize the Docker engine:
45
+
46
+`systemctl start docker`
47
+
48
+To ensure Docker daemon service runs on every subsequent VM reboot, enter:
49
+
50
+`systemctl enable docker`
51
+
52
+Now the Docker daemon service is running, you're almost ready to “pull” and start the Nginx Web Server container from Docker Hub.  First, you'll need to ensure that you've configured your vCloud Air VM to be connected to the Internet by following the instructions found, [here](http://vcloud.vmware.com/using-vcloud-air/tutorials/connecting-a-virtual-machine-to-recieve-data-from-the-internet).  Once your Photon OS VM is connected to the Internet, the Docker engine can pull images from the Docker hub; to pull down the VMware-modified nginx container, type the following command:
53
+
54
+`docker run -d -p 80:80 vmwarecna/nginx`
55
+
56
+This will then pull the Nginx Web Server files and appropriate dependent containers to ensure this containerized application can run.  You will see a screenshot similar to below, as the container and dependencies are downloaded and the container is prepared to run:
57
+ 
58
+Once “docker run” process is completed, you will be returned to the command prompt.  You now have a fully active website up and running through typing just a single command within Photon OS using containers.
59
+
60
+To test that your Web Server is active, we need to get the IP address of the Photon OS Virtual Machine. To get the IP address, enter the following command 'ifconfig'. This command will display a list of network adapters connected to the virtual machine.  Typically, the web server daemon will be bound on “eth0;” record the IP address associated with eth0. Alternatively, visit the network tab of the status page of your Photon OS instance where the IP address is listed under “Virtual Machine IP."
61
+ 
62
+Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine.  The following screen should appear and that will show that your web server is active:
63
+ 
64
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
65
+
66
+
67
+
0 68
new file mode 100644
... ...
@@ -0,0 +1,120 @@
0
+# Summary
1
+
2
+## Photon OS 1.0 and 2.0
3
+
4
+----
5
+
6
+- [Introduction](README.md)
7
+- [Getting Started Guides](getting-started-guides.md)
8
+    - [Downloading Photon OS](Downloading-Photon-OS.md)
9
+    -  [Quick Start](photon-admin-guide.md#getting-started-with-photon-os-20)
10
+    -   [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md)
11
+    -   [What is New in Photon OS 2.0](What-is-New-in-Photon-OS-2.0.md)
12
+    -   [Running Photon OS on vSphere](Running-Photon-OS-on-vSphere.md)
13
+    -   [Running Photon OS on Fusion](Running-Project-Photon-on-Fusion.md)
14
+    -   [Running Photon OS on Workstation](Running-Photon-OS-on-Workstation.md)
15
+    -   [Running Photon OS on AWS EC2](Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute.md)
16
+    -   [Running Photon OS on Microsoft Azure](Running-Photon-OS-on-Microsoft-Azure.md)
17
+    -   [Running Photon OS on Google Compute Engine](Running-Photon-OS-on-Google-Compute-Engine.md)
18
+        -  [Photon OS on GCE](gce.md)
19
+    - [Running Project Photon on vCloud Air](Running-Project-Photon-on-vCloud-Air.md)        
20
+- [Administration Guides](admin-guides.md)
21
+    - [Photon OS Administration Guide](photon-admin-guide.md)
22
+         - [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md)
23
+         - [Network Configuration Manager - C API](netmgr.c.md)
24
+         - [Photon Network Manager Command-line Interface (netmgr)](netmgr-cli.md)
25
+         - [Network Configuration Manager - Python API](netmgr.python.md)
26
+         - [How to use Photon Management Daemon](pmd-cli.md)
27
+         - [Managing Packages in Photon OS with tdnf](tdnf.md)
28
+    - [Photon RPM OSTree](Photon-RPM-OSTree-a-simple-guide.md)
29
+        1. [Introduction](Photon-RPM-OSTree-1-Introduction.md)  
30
+            1. [What is OSTree? How about   RPM-OSTree?](Photon-RPM-OSTree-1-Introduction.md#11-what-is-ostree-how-about-rpm-ostree)
31
+            1. [Why use RPM-OSTree in Photon?](Photon-RPM-OSTree-1-Introduction.md#12-why-use-rpm-ostree-in-photon)
32
+            1. [Photon with RPM-OSTree installation profiles](Photon-RPM-OSTree-1-Introduction.md#13-photon-with-rpm-ostree-installation-profiles)
33
+            1. [Terminology](Photon-RPM-OSTree-1-Introduction.md#14-terminology)
34
+            1. [Sample code](Photon-RPM-OSTree-1-Introduction.md#15-sample-code)
35
+            1. [How to read this book](Photon-RPM-OSTree:-1-Introduction#16-how-to-read-this-book)
36
+            1. [RPM-OSTree in Photon OS 2.0](Photon-RPM-OSTree:-1-Introduction#17-rpm-ostree-in-photon-os-20)
37
+        2. [Installing a Photon RPM-OSTree host against default server repository](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md)  
38
+            1. [Who is this for?](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#21-who-is-this-for)
39
+            1. [Installing the ISO, step by step](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#22-installing-the-iso-step-by-step)
40
+        3. [Concepts in action](Photon-RPM-OStree-3-Concepts-in-action.md)  
41
+            1. [Querying the deployed   filetrees](Photon-RPM-OStree-3-Concepts-in-action.md#31-querying-the-deployed-filetrees)
42
+            1. [Bootable filetree version](Photon-RPM-OStree-3-Concepts-in-action.md#32-bootable-filetree-version)
43
+            1. [Commit ID](Photon-RPM-OStree-3-Concepts-in-action.md#33-commit-id)
44
+            1. [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#34-osname)
45
+            1. [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#35-refspec)
46
+            1. [Deployments](Photon-RPM-OStree-3-Concepts-in-action.md#36-deployments)
47
+        4. [Querying for commit, file and package metadata](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md)  
48
+            1. [Commit history](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#41-commit-history)
49
+            1. [Listing file mappings](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#42-listing-file-mappings)
50
+            1. [Listing configuration changes](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#43-listing-configuration-changes)
51
+            1. [Listing packages](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#44-listing-packages)
52
+            1. [Querying for package details](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#45-querying-for-package-details)
53
+            1. [Why am I unable to install, update or delete packages?](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#46-why-am-i-unable-to-install-update-or-delete-packages)
54
+        5. [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md)  
55
+            1. [Is it an update or an upgrade?](Photon-RPM-OSTree-5-Host-updating-operations.md#51-is-it-an-update-or-an-upgrade)
56
+            1. [Incremental upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#52-incremental-upgrade)
57
+            1. [Listing file differences](Photon-RPM-OSTree-5-Host-updating-operations.md#52-listing-file-differences)
58
+            1. [Listing package differences](Photon-RPM-OSTree-5-Host-updating-operations.md#52-listing-package-differences)
59
+            1. [Rollback](Photon-RPM-OSTree-5-Host-updating-operations.md#55-rollback)
60
+            1. [Deleting a deployed filetree](Photon-RPM-OSTree-5-Host-updating-operations.md#56-deleting-a-deployed-filetree)
61
+            1. [Version skipping upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#57-version-skipping-upgrade)
62
+            1. [Tracking parent commits](Photon-RPM-OSTree-5-Host-updating-operations.md#58-tracking-parent-commits)
63
+            1. [Resetting a branch to a previous commit](Photon-RPM-OSTree-5-Host-updating-operations.md#59-resetting-a-branch-to-a-previous-commit)
64
+        6. [Installing a Photon RPM-OSTree server](Photon-RPM-OSTree-6-Installing-a-server.md)  
65
+        7. [Installing a Photon RPM-OStree host against a custom server repository](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md)  
66
+            1. [Manual install of a custom host](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#71-manual-install-of-a-custom-host)
67
+            1. [Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#72-automated-install-of-a-custom-host-via-kickstart)
68
+        8. [File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md)
69
+            1. [Starting a fresh OSTree repo](Photon-RPM-OStree-8-File-oriented-server-operations.md#81-starting-a-fresh-ostree-repo)
70
+            1. [Checking out a filetree](Photon-RPM-OStree-8-File-oriented-server-operations.md#82-checking-out-a-filetree)
71
+            1. [Committing changes to a filetree](Photon-RPM-OStree-8-File-oriented-server-operations.md#83-committing-changes-to-a-filetree)
72
+            1. [Downloading the changes at the host](Photon-RPM-OStree-8-File-oriented-server-operations.md#84-downloading-the-changes-at-the-host)
73
+            1. [Creating summary metadata](Photon-RPM-OStree-8-File-oriented-server-operations.md#85-creating-summary-metadata)
74
+        9. [Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md)  
75
+            1. [JSON configuration file](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#91-json-configuration-file)
76
+            1. [Package addition, removal, upgrade](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#92-package-addition-removal-upgrade)
77
+            1. [RPMS repository](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#93-rpms-repository)
78
+            1. [Composing a tree](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#94-composing-a-tree)
79
+            1. [Automatic version prefix](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#95-automatic-version-prefix)
80
+            1. [Installing package updates](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#96-installing-package-updates)
81
+            1. [Creating server metadata](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#97-creating-server-metadata)
82
+            1. [Starting a fresh OSTree repo](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#98-starting-a-fresh-ostree-repo)
83
+        10. [Remotes](Photon-RPM-OSTree-10-Remotes.md)  
84
+            1. [Listing remotes](Photon-RPM-OSTree-10-Remotes.md#101-listing-remotes)
85
+            1. [GPG signature verification](Photon-RPM-OSTree-10-Remotes.md#102-gpg-signature-verification)
86
+            1. [Switching repositories](Photon-RPM-OSTree-10-Remotes.md#103-switching-repositories)
87
+            1. [Adding and removing remotes](Photon-RPM-OSTree-10-Remotes.md#104-adding-and-removing-remotes)
88
+            1. [List available branches](Photon-RPM-OSTree-10-Remotes.md#105-list-available-branches)
89
+        11. [Running container applications between bootable images](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md)  
90
+            1. [Downloading a docker container appliance](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#111-downloading-a-docker-container-appliance)
91
+            1. [Rebooting into an existing image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#112-rebooting-into-an-existing-image)
92
+            1. [Reboot into a newly created image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#113-reboot-into-a-newly-created-image)
93
+        12. [Install or rebase to Photon OS 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md)  
94
+            1. [Installing an RPM-OSTree server](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#121-installing-an-rpm-ostree-server)
95
+            1. [Installing an RPM-OSTree host](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#122-installing-an-rpm-ostree-host)
96
+            1. [Rebasing a host from Photon 1.0 to 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#123-rebasing-a-host-from-photon-10-to-20)
97
+            1. [Creating a host raw image](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#124-creating-a-host-raw-image)
98
+    
99
+            [Appendix A: Known issues](Photon-RPM-OSTree-Appendix-A-Known-issues.md)  
100
+- [Troubleshooting](photon-os-troubleshooting-guide.md)
101
+- [How-To Guides](how-to-guides.md)
102
+    - [Setting Up a Swarm Cluster with DNS](Install-and-Configure-a-Swarm-Cluster-with-DNS-Service-on-PhotonOS.md)
103
+    - [Setting Up a Mesos Cluster](Install-and-Configure-a-Production-Ready-Mesos-Cluster-on-Photon-OS.md)
104
+    - [Setting Up Marathon for a Mesos Cluster](Install-and-Configure-Marathon-for-Mesos-Cluster-on-PhotonOS.md)
105
+    - [Setting Up DCOS CLI for Mesos](Install-and-Configure-DCOS-CLI-for-Mesos.md)
106
+    - [Setting Up Mesos DNS on a Mesos Cluster](Install-and-Configure-Mesos-DNS-on-a-Mesos-Cluster.md)
107
+    - [Setting Up a Network PXE Boot Server](PXE-boot.md)
108
+    - [Working with Kickstart](kickstart.md)
109
+    - [Running Kubernetes](kubernetes.md)
110
+    - [Mounting Remote File Systems](nfs-utils.md)
111
+    - [Building Photon OS from the Source Code](build-photon.md)
112
+    - [Installing and Using Lightwave on Photon OS](Installing-and-Using-Lightwave-on-Photon-OS.md)
113
+        - [Installing the Lightwave Server and Configuring It as a Domain Controller on a Photon Image](Installing-Lightwave-Server-and-Setting-Up-a-Domain.md) 
114
+        - [Installing the Lightwave Client on a Photon Image and Joining the Client to a Domain](Installing-Lightwave-Client-and-Joining-a-Domain.md)
115
+        - [Installing the Photon Management Daemon on a Lightwave Client](Installing-the-Photon-Management-Daemon-on-a-Lightwave-Client.md)
116
+        - [Remotely Upgrade a Single Photon OS Machine With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-a-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
117
+        - [Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
118
+- [Frequently Asked Questions](Frequently-Asked-Questions.md)
119
+* [Security](https://github.com/vmware/photon/wiki/Security-Advisories)
0 120
\ No newline at end of file
1 121
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+# Upgrading the Kernel Version Requires Grub Changes for AWS and GCE Images
1
+
2
+If you upgrade the Photon OS Linux kernel with `tdnf upgrade linux`, you must modify the `/boot/grub2/grub.cfg` file to reflect the correct kernel version so that it works with AWS and GCE images. For example, if you install Photon OS 1.0 with kernel 4.4.8 and then upgrade the Linux kernel to 4.4.26, you must edit the /boot/grub2/grub.cfg file to replace the line containing `linux /boot/vmlinuz-4.4.8` with `linux /boot/vmlinuz-4.4.26`.
0 3
\ No newline at end of file
1 4
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+# Upgrading to Photon OS 2.0
1
+
2
+You can upgrade your existing Photon OS 1.0 VMs to take advantage of security and functionality enhancements in Photon OS 2.0. For details, see [What is New in Photon OS 2.0](What-is-New-in-Photon-OS-2.0.md).
3
+
4
+Photon OS 2.0 provides a seamless, in-place upgrade path for Photon OS 1.0 implementations. You simply download an upgrade package, run a script, and reboot the VM. The upgrade script will update your packages and retain your 1.0 customizations in your new OS 2.0 VM.
5
+
6
+**Note:** If your 1.0 VM is a full install, then you will have a 2.0 VM that represents a full install (all packages and dependencies). Upgrading a minimal installation takes less time due to fewer packages.
7
+
8
+For each Photon OS 1.0 VM that you want to upgrade, complete the following steps:
9
+
10
+1. Back up all existing settings and data for the Photon OS 1.0 VM.
11
+
12
+2. Stop any services (for example, docker) that are currently running in the VM.
13
+
14
+3. Download the upgrade package. From the Photon OS 1.0 command line, run the following command:
15
+~~~~
16
+    # tdnf install photon-upgrade
17
+~~~~    
18
+4. Run the upgrade script (photon-upgrade.sh), which upgrades packages and dependencies. Answer Y to any questions.
19
+~~~~
20
+    # photon-upgrade.sh
21
+~~~~
22
+5. Answer Y to reboot the VM. The upgrade script powers down the Photon OS 1.0 VM and powers it on as a Photon OS 2.0 VM.
23
+
24
+After upgrading but before you deploy into production, test all previous functionality to ensure that everything works as expected.
0 25
\ No newline at end of file
1 26
new file mode 100644
2 27
Binary files /dev/null and b/docs/VMW_logo.png differ
3 28
new file mode 100644
... ...
@@ -0,0 +1,24 @@
0
+Photon OS 2.0 introduces new security and OS management capabilities, along with new and updated packages for Cloud native applications and VMware appliances. This topic summarizes what&#39;s new and different in Photon OS 2.0.
1
+
2
+## Security Enhancements
3
+
4
+- Security-hardened Linux kernel: In addition to the linux and linux-esx kernels, Photon OS 2.0 provides a new security-hardened kernel (linux-secure), which is configured according to the recommendations of the Kernel Self-Protection Project (KSPP), plus includes most of the Pax patches.
5
+- Secure EFI boot: The operating system now boots with validated trust.
6
+- Python 3 (Python 2 is deprecated)
7
+
8
+## OS and Storage Management Enhancements
9
+
10
+- The Network Configuration Manager provides a library of C, Python, and CLI APIs that simplify common configuration tasks for network resources, including network interfaces, IP addresses, routes, DNS servers and domains, DHCP DUID and IAID, NTP servers, and other service management operations.
11
+- The Photon Management Daemon (PMD) provides the remote management of a Photon instance via a command line client (pmd-cli), Python, and REST API interfaces. The PMD provides the ability to manage network interfaces,  packages, firewalls, users, and user groups.
12
+- Project Lightwave integration: The open source security platform from VMware authenticates and authorizes users and groups with AD or LDAP.
13
+- Support for persistent volumes to store the data of cloud-native apps on VMware vSAN
14
+- Update notification
15
+- Guestinfo for cloud-init
16
+
17
+## Package and Binary Maintenance
18
+
19
+- Cloud-ready images for rapid deployment on Microsoft Azure (new), Google Compute Engine (GCE), Amazon Elastic Compute Cloud (EC2), and VMware products (vSphere, Fusion, and Workstation)
20
+- New Linux OSS packages
21
+- New packages, including Calico, Heapster, nginx-ingress, RabbitMQ, and the proxy for Wavefront by VMware
22
+- Updates to key packages, including the LTS version of the Linux kernel (4.9) and systemd
23
+- Support for multiple Java versions
0 24
new file mode 100644
... ...
@@ -0,0 +1,80 @@
0
+# Photon OS Administration Guides
1
+
2
+- [Photon OS Administration Guide](photon-admin-guide.md)
3
+    - [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md)
4
+    - [Network Configuration Manager - C API](netmgr.c.md)
5
+    - [Photon Network Manager Command-line Interface (netmgr)](netmgr-cli.md)
6
+    - [Network Configuration Manager - Python API](netmgr.python.md)
7
+    - [How to use Photon Management Daemon](pmd-cli.md)
8
+    - [Managing Packages in Photon OS with tdnf](tdnf.md)
9
+- [Photon RPM OSTree](Photon-RPM-OSTree-a-simple-guide.md)
10
+    1. [Introduction](Photon-RPM-OSTree-1-Introduction.md)
11
+        1. [What is OSTree? How about   RPM-OSTree?](Photon-RPM-OSTree-1-Introduction.md#11-what-is-ostree-how-about-rpm-ostree)
12
+        1. [Why use RPM-OSTree in Photon?](Photon-RPM-OSTree-1-Introduction.md#12-why-use-rpm-ostree-in-photon)
13
+        1. [Photon with RPM-OSTree installation profiles](Photon-RPM-OSTree-1-Introduction.md#13-photon-with-rpm-ostree-installation-profiles)
14
+        1. [Terminology](Photon-RPM-OSTree-1-Introduction.md#14-terminology)
15
+        1. [Sample code](Photon-RPM-OSTree-1-Introduction.md#15-sample-code)
16
+        1. [How to read this book](Photon-RPM-OSTree:-1-Introduction#16-how-to-read-this-book)
17
+        1. [RPM-OSTree in Photon OS 2.0](Photon-RPM-OSTree:-1-Introduction#17-rpm-ostree-in-photon-os-20)
18
+    2. [Installing a Photon RPM-OSTree host against default server repository](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md)  
19
+        1. [Who is this for?](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#21-who-is-this-for)
20
+        1. [Installing the ISO, step by step](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#22-installing-the-iso-step-by-step)
21
+    3. [Concepts in action](Photon-RPM-OStree-3-Concepts-in-action.md)  
22
+        1. [Querying the deployed   filetrees](Photon-RPM-OStree-3-Concepts-in-action.md#31-querying-the-deployed-filetrees)
23
+        1. [Bootable filetree version](Photon-RPM-OStree-3-Concepts-in-action.md#32-bootable-filetree-version)
24
+        1. [Commit ID](Photon-RPM-OStree-3-Concepts-in-action.md#33-commit-id)
25
+        1. [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#34-osname)
26
+        1. [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#35-refspec)
27
+        1. [Deployments](Photon-RPM-OStree-3-Concepts-in-action.md#36-deployments)
28
+    4. [Querying for commit, file and package metadata](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md)  
29
+        1. [Commit history](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#41-commit-history)
30
+        1. [Listing file mappings](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#42-listing-file-mappings)
31
+        1. [Listing configuration changes](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#43-listing-configuration-changes)
32
+        1. [Listing packages](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#44-listing-packages)
33
+        1. [Querying for package details](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#45-querying-for-package-details)
34
+        1. [Why am I unable to install, update or delete packages?](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#46-why-am-i-unable-to-install-update-or-delete-packages)
35
+    5. [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md)  
36
+        1. [Is it an update or an upgrade?](Photon-RPM-OSTree-5-Host-updating-operations.md#51-is-it-an-update-or-an-upgrade)
37
+        1. [Incremental upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#52-incremental-upgrade)
38
+        1. [Listing file differences](Photon-RPM-OSTree-5-Host-updating-operations.md#52-listing-file-differences)
39
+        1. [Listing package differences](Photon-RPM-OSTree-5-Host-updating-operations.md#52-listing-package-differences)
40
+        1. [Rollback](Photon-RPM-OSTree-5-Host-updating-operations.md#55-rollback)
41
+        1. [Deleting a deployed filetree](Photon-RPM-OSTree-5-Host-updating-operations.md#56-deleting-a-deployed-filetree)
42
+        1. [Version skipping upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#57-version-skipping-upgrade)
43
+        1. [Tracking parent commits](Photon-RPM-OSTree-5-Host-updating-operations.md#58-tracking-parent-commits)
44
+        1. [Resetting a branch to a previous commit](Photon-RPM-OSTree-5-Host-updating-operations.md#59-resetting-a-branch-to-a-previous-commit)
45
+    6. [Installing a Photon RPM-OSTree server](Photon-RPM-OSTree-6-Installing-a-server.md)  
46
+    7. [Installing a Photon RPM-OStree host against a custom server repository](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md)  
47
+         1. [Manual install of a custom host](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#71-manual-install-of-a-custom-host)
48
+         1. [Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#72-automated-install-of-a-custom-host-via-kickstart)
49
+    8. [File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md)
50
+         1. [Starting a fresh OSTree repo](Photon-RPM-OStree-8-File-oriented-server-operations.md#81-starting-a-fresh-ostree-repo)
51
+         1. [Checking out a filetree](Photon-RPM-OStree-8-File-oriented-server-operations.md#82-checking-out-a-filetree)
52
+         1. [Committing changes to a filetree](Photon-RPM-OStree-8-File-oriented-server-operations.md#83-committing-changes-to-a-filetree)
53
+         1. [Downloading the changes at the host](Photon-RPM-OStree-8-File-oriented-server-operations.md#84-downloading-the-changes-at-the-host)
54
+         1. [Creating summary metadata](Photon-RPM-OStree-8-File-oriented-server-operations.md#85-creating-summary-metadata)
55
+    9. [Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md)  
56
+         1. [JSON configuration file](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#91-json-configuration-file)
57
+         1. [Package addition, removal, upgrade](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#92-package-addition-removal-upgrade)
58
+         1. [RPMS repository](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#93-rpms-repository)
59
+         1. [Composing a tree](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#94-composing-a-tree)
60
+         1. [Automatic version prefix](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#95-automatic-version-prefix)
61
+         1. [Installing package updates](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#96-installing-package-updates)
62
+         1. [Creating server metadata](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#97-creating-server-metadata)
63
+         1. [Starting a fresh OSTree repo](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#98-starting-a-fresh-ostree-repo)
64
+    9. [Remotes](Photon-RPM-OSTree-10-Remotes.md)  
65
+         1. [Listing remotes](Photon-RPM-OSTree-10-Remotes.md#101-listing-remotes)
66
+         1. [GPG signature verification](Photon-RPM-OSTree-10-Remotes.md#102-gpg-signature-verification)
67
+         1. [Switching repositories](Photon-RPM-OSTree-10-Remotes.md#103-switching-repositories)
68
+         1. [Adding and removing remotes](Photon-RPM-OSTree-10-Remotes.md#104-adding-and-removing-remotes)
69
+         1. [List available branches](Photon-RPM-OSTree-10-Remotes.md#105-list-available-branches)
70
+    9. [Running container applications between bootable images](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md)  
71
+         1. [Downloading a docker container appliance](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#111-downloading-a-docker-container-appliance)
72
+         1. [Rebooting into an existing image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#112-rebooting-into-an-existing-image)
73
+         1. [Reboot into a newly created image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#113-reboot-into-a-newly-created-image)
74
+    9. [Install or rebase to Photon OS 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md)  
75
+         1. [Installing an RPM-OSTree server](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#121-installing-an-rpm-ostree-server)
76
+         1. [Installing an RPM-OSTree host](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#122-installing-an-rpm-ostree-host)
77
+         1. [Rebasing a host from Photon 1.0 to 2.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#123-rebasing-a-host-from-photon-10-to-20)
78
+         1. [Creating a host raw image](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#124-creating-a-host-raw-image)
79
+    9. [Appendix A: Known issues](Photon-RPM-OSTree-Appendix-A-Known-issues.md) 
0 80
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+{
1
+
2
+	"title": "VMware Photon OS 1.0 and 2.0 Documentation",
3
+        "gitbook": "3.x.x",
4
+        "plugins": ["insert-logo", "chapter-fold", "edit-link", "noembed"],
5
+        "pluginsConfig": {
6
+            "insert-logo": {
7
+                "url": "VMW_logo.png",
8
+                "style": "background: none"
9
+        },
10
+            "edit-link": {
11
+                "base": "https://github.com/vmware/photon/tree/master/docs",
12
+                "label": "Edit this Page"
13
+            }
14
+        },
15
+	"pdf": {
16
+		"headerTemplate": "_TITLE_",
17
+		"footerTemplate": "_PAGENUM_",
18
+                "paperSize": "letter"
19
+	}
20
+         
21
+}
0 22
\ No newline at end of file
... ...
@@ -1,4 +1,4 @@
1
-#Compatible Cloud Images
1
+# Compatible Cloud Images
2 2
 
3 3
 The [Bintray website](https://bintray.com/vmware/photon/) contains the following cloud-ready images of Photon OS: 
4 4
 
... ...
@@ -63,7 +63,7 @@ The tar file can be uploaded to Google's cloud storage and an instance can be cr
63 63
 
64 64
 (You can also create instances from the Google developer console.)
65 65
 
66
-For more information, see [Running a Photon OS Machine on GCE](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#running-a-photon-os-machine-on-gce). 
66
+For more information, see [Running a Photon OS Machine on GCE](photon-admin-guide.md#running-a-photon-os-machine-on-gce). 
67 67
 
68 68
 ### AWS EC2
69 69
 
... ...
@@ -83,7 +83,7 @@ Install the [AWS CLI](http://docs.aws.amazon.com/cli/latest/userguide/installing
83 83
 
84 84
 You can now launch instances using the AWS console.
85 85
 
86
-For more information, see [Customizing a Photon OS Machine on EC2](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#customizing-a-photon-os-machine-on-ec2).
86
+For more information, see [Customizing a Photon OS Machine on EC2](photon-admin-guide.md#customizing-a-photon-os-machine-on-ec2).
87 87
 
88 88
 
89 89
 <!--
... ...
@@ -1,4 +1,4 @@
1
-Overview
1
+# Overview
2 2
 =================
3 3
 ```cloud-init``` is a multi-distribution package that handles early initialization of a cloud instance.
4 4
 
... ...
@@ -1,4 +1,5 @@
1
-#Photon OS on GCE
1
+# Photon OS on GCE
2
+
2 3
 ## Google Compute Engine (GCE) Image background
3 4
 GCE is a service that lets you run virtual machines on Google's infrastructure. You can customize the virtual machine as much as you want, and you can even install your own custom operating system image. Or, you can adopt one of the public [images](https://cloud.google.com/compute/docs/operating-systems/) provided by Google. For any operating system to work with GCE, it must match Google's infrastructure needs. 
4 5
 Google provides tools that VM instances require to work correctly on GCE:
... ...
@@ -24,17 +25,17 @@ Following is the list (extracted from [this link](https://cloud.google.com/compu
24 24
 
25 25
 ## The GCE-Ready Image of Photon OS 
26 26
 
27
-The latest version of Photon OS does all of this for you. It bundles the Google startup scripts, daemon, and cloud SDK into a GCE-ready image that has been modified to meet the configuration requirements of GCE. To download the GCE-ready image of Photon OS for free, go to [Bintray](https://bintray.com/vmware/photon/). To use Photon OS with GCE, you do not need to perform the following steps unless you want to go through the exercise of customizing Photon OS to work with GCE. The Photon OS team has already done it for you. For more information, see [Running Photon OS on Google Compute Engine](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Google-Compute-Engine). 
27
+The latest version of Photon OS does all of this for you. It bundles the Google startup scripts, daemon, and cloud SDK into a GCE-ready image that has been modified to meet the configuration requirements of GCE. To download the GCE-ready image of Photon OS for free, go to [Bintray](https://bintray.com/vmware/photon/). To use Photon OS with GCE, you do not need to perform the following steps unless you want to go through the exercise of customizing Photon OS to work with GCE. The Photon OS team has already done it for you. For more information, see [Running Photon OS on Google Compute Engine](Running-Photon-OS-on-Google-Compute-Engine.md). 
28 28
 
29 29
 ## Creating Photon image for GCE
30
-##### 1. Prepare Photon Disk
31
-###### Install Photon Minimal on Fusion/Workstation and install some required packages.
30
+### 1. Prepare Photon Disk
31
+#### Install Photon Minimal on Fusion/Workstation and install some required packages.
32 32
       mount /dev/cdrom /media/cdrom
33 33
       tdnf install yum
34 34
       tdnf install python2-libs
35 35
       yum install ntp sudo wget tar which gptfdisk sed findutils grep gzip --nogpgcheck -y
36 36
 
37
-###### Photon installer installs GPT partition table by default but GCE only accepts MBR(msdos) type partition table. We need to convert GPT to MBR and update the grub. Following are commands to do that.
37
+#### Photon installer installs GPT partition table by default but GCE only accepts MBR(msdos) type partition table. We need to convert GPT to MBR and update the grub. Following are commands to do that.
38 38
   
39 39
       # Change partition table to MBR from GPT
40 40
       sgdisk -m 1:2 /dev/sda
... ...
@@ -50,7 +51,7 @@ The latest version of Photon OS does all of this for you. It bundles the Google
50 50
       # Create new grub.cfg based on the settings in /etc/default/grub
51 51
       grub2-mkconfig -o /boot/grub2/grub.cfg
52 52
       
53
-##### 2. Install Google Cloud SDK and GCE Packages
53
+### 2. Install Google Cloud SDK and GCE Packages
54 54
       yum install google-daemon google-startup-scripts
55 55
       cp /usr/lib/systemd/system/google* /lib/systemd/system/
56 56
       cd /lib/systemd/system/multi-user.target.wants/
... ...
@@ -62,9 +63,9 @@ The latest version of Photon OS does all of this for you. It bundles the Google
62 62
       tar -xf google-cloud-sdk.tar.gz
63 63
       cd google-cloud-sdk
64 64
       ./install.sh
65
-##### 3. Update /etc/hosts file with GCE values
65
+### 3. Update /etc/hosts file with GCE values
66 66
       echo "169.254.169.254 metadata.google.internal metadata" >> /etc/hosts
67
-##### 4. Remove all servers from ntp.conf and add Google's ntp server.
67
+### 4. Remove all servers from ntp.conf and add Google's ntp server.
68 68
       sed -i -e "/server/d" /etc/ntp.conf
69 69
       cat /etc/ntp.conf
70 70
       echo "server 169.254.169.254" >> /etc/ntp.conf
... ...
@@ -88,13 +89,13 @@ The latest version of Photon OS does all of this for you. It bundles the Google
88 88
       cd /lib/systemd/system/multi-user.target.wants/
89 89
       ln -s ../ntpd.service ntpd.service
90 90
       
91
-##### 5. Set UTC timezone
91
+### 5. Set UTC timezone
92 92
       ln -sf /usr/share/zoneinfo/UTC /etc/localtime
93 93
 
94
-##### 6. Update /etc/resolv.conf
94
+### 6. Update /etc/resolv.conf
95 95
       echo "nameserver 8.8.8.8" >> /etc/resolv.conf
96 96
 
97
-##### 7. Remove ssh host keys and add script to regenerate them at boot time.
97
+### 7. Remove ssh host keys and add script to regenerate them at boot time.
98 98
       rm /etc/ssh/ssh_host_*
99 99
       # Depending on the installation, you may need to purge the following keys
100 100
       rm /etc/ssh/ssh_host_rsa_key*
... ...
@@ -106,9 +107,9 @@ The latest version of Photon OS does all of this for you. It bundles the Google
106 106
       echo "exit 0" >> /etc/rc.local
107 107
       printf "GOOGLE\n" > /etc/ssh/sshd_not_to_be_run
108 108
       
109
-      # Edit sshd_config and ssh_config as per instructions on [this link](https://cloud.google.com/compute/docs/tutorials/building-images ).
109
+      # Edit sshd_config and ssh_config as per instructions on [this link](https://cloud.google.com/compute/docs/tutorials/building-images).
110 110
       
111
-##### 8. Change MTU to 1460 for network interface.
111
+### 8. Change MTU to 1460 for network interface.
112 112
       # Create a startup service in systemd that will change MTU and exits
113 113
       cat << EOF >> /lib/systemd/system/eth0.service
114 114
       [Unit]
... ...
@@ -127,8 +128,8 @@ The latest version of Photon OS does all of this for you. It bundles the Google
127 127
       cd /lib/systemd/system/multi-user.target.wants/
128 128
       ln -s ../eth0.service eth0.service
129 129
 
130
-##### 9. Pack and Upload to GCE.
131
-###### Shutdown the Photon VM and copy its disk to tmp folder.       
130
+### 9. Pack and Upload to GCE.
131
+#### Shutdown the Photon VM and copy its disk to tmp folder.       
132 132
       # You will need to install Google Cloud SDK on host machine to upload the image and play with GCE.
133 133
       cp Virtual\ Machines.localized/photon.vmwarevm/Virtual\ Disk.vmdk /tmp/disk.vmdk
134 134
       cd /tmp
135 135
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+# Photon OS Getting Started Guides
1
+
2
+-   [Downloading Photon OS](Downloading-Photon-OS.md)
3
+-   [Quick Start](photon-admin-guide.md#getting-started-with-photon-os-20)
4
+-   [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md)
5
+-   [What is New in Photon OS 2.0](What-is-New-in-Photon-OS-2.0.md)
6
+-   [Running Photon OS on vSphere](Running-Photon-OS-on-vSphere.md)
7
+-   [Running Photon OS on Fusion](Running-Project-Photon-on-Fusion.md)
8
+-   [Running Photon OS on Workstation](Running-Photon-OS-on-Workstation.md)
9
+-   [Running Photon OS on AWS EC2](Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute.md)
10
+-   [Running Photon OS on Microsoft Azure](Running-Photon-OS-on-Microsoft-Azure.md)
11
+-   [Running Photon OS on Google Compute Engine](Running-Photon-OS-on-Google-Compute-Engine.md)
12
+    - [Photon OS on GCE](gce.md)
13
+- [Running Project Photon on vCloud Air](Running-Project-Photon-on-vCloud-Air.md) 
0 14
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+# Photon OS How-To Guides
1
+
2
+- [Setting Up a Swarm Cluster with DNS](Install-and-Configure-a-Swarm-Cluster-with-DNS-Service-on-PhotonOS.md)
3
+- [Setting Up a Mesos Cluster](Install-and-Configure-a-Production-Ready-Mesos-Cluster-on-Photon-OS.md)
4
+- [Setting Up Marathon for a Mesos Cluster](Install-and-Configure-Marathon-for-Mesos-Cluster-on-PhotonOS.md)
5
+- [Setting Up DCOS CLI for Mesos](Install-and-Configure-DCOS-CLI-for-Mesos.md)
6
+- [Setting Up Mesos DNS on a Mesos Cluster](Install-and-Configure-Mesos-DNS-on-a-Mesos-Cluster.md)
7
+- [Setting Up a Network PXE Boot Server](PXE-boot.md)
8
+- [Working with Kickstart](kickstart.md)
9
+- [Running Kubernetes](kubernetes.md)
10
+- [Mounting Remote File Systems](nfs-utils.md)
11
+- [Building Photon OS from the Source Code](build-photon.md)
12
+- [Installing and Using Lightwave on Photon OS](Installing-and-Using-Lightwave-on-Photon-OS.md)
13
+    - [Installing the Lightwave Server and Configuring It as a Domain Controller on a Photon Image](Installing-Lightwave-Server-and-Setting-Up-a-Domain.md) 
14
+    - [Installing the Lightwave Client on a Photon Image and Joining the Client to a Domain](Installing-Lightwave-Client-and-Joining-a-Domain.md)
15
+    - [Installing the Photon Management Daemon on a Lightwave Client](Installing-the-Photon-Management-Daemon-on-a-Lightwave-Client.md)
16
+    - [Remotely Upgrade a Single Photon OS Machine With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-a-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
17
+    - [Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
0 18
new file mode 100644
1 19
Binary files /dev/null and b/docs/images/64-bit-option.png differ
2 20
new file mode 100644
3 21
Binary files /dev/null and b/docs/images/Nginx.jpg differ
4 22
new file mode 100644
5 23
Binary files /dev/null and b/docs/images/architecture.png differ
6 24
new file mode 100644
7 25
Binary files /dev/null and b/docs/images/azure-docker-run.png differ
8 26
new file mode 100644
9 27
Binary files /dev/null and b/docs/images/create-virtual-machine.png differ
10 28
new file mode 100644
11 29
Binary files /dev/null and b/docs/images/fs-docker-confirm.png differ
12 30
new file mode 100644
13 31
Binary files /dev/null and b/docs/images/fs-docker-ifconfig.png differ
14 32
new file mode 100644
15 33
Binary files /dev/null and b/docs/images/fs-docker-run.png differ
16 34
new file mode 100644
17 35
Binary files /dev/null and b/docs/images/fs-iso-disk-erase.png differ
18 36
new file mode 100644
19 37
Binary files /dev/null and b/docs/images/fs-iso-finish.png differ
20 38
new file mode 100644
21 39
Binary files /dev/null and b/docs/images/fs-iso-hostname.png differ
22 40
new file mode 100644
23 41
Binary files /dev/null and b/docs/images/fs-iso-install-option.png differ
24 42
new file mode 100644
25 43
Binary files /dev/null and b/docs/images/fs-iso-install.png differ
26 44
new file mode 100644
27 45
Binary files /dev/null and b/docs/images/fs-iso-installed.png differ
28 46
new file mode 100644
29 47
Binary files /dev/null and b/docs/images/fs-iso-kernel.png differ
30 48
new file mode 100644
31 49
Binary files /dev/null and b/docs/images/fs-iso-license.png differ
32 50
new file mode 100644
33 51
Binary files /dev/null and b/docs/images/fs-iso-login.png differ
34 52
new file mode 100644
35 53
Binary files /dev/null and b/docs/images/fs-iso-name.png differ
36 54
new file mode 100644
37 55
Binary files /dev/null and b/docs/images/fs-iso-new-prompt.png differ
38 56
new file mode 100644
39 57
Binary files /dev/null and b/docs/images/fs-iso-new-selected.png differ
40 58
new file mode 100644
41 59
Binary files /dev/null and b/docs/images/fs-iso-new.png differ
42 60
new file mode 100644
43 61
Binary files /dev/null and b/docs/images/fs-iso-os.png differ
44 62
new file mode 100644
45 63
Binary files /dev/null and b/docs/images/fs-iso-partition-custom.png differ
46 64
new file mode 100644
47 65
Binary files /dev/null and b/docs/images/fs-iso-partition-new.png differ
48 66
new file mode 100644
49 67
Binary files /dev/null and b/docs/images/fs-iso-partition.png differ
50 68
new file mode 100644
51 69
Binary files /dev/null and b/docs/images/fs-iso-root-password-confirm.png differ
52 70
new file mode 100644
53 71
Binary files /dev/null and b/docs/images/fs-iso-root-password.png differ
54 72
new file mode 100644
55 73
Binary files /dev/null and b/docs/images/fs-iso-settings.png differ
56 74
new file mode 100644
57 75
Binary files /dev/null and b/docs/images/fs-iso-splash.png differ
58 76
new file mode 100644
59 77
Binary files /dev/null and b/docs/images/fs-iso-virtual-disk.png differ
60 78
new file mode 100644
61 79
Binary files /dev/null and b/docs/images/fs-ova-finish.png differ
62 80
new file mode 100644
63 81
Binary files /dev/null and b/docs/images/fs-ova-import.png differ
64 82
new file mode 100644
65 83
Binary files /dev/null and b/docs/images/fs-ova-license.png differ
66 84
new file mode 100644
67 85
Binary files /dev/null and b/docs/images/fs-ova-login.png differ
68 86
new file mode 100644
69 87
Binary files /dev/null and b/docs/images/fs-ova-name.png differ
70 88
new file mode 100644
71 89
Binary files /dev/null and b/docs/images/fs-ova-os-confirm.png differ
72 90
new file mode 100644
73 91
Binary files /dev/null and b/docs/images/fs-ova-os.png differ
74 92
new file mode 100644
75 93
Binary files /dev/null and b/docs/images/fs-ova-selected.png differ
76 94
new file mode 100644
77 95
Binary files /dev/null and b/docs/images/fs-ova-settings.png differ
78 96
new file mode 100644
79 97
Binary files /dev/null and b/docs/images/fs-ova-splash.png differ
80 98
new file mode 100644
81 99
Binary files /dev/null and b/docs/images/fs-ova-upgrade.png differ
82 100
new file mode 100644
83 101
Binary files /dev/null and b/docs/images/fs-version.png differ
84 102
new file mode 100644
85 103
Binary files /dev/null and b/docs/images/fs_version.png differ
86 104
new file mode 100644
87 105
Binary files /dev/null and b/docs/images/gce1.jpg differ
88 106
new file mode 100644
89 107
Binary files /dev/null and b/docs/images/gce2.jpg differ
90 108
new file mode 100644
91 109
Binary files /dev/null and b/docs/images/gce4.jpg differ
92 110
new file mode 100644
93 111
Binary files /dev/null and b/docs/images/gce5.jpg differ
94 112
new file mode 100644
95 113
Binary files /dev/null and b/docs/images/gce6.jpg differ
96 114
new file mode 100644
97 115
Binary files /dev/null and b/docs/images/photon-os-instance.png differ
98 116
new file mode 100644
99 117
Binary files /dev/null and b/docs/images/vs-docker-confirm.png differ
100 118
new file mode 100644
101 119
Binary files /dev/null and b/docs/images/vs-docker-ifconfig.png differ
102 120
new file mode 100644
103 121
Binary files /dev/null and b/docs/images/vs-docker-run.png differ
104 122
new file mode 100644
105 123
Binary files /dev/null and b/docs/images/vs-iso-customize.png differ
106 124
new file mode 100644
107 125
Binary files /dev/null and b/docs/images/vs-iso-datastore.png differ
108 126
new file mode 100644
109 127
Binary files /dev/null and b/docs/images/vs-iso-erase.png differ
110 128
new file mode 100644
111 129
Binary files /dev/null and b/docs/images/vs-iso-hostname.png differ
112 130
new file mode 100644
113 131
Binary files /dev/null and b/docs/images/vs-iso-install-option.png differ
114 132
new file mode 100644
115 133
Binary files /dev/null and b/docs/images/vs-iso-install.png differ
116 134
new file mode 100644
117 135
Binary files /dev/null and b/docs/images/vs-iso-installed.png differ
118 136
new file mode 100644
119 137
Binary files /dev/null and b/docs/images/vs-iso-kernel.png differ
120 138
new file mode 100644
121 139
Binary files /dev/null and b/docs/images/vs-iso-license.png differ
122 140
new file mode 100644
123 141
Binary files /dev/null and b/docs/images/vs-iso-login.png differ
124 142
new file mode 100644
125 143
Binary files /dev/null and b/docs/images/vs-iso-name.png differ
126 144
new file mode 100644
127 145
Binary files /dev/null and b/docs/images/vs-iso-new.png differ
128 146
new file mode 100644
129 147
Binary files /dev/null and b/docs/images/vs-iso-os.png differ
130 148
new file mode 100644
131 149
Binary files /dev/null and b/docs/images/vs-iso-partition-custom.png differ
132 150
new file mode 100644
133 151
Binary files /dev/null and b/docs/images/vs-iso-partition-new.png differ
134 152
new file mode 100644
135 153
Binary files /dev/null and b/docs/images/vs-iso-partition.png differ
136 154
new file mode 100644
137 155
Binary files /dev/null and b/docs/images/vs-iso-ready.png differ
138 156
new file mode 100644
139 157
Binary files /dev/null and b/docs/images/vs-iso-root-password-confirm.png differ
140 158
new file mode 100644
141 159
Binary files /dev/null and b/docs/images/vs-iso-root-password.png differ
142 160
new file mode 100644
143 161
Binary files /dev/null and b/docs/images/vs-iso-splash.png differ
144 162
new file mode 100644
145 163
Binary files /dev/null and b/docs/images/vs-ova-deployment-options.png differ
146 164
new file mode 100644
147 165
Binary files /dev/null and b/docs/images/vs-ova-license.png differ
148 166
new file mode 100644
149 167
Binary files /dev/null and b/docs/images/vs-ova-login.png differ
150 168
new file mode 100644
151 169
Binary files /dev/null and b/docs/images/vs-ova-name-selected.png differ
152 170
new file mode 100644
153 171
Binary files /dev/null and b/docs/images/vs-ova-new-vm-ova.png differ
154 172
new file mode 100644
155 173
Binary files /dev/null and b/docs/images/vs-ova-new-vm.png differ
156 174
new file mode 100644
157 175
Binary files /dev/null and b/docs/images/vs-ova-settings.png differ
158 176
new file mode 100644
159 177
Binary files /dev/null and b/docs/images/vs-ova-splash.png differ
160 178
new file mode 100644
161 179
Binary files /dev/null and b/docs/images/vs-ova-storage.png differ
162 180
new file mode 100644
163 181
Binary files /dev/null and b/docs/images/vsphere1.jpg differ
164 182
new file mode 100644
165 183
Binary files /dev/null and b/docs/images/vsphere12.jpg differ
166 184
new file mode 100644
167 185
Binary files /dev/null and b/docs/images/vsphere13.jpg differ
168 186
new file mode 100644
169 187
Binary files /dev/null and b/docs/images/vsphere2.jpg differ
170 188
new file mode 100644
171 189
Binary files /dev/null and b/docs/images/vsphere3.jpg differ
172 190
new file mode 100644
173 191
Binary files /dev/null and b/docs/images/vsphere4.jpg differ
174 192
new file mode 100644
175 193
Binary files /dev/null and b/docs/images/vsphere5.jpg differ
176 194
new file mode 100644
177 195
Binary files /dev/null and b/docs/images/vsphere6.png differ
178 196
new file mode 100644
179 197
Binary files /dev/null and b/docs/images/vsphere7.jpg differ
180 198
new file mode 100644
181 199
Binary files /dev/null and b/docs/images/vsphere8.png differ
182 200
new file mode 100644
183 201
Binary files /dev/null and b/docs/images/vsphere9.jpg differ
184 202
new file mode 100644
185 203
Binary files /dev/null and b/docs/images/ws-docker-confirm.png differ
186 204
new file mode 100644
187 205
Binary files /dev/null and b/docs/images/ws-docker-ifconfig.png differ
188 206
new file mode 100644
189 207
Binary files /dev/null and b/docs/images/ws-docker-run.png differ
190 208
new file mode 100644
191 209
Binary files /dev/null and b/docs/images/ws-iso-cd.png differ
192 210
new file mode 100644
193 211
Binary files /dev/null and b/docs/images/ws-iso-customize.png differ
194 212
new file mode 100644
195 213
Binary files /dev/null and b/docs/images/ws-iso-disk-erase.png differ
196 214
new file mode 100644
197 215
Binary files /dev/null and b/docs/images/ws-iso-disk-partition-custom.png differ
198 216
new file mode 100644
199 217
Binary files /dev/null and b/docs/images/ws-iso-disk-partition-new.png differ
200 218
new file mode 100644
201 219
Binary files /dev/null and b/docs/images/ws-iso-disk-partition.png differ
202 220
new file mode 100644
203 221
Binary files /dev/null and b/docs/images/ws-iso-disk.png differ
204 222
new file mode 100644
205 223
Binary files /dev/null and b/docs/images/ws-iso-efi.png differ
206 224
new file mode 100644
207 225
Binary files /dev/null and b/docs/images/ws-iso-hostname.png differ
208 226
new file mode 100644
209 227
Binary files /dev/null and b/docs/images/ws-iso-install-option.png differ
210 228
new file mode 100644
211 229
Binary files /dev/null and b/docs/images/ws-iso-install.png differ
212 230
new file mode 100644
213 231
Binary files /dev/null and b/docs/images/ws-iso-installed.png differ
214 232
new file mode 100644
215 233
Binary files /dev/null and b/docs/images/ws-iso-installer.png differ
216 234
new file mode 100644
217 235
Binary files /dev/null and b/docs/images/ws-iso-kernel.png differ
218 236
new file mode 100644
219 237
Binary files /dev/null and b/docs/images/ws-iso-license.png differ
220 238
new file mode 100644
221 239
Binary files /dev/null and b/docs/images/ws-iso-login.png differ
222 240
new file mode 100644
223 241
Binary files /dev/null and b/docs/images/ws-iso-name.png differ
224 242
new file mode 100644
225 243
Binary files /dev/null and b/docs/images/ws-iso-new.png differ
226 244
new file mode 100644
227 245
Binary files /dev/null and b/docs/images/ws-iso-os.png differ
228 246
new file mode 100644
229 247
Binary files /dev/null and b/docs/images/ws-iso-root-password-confirm.png differ
230 248
new file mode 100644
231 249
Binary files /dev/null and b/docs/images/ws-iso-root-password.png differ
232 250
new file mode 100644
233 251
Binary files /dev/null and b/docs/images/ws-iso-selected.png differ
234 252
new file mode 100644
235 253
Binary files /dev/null and b/docs/images/ws-iso-settings.png differ
236 254
new file mode 100644
237 255
Binary files /dev/null and b/docs/images/ws-iso-splash.png differ
238 256
new file mode 100644
239 257
Binary files /dev/null and b/docs/images/ws-iso-summary.png differ
240 258
new file mode 100644
241 259
Binary files /dev/null and b/docs/images/ws-iso-typical.png differ
242 260
new file mode 100644
243 261
Binary files /dev/null and b/docs/images/ws-ova-import.png differ
244 262
new file mode 100644
245 263
Binary files /dev/null and b/docs/images/ws-ova-license.png differ
246 264
new file mode 100644
247 265
Binary files /dev/null and b/docs/images/ws-ova-os.png differ
248 266
new file mode 100644
249 267
Binary files /dev/null and b/docs/images/ws-ova-password.png differ
250 268
new file mode 100644
251 269
Binary files /dev/null and b/docs/images/ws-ova-path.png differ
252 270
new file mode 100644
253 271
Binary files /dev/null and b/docs/images/ws-ova-settings-edit.png differ
254 272
new file mode 100644
255 273
Binary files /dev/null and b/docs/images/ws-ova-settings-efi.png differ
256 274
new file mode 100644
257 275
Binary files /dev/null and b/docs/images/ws-ova-settings-options.png differ
258 276
new file mode 100644
259 277
Binary files /dev/null and b/docs/images/ws-ova-settings-photon.png differ
260 278
new file mode 100644
261 279
Binary files /dev/null and b/docs/images/ws-ova-settings.png differ
262 280
new file mode 100644
263 281
Binary files /dev/null and b/docs/images/ws-ova-splash.png differ
264 282
new file mode 100644
265 283
Binary files /dev/null and b/docs/images/ws_version.png differ
... ...
@@ -45,7 +45,7 @@ Here is an example:
45 45
 
46 46
     ks=cdrom:/isolinux/my_ks.cfg
47 47
 
48
-The syntax to serve the config-file to the kernel from an HTTP server takes the following form: 
48
+The syntax to serve the config-file to the kernel from an HTTP server (NOTE: DO NOT use https:// here) takes the following form: 
49 49
 
50 50
     ks=http://<server>/<config_file_path>
51 51
 
... ...
@@ -1,8 +1,6 @@
1
-Running Kubernetes on Photon OS
1
+# Running Kubernetes on Photon OS
2 2
 -----------------------------------------------------
3 3
 
4
-**Table of Contents**
5
-
6 4
 - [Prerequisites](#prerequisites)
7 5
 - [Instructions](#instructions)
8 6
 
... ...
@@ -18,7 +16,7 @@ The Kubernetes package provides several services: kube-apiserver, kube-scheduler
18 18
 
19 19
 The following instructions break the services up between the hosts.  The first host, `photon-master`, will be the Kubernetes master.  This host will run the kube-apiserver, kube-controller-manager, and kube-scheduler.  In addition, the master will also run `etcd`. Although `etcd` is not needed on the master if `etcd` runs on a different host, this guide assumes that `etcd` and the Kubernetes master run on the same host.  The remaining host, `photon-node`, will be the node; it will run kubelet, proxy, and docker.
20 20
 
21
-**System Information**
21
+### System Information
22 22
 
23 23
 Hosts:
24 24
 
... ...
@@ -27,25 +25,38 @@ photon-master = 192.168.121.9
27 27
 photon-node = 192.168.121.65
28 28
 ```
29 29
 
30
-**Prepare the hosts**
30
+### Prepare the hosts
31 31
 
32 32
 The following packages should already be installed on the full version of Photon OS, but you might have to install them on the minimal version of Photon OS. If the `tdnf` command returns "Nothing to do," the package is already installed.
33 33
     
34 34
 * Install Kubernetes on all hosts--both `photon-master` and `photon-node`.
35 35
 
36
-```sh
36
+```
37 37
 tdnf install kubernetes
38 38
 ``` 
39 39
 
40
-* Install iptables on photon-master:
40
+* Install iptables on photon-master and photon-node:
41 41
 
42
-```sh
42
+```
43 43
 tdnf install iptables
44 44
 ```
45 45
 
46
+* Open the tcp port 8080 (api service) on the photon-master in the firewall
47
+
48
+```
49
+iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
50
+```
51
+
52
+* Open the tcp port 10250 (api service) on the photon-node in the firewall
53
+
54
+```
55
+iptables -A INPUT -p tcp --dport 10250 -j ACCEPT
56
+```
57
+
58
+
46 59
 * Install Docker on photon-node:
47 60
 
48
-```sh
61
+```
49 62
 tdnf install docker
50 63
 ```
51 64
 
... ...
@@ -58,7 +69,7 @@ echo "192.168.121.9	photon-master
58 58
 
59 59
 * Edit /etc/kubernetes/config, which will be the same on all the hosts (master and node), so that it contains the following lines:
60 60
 
61
-```sh
61
+```
62 62
 # Comma separated list of nodes in the etcd cluster
63 63
 KUBE_MASTER="--master=http://photon-master:8080"
64 64
 
... ...
@@ -72,11 +83,11 @@ KUBE_LOG_LEVEL="--v=0"
72 72
 KUBE_ALLOW_PRIV="--allow_privileged=false"
73 73
 ```
74 74
 
75
-**Configure the Kubernetes services on the master**
75
+### Configure the Kubernetes services on the master
76 76
 
77 77
 * Edit /etc/kubernetes/apiserver to appear as such.  The service_cluster_ip_range IP addresses must be an unused block of addresses, not used anywhere else.  They do not need to be routed or assigned to anything.
78 78
 
79
-```sh
79
+```
80 80
 # The address on the local server to listen to.
81 81
 KUBE_API_ADDRESS="--address=0.0.0.0"
82 82
 
... ...
@@ -92,7 +103,7 @@ KUBE_API_ARGS=""
92 92
 
93 93
 * Start the appropriate services on master:
94 94
 
95
-```sh
95
+```
96 96
 for SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler; do
97 97
 	systemctl restart $SERVICES
98 98
 	systemctl enable $SERVICES
... ...
@@ -116,7 +127,7 @@ done
116 116
 }
117 117
 ```
118 118
 
119
-Now create a node object internally in your Kubernetes cluster by running the following command:
119
+* Now create a node object internally in your Kubernetes cluster by running the following command:
120 120
 
121 121
 ```console
122 122
 $ kubectl create -f ./node.json
... ...
@@ -132,13 +143,13 @@ is assumed that _photon-node_ (as specified in `name`) can be resolved and is
132 132
 reachable from the Kubernetes master node. How to provision
133 133
 a Kubernetes node (photon-node) is shown in a later section.
134 134
 
135
-**Configure the Kubernetes services on the node**
135
+### Configure the Kubernetes services on the node
136 136
 
137 137
 You configure the kubelet on the node as follows. 
138 138
 
139 139
 * Edit /etc/kubernetes/kubelet to appear like this:
140 140
 
141
-```sh
141
+```
142 142
 ###
143 143
 # Kubernetes kubelet (node) config
144 144
 
145 145
new file mode 100644
... ...
@@ -0,0 +1,239 @@
0
+# Photon Network Manager Command-line Interface (netmgr)
1
+
2
+For locally logged-on users, Photon OS provides a command line interface to manage network configuration of the system.
3
+
4
+- [Setup Steps](#setup-steps)
5
+- [Syntax](#syntax)
6
+- [Network Manager CLI](#network-manager-cli)
7
+
8
+# Setup Steps
9
+
10
+The netmgr tool is included with your Photon OS distribution. To make sure that you have the latest version, you can run:
11
+~~~~
12
+tdnf install netmgmt
13
+~~~~
14
+# Syntax
15
+The CLI is built on set, get, add, delete command model and uses the option-name - option-value model of specifying command parameters.
16
+~~~~
17
+netmgr <network object> <--get | --set | --add | --del> <command options>
18
+~~~~
19
+Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&quot;) as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether.
20
+
21
+## network object
22
+
23
+``<network object>`` is one of the following values:
24
+
25
+- ``link_info``
26
+- ``ip4_address``
27
+- ``ip6_address``
28
+- ``ip_route``
29
+- ``dns_servers``
30
+- ``dns_domains``
31
+- ``dhcp_duid``
32
+- ``if_iaid``
33
+- ``ntp_servers``
34
+- ``hostname``
35
+- ``wait_for_link``
36
+- ``wait_for_ip``
37
+- ``error_info``
38
+- ``net_info``
39
+
40
+# Network Manager CLI
41
+
42
+## link_info
43
+
44
+Get the mac address, MTU, link state, and link mode for the (optionally) specified interface.
45
+~~~~
46
+netmgr link_info --get --interface <ifname>
47
+~~~~
48
+Set the MAC address, link state (up or down), link mode (manual or auto), or MTU for the specified interface.
49
+~~~~
50
+netmgr link_info --set --interface <ifname> --macaddr <mac_address>
51
+netmgr link_info --set --interface <ifname> --mode <manual|auto>
52
+netmgr link_info --set --interface <ifname> --state <up|down>
53
+netmgr link_info --set --interface <ifname> --mtu <mtu>
54
+~~~~
55
+## ip4_address
56
+
57
+Get the IPv4 address for the specified interface.
58
+~~~~
59
+netmgr ip4_address --get --interface <ifname>
60
+~~~~
61
+Set the IPv4 address (dot-decimal/prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
62
+~~~~
63
+netmgr ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <ipv4_address/prefix> --gateway <gateway_address>
64
+~~~~
65
+## ip6_address
66
+
67
+Get IPv6 addresses for the specified interface.
68
+~~~~
69
+netmgr ip6_address --get --interface <ifname>
70
+~~~~
71
+Add one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) to the specified interface.
72
+~~~~
73
+netmgr ip6_address --add --interface <ifname> --addrlist <ipv6_addr1/prefix,ipv6_addr2/prefix,...>
74
+~~~~
75
+Delete one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) from the specified interface.
76
+~~~~
77
+netmgr ip6_address --del --interface <ifname> --addrlist <ipv6_addr1/prefix,ipv6_addr2/prefix,...>
78
+~~~~
79
+Set the IPv6 DHCP mode (1=enable, 0=disable) and IPv6 auto-configuration settings (1=enable, 0=disable) for the specified interface.
80
+~~~~
81
+netmgr ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0>
82
+~~~~
83
+## ip_route
84
+
85
+Get the static IP route for the specified interface.
86
+~~~~
87
+netmgr ip_route --get --interface <ifname>
88
+~~~~
89
+Add the static IP route (gateway IP, destination network, and metric) to the specified interface.
90
+~~~~
91
+netmgr ip_route --add --interface <ifname> --gateway <gateway_address> --destination <destination_network/prefix> --metric <N>
92
+~~~~
93
+Delete the specified static IP route from the specified interface.
94
+~~~~
95
+netmgr ip_route --del --interface <ifname> --destination <destination_network/prefix>
96
+~~~~
97
+## dns_servers
98
+
99
+Get the list of DNS servers.
100
+~~~~
101
+netmgr dns_servers --get
102
+~~~~
103
+Set the DNS mode (DHCP or static) for one or more DNS servers (comma-separated list).
104
+~~~~
105
+netmgr dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
106
+~~~~
107
+Add a DNS server to the list of DNS servers.
108
+~~~~
109
+netmgr dns_servers --add --servers <server>
110
+~~~~
111
+Remove the specified DNS server from the list of DNS servers.
112
+~~~~
113
+netmgr dns_servers --del --servers <server>
114
+~~~~
115
+## dns_domains
116
+
117
+Get the list of DNS domains.
118
+~~~~
119
+netmgr dns_domains --get
120
+~~~~
121
+Set the list of DNS domains (one or more DNS domains in a comma-separated list).
122
+~~~~
123
+netmgr dns_domains --set --domains <domain1,domain2,...>
124
+~~~~
125
+Add a DNS domain to the list of DNS domains.
126
+~~~~
127
+netmgr dns_domains --add --domains <domain>
128
+~~~~
129
+Delete a DNS domain from the list of DNS domains.
130
+~~~~
131
+netmgr dns_domains --del --domains <domain>
132
+~~~~
133
+## dhcp_duid
134
+
135
+Get the DHCP DUID (optionally interface-specific DUID) for the system.
136
+~~~~
137
+netmgr dhcp_duid --get
138
+~~~~
139
+Set the DHCP DUID for the system, optionally per-interface if the interface is specified.
140
+~~~~
141
+netmgr dhcp_duid --set --duid <duid>
142
+~~~~
143
+## if_iaid
144
+
145
+Get the IAID for the specified interface.
146
+~~~~
147
+netmgr if_iaid --get --interface <ifname>
148
+~~~~
149
+Set the IAID for the specified interface.
150
+~~~~
151
+netmgr if_iaid --set --interface <ifname> --iaid <iaid>
152
+~~~~
153
+## ntp_servers
154
+
155
+Get the NTP servers list.
156
+~~~~
157
+netmgr ntp_servers --get
158
+~~~~
159
+Set the NTP servers list.
160
+~~~~
161
+netmgr ntp_servers --set --servers <server1,server2,...>
162
+~~~~
163
+Add the specified server to the NTP servers list.
164
+~~~~
165
+netmgr ntp_servers --add --servers <server>
166
+~~~~
167
+Delete the specified server from the NTP servers list.
168
+~~~~
169
+netmgr ntp_servers --del --servers <server>
170
+~~~~
171
+## hostname
172
+
173
+Get the system hostname.
174
+~~~~
175
+netmgr hostname --get
176
+~~~~
177
+Set the system hostname.
178
+~~~~
179
+netmgr hostname --set --name <hostname>
180
+~~~~
181
+## wait_for_link
182
+
183
+Wait for the specified network interface to be up and usable (it can send and receive packets).
184
+~~~~
185
+netmgr wait_for_link --interface <ifname> --timeout <timeout>
186
+~~~~
187
+The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
188
+
189
+**Note:** You might need to use wait_for_ip to wait until you can send and receive IP packets.
190
+
191
+## wait_for_ip
192
+
193
+Wait for the specified interface to acquire a valid IP address for the specified address type.
194
+~~~~
195
+netmgr wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6>
196
+~~~~
197
+The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
198
+
199
+## error_info
200
+
201
+Get error information about the specified error code.
202
+~~~~
203
+netmgr error_info --errcode <error_code>
204
+~~~~
205
+Here is a list of error codes:
206
+
207
+- 4097 - invalid parameter
208
+- 4098 - not supported
209
+- 4099 - out of memory
210
+- 4100 - value not found
211
+- 4101 - value exists
212
+- 4102 - invalid interface
213
+- 4103 - invalid mode
214
+- 4104 - bad configuration file
215
+- 4105 - write failed
216
+- 4106 - timeout
217
+- 4107 - DCHP timeout
218
+
219
+## net_info
220
+
221
+Get the specified network configuration parameter for the specified object.
222
+~~~~
223
+netmgr net_info --get --object <ifname or filename> --paramname <param_name>
224
+~~~~
225
+**Note:** The object can be an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf).
226
+
227
+Set the value of the specified network configuration parameter for the specified object (interface or file).
228
+~~~~
229
+netmgr net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value>
230
+~~~~
231
+**Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -.
232
+
233
+For example, in order to add static IPv4 address "10.10.10.1/24" to eth0 interface, the following command adds this **Address** to the **Network** section of the **eth0** network configuration file.
234
+~~~~
235
+netmgr net_info --set --object eth0 --paramname +Network_Address --paramvalue "10.10.10.1/24"
236
+~~~~
237
+
238
+
... ...
@@ -117,7 +117,7 @@ Link state. Available settings:
117 117
 Link information. Includes the following information:
118 118
 
119 119
 - ``pszInterfaceName`` - interface name
120
-- ``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: &quot;00:0c:29:99:a5:7b&quot;)
120
+- ``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: "00:0c:29:99:a5:7b")
121 121
 - ``mtu`` - maximum transmission unit (MTU)
122 122
 - ``mode`` - link mode (see above)
123 123
 - ``state`` - link state (see above)
... ...
@@ -153,7 +153,7 @@ nm_set_link_mac_addr(
153 153
 **Arguments**
154 154
 
155 155
 - ``pszInterfaceName`` - interface name
156
-- ``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: &quot;00:0c:29:99:a5:7b&quot;)
156
+- ``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: "00:0c:29:99:a5:7b")
157 157
 
158 158
 **Returns**
159 159
 
... ...
@@ -177,7 +177,7 @@ uint32_t
177 177
 **Arguments**
178 178
 
179 179
 - ``pszInterfaceName`` - interface name
180
-- ``ppszMacAddress`` - interface hardware address specified in a colon-separated format (for example: &quot;00:0c:29:99:a5:7b&quot;)
180
+- ``ppszMacAddress`` - interface hardware address specified in a colon-separated format (for example: "00:0c:29:99:a5:7b")
181 181
 
182 182
 **Returns**
183 183
 
... ...
@@ -404,7 +404,7 @@ uint32_t
404 404
 - ``pszInterfaceName`` - interface name
405 405
 - ``ppLinkInfo``, which includes the following information:
406 406
   - \*``pszInterfaceName`` - interface name
407
-  - \*``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: &quot;00:0c:29:99:a5:7b&quot;)
407
+  - \*``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: "00:0c:29:99:a5:7b")
408 408
   - ``mtu`` - maximum transmission unit (MTU)
409 409
   - ``mode`` - One of the following values:
410 410
     - ``LINK_AUTO`` - the specified interface is managed and configured by systemd network manager
... ...
@@ -437,7 +437,7 @@ void
437 437
 
438 438
 - ``pNetLinkInfo``, which includes the following information:
439 439
   - \*``pszInterfaceName`` - interface name
440
-  - \*``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: &quot;00:0c:29:99:a5:7b&quot;)
440
+  - \*``pszMacAddress`` - interface hardware address specified in a colon-separated format (for example: "00:0c:29:99:a5:7b")
441 441
   - ``mtu`` - maximum transmission unit (MTU)
442 442
   - ``mode`` - One of the following values:
443 443
     - ``LINK_AUTO`` - the specified interface is managed and configured by systemd network manager
... ...
@@ -1451,11 +1451,11 @@ uint32_t
1451 1451
 ~~~~
1452 1452
 **Arguments**
1453 1453
 
1454
-- ``pszObjectName`` - an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf)
1454
+- ``pszObjectName`` - an interface name (for example, "eth0") or a file name (for example, /etc/systemd/resolved.conf)
1455 1455
 - ``pszParamName`` - name of a parameter associated with the object; specified in the format SectionName_KeyName (for example, Link_MTUBytes represents the MtuBytes key in [Link] section in [https://www.freedesktop.org/software/systemd/man/systemd.network.html](https://www.freedesktop.org/software/systemd/man/systemd.network.html))
1456 1456
 - ``pszParamValue`` - points to the parameter value to set; you can add (+) or remove (-) a parameter by prepending the parameter name with + or -. For example:
1457 1457
 
1458
-netmgr net_info --set --object eth1 --paramname +Network_Address --paramvalue &quot;10.10.10.1/24&quot;
1458
+netmgr net_info --set --object eth1 --paramname +Network_Address --paramvalue "10.10.10.1/24"
1459 1459
 
1460 1460
 **Returns**
1461 1461
 
... ...
@@ -1479,7 +1479,7 @@ Get the value of a network parameter associated with an object.
1479 1479
 ~~~~
1480 1480
 **Arguments**
1481 1481
 
1482
-- ``pszObjectName`` - an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf)
1482
+- ``pszObjectName`` - an interface name (for example, "eth0") or a file name (for example, /etc/systemd/resolved.conf)
1483 1483
 - ``pszParamName`` - name of a parameter associated with the object; returned in the format SectionName_KeyName (for example, Link_MTUBytes represents the MtuBytes key in [Link] section in  [https://www.freedesktop.org/software/systemd/man/systemd.network.html](https://www.freedesktop.org/software/systemd/man/systemd.network.html))
1484 1484
 - ``ppszParamValue`` - parameter value
1485 1485
 
... ...
@@ -1,4 +1,5 @@
1 1
 # Network Configuration Manager - Python API
2
+
2 3
 Photon OS 2.0 provides a Python API for the Network Configuration Manager.
3 4
 
4 5
 - [Setup Instructions](#setup-instructions)
... ...
@@ -11,70 +12,70 @@ Photon OS 2.0 provides a Python API for the Network Configuration Manager.
11 11
 - [DHCP Options, DUID, and IAID Configuration](#dhcp-options-duid-and-iaid-configuration)
12 12
 - [NTP Servers](#ntp-servers)
13 13
 
14
-# Setup Instructions
14
+## Setup Instructions
15 15
 
16 16
 To set up and run the latest version of the Network Manager API for Python:
17
-~~~~
17
+
18
+````
18 19
 # tdnf install pmd pmd-python3
19 20
 # systemctl start pmd
20
-~~~~
21
-# Initialization Steps
22
-~~~~
21
+````
22
+
23
+## Initialization Steps
24
+
25
+````
23 26
 # python3
24
-&gt;&gt;&gt; import pmd
25
-&gt;&gt;&gt; net = pmd.server().net
26
-&gt;&gt;&gt; net._command_
27
-~~~~
28
-# Get Online Help
27
+>>> import pmd
28
+>>> net = pmd.server().net
29
+````
30
+## Get Online Help
29 31
 
30 32
 Get help for all commands.
31
-~~~~
32
-&gt;&gt;&gt; help(net)
33
-~~~~
33
+````
34
+>>> help(net)
35
+````
34 36
 Get help for a specific command.
35
-~~~~
36
-&gt;&gt;&gt; help(net.add_ntp_servers)
37
+````
38
+>>> help(net.add_ntp_servers)
37 39
 -in function add_ntp_servers:
38 40
 add_ntp_servers(...) method of  [server.net](http://server.net/) instance
39
-    net.add_ntp_servers(ntpservers = [&quot;20.20.20.20&quot;, &quot;25.30.40.70&quot;])
41
+    net.add_ntp_servers(ntpservers = ["20.20.20.20", "25.30.40.70"])
40 42
     adds ntp servers. returns success: 0, failure: exception.
41 43
 (END)
42
-~~~~
44
+````
43 45
 
44
-# Basic Information
46
+## Basic Information
45 47
 
46 48
 ### get_system_network_info
47 49
 
48 50
 Get network information details that are common to the entire system.
49 51
 
50 52
 **Syntax**
51
-~~~~
53
+
54
+````
52 55
 net.get_system_network_info()
53
-~~~~
56
+````
54 57
 **Returns**
55 58
 
56 59
 - details about the system network (DUID, DNS mode, DNS server list, DNS domain list, NTP server list)
57 60
 
58 61
 **Example**
59
-~~~~
60
-&gt;&gt;&gt; system_network_info = netmgmt.get_system_network_info()
62
+````
63
+>>> system_network_info = netmgmt.get_system_network_info()
61 64
 
62
-&gt;&gt;&gt; type  (system_network_info)
65
+>>> print ( system_network_info)
63 66
 
64
-&lt;class &#39;list&#39;&gt;
67
+[{DUID: 00:02:11:22:33:44:55:66:77:20, DNS Mode: (null), DNS ServerList: ['10.10.100.100', '20.20.200.10'], DNS domain list: [' [abcd.com](http://abcd.com)'], NTP ServerList: (null)}]
68
+````
65 69
 
66
-&gt;&gt;&gt; print ( system_network_info)
67
-
68
-[{DUID: 00:02:11:22:33:44:55:66:77:20, DNS Mode: (null), DNS ServerList: [&#39;10.10.100.100&#39;, &#39;20.20.200.10&#39;], DNS domain list: [&#39; [abcd.com](http://abcd.com)&#39;], NTP ServerList: (null)}]
69
-~~~~
70 70
 ### get_err_info
71 71
 
72 72
 Get information about the specified error number.
73 73
 
74 74
 **Syntax**
75
-~~~~
76
-net.get_err_info(error = &lt;error_number&gt;)
77
-~~~~
75
+````
76
+net.get_err_info(error = <error_number>)
77
+````
78 78
 **Parameters**
79 79
 
80 80
 - error - error number
... ...
@@ -99,12 +100,12 @@ Here is the list of error numbers:
99 99
 - failure: exception
100 100
 
101 101
 Example
102
-~~~~
103
-&gt;&gt; net.get_err_info(error = 4097)
102
+````
103
+>> net.get_err_info(error = 4097)
104 104
 
105
-&#39;invalid parameter&#39;
106
-~~~~
107
-# Interface Configuration
105
+'invalid parameter'
106
+````
107
+## Interface Configuration
108 108
 
109 109
 Use these commands to manage the configuration for a network interface.
110 110
 
... ...
@@ -113,9 +114,9 @@ Use these commands to manage the configuration for a network interface.
113 113
 Get the link info for the specified interface or for all interfaces (if no interface is specified).
114 114
 
115 115
 **Syntax**
116
-~~~~
116
+````
117 117
 net.get_link_info(ifname = interface_name)
118
-~~~~
118
+````
119 119
 **Parameters**
120 120
 
121 121
 - ``ifname`` - interface name (optional)
... ...
@@ -130,9 +131,9 @@ net.get_link_info(ifname = interface_name)
130 130
 Get the MAC address for the specified interface or for all interfaces (if no interface is specified).
131 131
 
132 132
 **Syntax**
133
-~~~~
133
+````
134 134
 net.get_link_macaddr(ifname = interface_name)
135
-~~~~
135
+````
136 136
 **Parameters**
137 137
 
138 138
 - ``ifname`` - interface name (optional)
... ...
@@ -147,9 +148,9 @@ net.get_link_macaddr(ifname = interface_name)
147 147
 Get the link mode for the specified interface (auto or manual), or for all interfaces (if no interface is specified).
148 148
 
149 149
 **Syntax**
150
-~~~~
150
+````
151 151
 net.get_link_mode(ifname = interface_name)
152
-~~~~
152
+````
153 153
 **Parameters**
154 154
 
155 155
 - ``ifname`` - interface name (optional)
... ...
@@ -164,9 +165,9 @@ net.get_link_mode(ifname = interface_name)
164 164
 Get the MTU of the specified interface or for all interfaces (if no interface is specified).
165 165
 
166 166
 **Syntax**
167
-~~~~
167
+````
168 168
 net.get_link_mtu(ifname = interface_name)
169
-~~~~
169
+````
170 170
 **Parameters**
171 171
 
172 172
 - ``ifname`` - interface name (optional)
... ...
@@ -181,9 +182,9 @@ net.get_link_mtu(ifname = interface_name)
181 181
 Get the link state of the specified interface or for all interfaces (if no interface is specified).
182 182
 
183 183
 **Syntax**
184
-~~~~
184
+````
185 185
 net.get_link_state(ifname = interface_name)
186
-~~~~
186
+````
187 187
 **Parameters**
188 188
 
189 189
 - ``ifname`` - interface name (optional)
... ...
@@ -198,9 +199,10 @@ net.get_link_state(ifname = interface_name)
198 198
 Bring down the specified interface.
199 199
 
200 200
 **Syntax**
201
-~~~~
201
+
202
+````
202 203
 net.set_link_down(ifname = interface_name)
203
-~~~~
204
+````
204 205
 **Parameters**
205 206
 
206 207
 - ``ifname`` - interface name
... ...
@@ -215,9 +217,9 @@ net.set_link_down(ifname = interface_name)
215 215
 Set the MAC address of the specified interface.
216 216
 
217 217
 **Syntax**
218
-~~~~
218
+````
219 219
 net.set_link_macaddr(ifname = interface_name, macaddr = mac_address)
220
-~~~~
220
+````
221 221
 **Parameters**
222 222
 
223 223
 - ``ifname`` - interface name
... ...
@@ -233,9 +235,9 @@ net.set_link_macaddr(ifname = interface_name, macaddr = mac_address)
233 233
 Set the mode (auto or manual) of the specifed interface.
234 234
 
235 235
 **Syntax**
236
-~~~~
236
+````
237 237
 net.set_link_mode(ifname = interface_name, link_mode = [auto, manual])
238
-~~~~
238
+````
239 239
 **Parameters**
240 240
 
241 241
 - ``ifname`` - interface name
... ...
@@ -251,9 +253,9 @@ net.set_link_mode(ifname = interface_name, link_mode = [auto, manual])
251 251
 Set the MTU for the specified interface.
252 252
 
253 253
 **Syntax**
254
-~~~~
254
+````
255 255
 net.set_link_mtu(ifname = interface_name, mtu = mtu)
256
-~~~~
256
+````
257 257
 **Parameters**
258 258
 
259 259
 - ``ifname`` - interface name
... ...
@@ -269,9 +271,9 @@ net.set_link_mtu(ifname = interface_name, mtu = mtu)
269 269
 Set the state (up or down) of the specified interface.
270 270
 
271 271
 **Syntax**
272
-~~~~
272
+````
273 273
 net.set_link_state(ifname = interface_name, link_state = [down, up])
274
-~~~~
274
+````
275 275
 **Parameters**
276 276
 
277 277
 - ``ifname`` - interface name
... ...
@@ -287,9 +289,9 @@ net.set_link_state(ifname = interface_name, link_state = [down, up])
287 287
 Brings up the specified interface.
288 288
 
289 289
 **Syntax**
290
-~~~~
290
+````
291 291
 net.set_link_up(ifname = interface_name)
292
-~~~~
292
+````
293 293
 **Parameters**
294 294
 
295 295
 - ``ifname`` - interface name
... ...
@@ -300,7 +302,7 @@ net.set_link_up(ifname = interface_name)
300 300
 - success: 0
301 301
 - failure: exception
302 302
 
303
-# IP Address Configuration
303
+## IP Address Configuration
304 304
 
305 305
 Use these commands to manage IP address configuration for a network interface.
306 306
 
... ...
@@ -309,9 +311,9 @@ Use these commands to manage IP address configuration for a network interface.
309 309
 Add a static IPv6 address to the specified interface.
310 310
 
311 311
 **Syntax**
312
-~~~~
312
+````
313 313
 net.add_static_ipv6_addr(ifname = interface_name, addr_prefix = ipv6address_prefix)
314
-~~~~
314
+````
315 315
 **Parameters**
316 316
 
317 317
 - ``ifname`` - interface name
... ...
@@ -327,9 +329,9 @@ net.add_static_ipv6_addr(ifname = interface_name, addr_prefix = ipv6address_pref
327 327
 Delete a static IPv6 address from the specified interface.
328 328
 
329 329
 **Syntax**
330
-~~~~
330
+````
331 331
 net.del_static_ipv6_addr(ifname = interface_name, addr_prefix = ipv6address_prefix)
332
-~~~~
332
+````
333 333
 **Parameters**
334 334
 
335 335
 - ``ifname`` - interface name
... ...
@@ -345,9 +347,9 @@ net.del_static_ipv6_addr(ifname = interface_name, addr_prefix = ipv6address_pref
345 345
 Get the IPv4 address with the prefix and gateway for the specified interface.
346 346
 
347 347
 **Syntax**
348
-~~~~
348
+````
349 349
 net.get_ipv4_addr_gateway(ifname = interface_name)
350
-~~~~
350
+````
351 351
 **Parameters**
352 352
 
353 353
 - ``ifname`` - interface name
... ...
@@ -362,9 +364,9 @@ net.get_ipv4_addr_gateway(ifname = interface_name)
362 362
 Get the list of IPv6 addresses for the specified interface.
363 363
 
364 364
 **Syntax**
365
-~~~~
365
+````
366 366
 net.get_ipv6_addr(ifname = interface_name)
367
-~~~~
367
+````
368 368
 **Parameters**
369 369
 
370 370
 - ``ifname`` - interface name
... ...
@@ -379,9 +381,9 @@ net.get_ipv6_addr(ifname = interface_name)
379 379
 Get the address mode for the specified interface to determine whether DHCPv6, autoconf are enabled or disabled.
380 380
 
381 381
 **Syntax**
382
-~~~~
382
+````
383 383
 net.get_ipv6_addr_mode(ifname = interface_name)
384
-~~~~
384
+````
385 385
 **Parameters**
386 386
 
387 387
 - ``ifname`` - interface name
... ...
@@ -396,9 +398,9 @@ net.get_ipv6_addr_mode(ifname = interface_name)
396 396
 Get the IPv6 gateway for the specified interface.
397 397
 
398 398
 **Syntax**
399
-~~~~
399
+````
400 400
 net.get_ipv6_gateway(ifname = interface_name)
401
-~~~~
401
+````
402 402
 **Parameters**
403 403
 
404 404
 - ``ifname`` - interface name
... ...
@@ -413,9 +415,9 @@ net.get_ipv6_gateway(ifname = interface_name)
413 413
 Set the IPv4 address with the prefix and gateway for the specified interface.
414 414
 
415 415
 **Syntax**
416
-~~~~
416
+````
417 417
 net.get_ipv4_addr_gateway(ifname = interface_name, addr_mode = [dhcp, static, none], addr_prefix = ipv4addressprefix, gateway = ipv4gateway)
418
-~~~~
418
+````
419 419
 **Parameters**
420 420
 
421 421
 - ``ifname`` - interface name
... ...
@@ -433,9 +435,9 @@ net.get_ipv4_addr_gateway(ifname = interface_name, addr_mode = [dhcp, static, no
433 433
 Set the address mode for the specified interface.
434 434
 
435 435
 **Syntax**
436
-~~~~
436
+````
437 437
 net.set_ipv6_addr_mode(ifname = interface_name, enable_dhcp = [True, False], enable_autoconf = [True, False])
438
-~~~~
438
+````
439 439
 **Parameters**
440 440
 
441 441
 - ``ifname`` - interface name
... ...
@@ -452,9 +454,9 @@ net.set_ipv6_addr_mode(ifname = interface_name, enable_dhcp = [True, False], ena
452 452
 Set the IPv6 gateway for the specified interface.
453 453
 
454 454
 **Syntax**
455
-~~~~
455
+````
456 456
 net.set_ipv6_gateway(ifname = interface_name, gateway = ipv6gateway)
457
-~~~~
457
+````
458 458
 **Parameters**
459 459
 
460 460
 - ``ifname`` - interface name
... ...
@@ -465,7 +467,7 @@ net.set_ipv6_gateway(ifname = interface_name, gateway = ipv6gateway)
465 465
 - success: 0
466 466
 - failure: exception
467 467
 
468
-# DNS Configuration
468
+## DNS Configuration
469 469
 
470 470
 Use these commands to manage DNS domains and servers for a network interface.
471 471
 
... ...
@@ -474,9 +476,9 @@ Use these commands to manage DNS domains and servers for a network interface.
474 474
 Get the list of DNS domains for the specified interface.
475 475
 
476 476
 **Syntax**
477
-~~~~
477
+````
478 478
 net.get_dns_domains(ifname = interface_name)
479
-~~~~
479
+````
480 480
 **Parameters**
481 481
 
482 482
 - ``ifname`` - interface name
... ...
@@ -491,9 +493,9 @@ net.get_dns_domains(ifname = interface_name)
491 491
 Get the list of DNS servers and the mode for the specified interface.
492 492
 
493 493
 **Syntax**
494
-~~~~
494
+````
495 495
 net.get_dns_servers(ifname = interface_name)
496
-~~~~
496
+````
497 497
 **Parameters**
498 498
 
499 499
 - ``ifname`` - interface name
... ...
@@ -508,9 +510,9 @@ net.get_dns_servers(ifname = interface_name)
508 508
 Set the list of DNS domains for the specified interface.
509 509
 
510 510
 **Syntax**
511
-~~~~
512
-net.set_dns_domains(domains = [&quot;domain1&quot;,&quot;domain2&quot;,...], ifname = interface_name)
513
-~~~~
511
+````
512
+net.set_dns_domains(domains = ["domain1","domain2",...], ifname = interface_name)
513
+````
514 514
 **Parameters**
515 515
 
516 516
 - ``domains`` - comma-separated list of one or more domains
... ...
@@ -526,9 +528,9 @@ net.set_dns_domains(domains = [&quot;domain1&quot;,&quot;domain2&quot;,...], ifn
526 526
 Set the list of DNS servers for the specified interface.
527 527
 
528 528
 **Syntax**
529
-~~~~
530
-net.set_dns_servers(dns_mode = [dhcp, static], servers = [&quot;server1&quot;,&quot;server2&quot;, ...], ifname = interface_name)
531
-~~~~
529
+````
530
+net.set_dns_servers(dns_mode = [dhcp, static], servers = ["server1","server2", ...], ifname = interface_name)
531
+````
532 532
 **Parameters**
533 533
 
534 534
 - ``dns_mode`` - dhcp or static
... ...
@@ -540,16 +542,16 @@ net.set_dns_servers(dns_mode = [dhcp, static], servers = [&quot;server1&quot;,&q
540 540
 - success: 0
541 541
 - failure: exception
542 542
 
543
-# DHCP Options DUID and IAID Configuration
543
+## DHCP Options DUID and IAID Configuration
544 544
 
545 545
 ### get_link_iaid
546 546
 
547 547
 Get the IAID for the specified interface.
548 548
 
549 549
 **Syntax**
550
-~~~~
550
+````
551 551
 net.get_link_iaid(ifname = interface)
552
-~~~~
552
+````
553 553
 **Parameters**
554 554
 
555 555
 - ``ifname`` - interface name
... ...
@@ -564,9 +566,9 @@ net.get_link_iaid(ifname = interface)
564 564
 Set the IAID for the specified interface.
565 565
 
566 566
 **Syntax**
567
-~~~~
568
-net.set_link_iaid(ifname = interface_name, iaid = &lt;iaid&gt;)
569
-~~~~
567
+````
568
+net.set_link_iaid(ifname = interface_name, iaid = <iaid>)
569
+````
570 570
 **Parameters**
571 571
 
572 572
 - ``ifname`` - interface name
... ...
@@ -582,9 +584,9 @@ net.set_link_iaid(ifname = interface_name, iaid = &lt;iaid&gt;)
582 582
 Get the DCHP DUID.
583 583
 
584 584
 **Syntax**
585
-~~~~
585
+````
586 586
 net.get_dhcp_duid(ifname = interface_name)
587
-~~~~
587
+````
588 588
 **Parameters**
589 589
 
590 590
 - ``ifname`` - interface name (optional)
... ...
@@ -599,9 +601,9 @@ net.get_dhcp_duid(ifname = interface_name)
599 599
 Set the DCHP DUID.
600 600
 
601 601
 **Syntax**
602
-~~~~
602
+````
603 603
 net.set_dhcp_duid(ifname = interface_name duid = duid)
604
-~~~~
604
+````
605 605
 **Parameters**
606 606
 
607 607
 - ``ifname`` - interface name (optional)
... ...
@@ -612,7 +614,7 @@ net.set_dhcp_duid(ifname = interface_name duid = duid)
612 612
 - success: 0
613 613
 - failure: exception
614 614
 
615
-# NTP Servers
615
+## NTP Servers
616 616
 
617 617
 Use these commands to manage the NTP servers list.
618 618
 
... ...
@@ -621,9 +623,9 @@ Use these commands to manage the NTP servers list.
621 621
 Add one or more NTP servers to the NTP servers list.
622 622
 
623 623
 **Syntax**
624
-~~~~
625
-net.add_ntp_servers(ntpservers = [&quot;server1&quot;, &quot;server2&quot;, ...])
626
-~~~~
624
+````
625
+net.add_ntp_servers(ntpservers = ["server1", "server2", ...])
626
+````
627 627
 **Parameters**
628 628
 
629 629
 - ``ntpservers`` - Comma-separated list of NTP servers to add to the list.
... ...
@@ -638,9 +640,9 @@ net.add_ntp_servers(ntpservers = [&quot;server1&quot;, &quot;server2&quot;, ...]
638 638
 Remove one or more NTP servers from the NTP servers list.
639 639
 
640 640
 **Syntax**
641
-~~~~
642
-net.del_ntp_servers(ntpservers = [&quot;server1&quot;, &quot;server2&quot;, ...])
643
-~~~~
641
+````
642
+net.del_ntp_servers(ntpservers = ["server1", "server2", ...])
643
+````
644 644
 **Parameters**
645 645
 
646 646
 - ``ntpservers`` - Comma-separated list of NTP servers to remove from the list.
... ...
@@ -655,9 +657,9 @@ net.del_ntp_servers(ntpservers = [&quot;server1&quot;, &quot;server2&quot;, ...]
655 655
 Get the NTP servers list.
656 656
 
657 657
 **Syntax**
658
-~~~~
658
+````
659 659
 net.get_ntp_servers()
660
-~~~~
660
+````
661 661
 **Returns**
662 662
 
663 663
 - success: NTP servers list
... ...
@@ -668,12 +670,12 @@ net.get_ntp_servers()
668 668
 Set the NTP servers list.
669 669
 
670 670
 **Syntax**
671
-~~~~
672
-net.set_ntp_servers(ntpservers = [&quot;server1&quot;, &quot;server2&quot;, ...])
673
-~~~~
671
+````
672
+net.set_ntp_servers(ntpservers = ["server1", "server2", ...])
673
+````
674 674
 **Parameters**
675 675
 
676
-- ``ntpservers`` - Comma-separated list of NTP servers to remove from the list.
676
+- ``ntpservers`` - Comma-separated list of NTP servers to set in the list.
677 677
 
678 678
 **Returns**
679 679
 
... ...
@@ -698,9 +700,9 @@ net.get_hostname()
698 698
 Set the host name.
699 699
 
700 700
 **Syntax**
701
-~~~~
701
+````
702 702
 net.set_hostname(hostname)
703
-~~~~
703
+````
704 704
 **Parameters**
705 705
 
706 706
 - ``hostname`` - name to assign to the host
... ...
@@ -715,9 +717,9 @@ net.set_hostname(hostname)
715 715
 Wait for the specified interface to acquire a valid IP address of the specified IP address type.
716 716
 
717 717
 **Syntax**
718
-~~~~
718
+````
719 719
 net.wait_for_ip(ifname = interface_name, timeout = timeout, addrtypes = [ipv4, ipv6, static_ipv4, static_ipv6, dhcp_ipv4, dhcp_ipv6, auto_ipv6, link_local_ipv6])
720
-~~~~
720
+````
721 721
 **Parameters**
722 722
 
723 723
 - ``ifname`` - interface name
... ...
@@ -734,9 +736,9 @@ net.wait_for_ip(ifname = interface_name, timeout = timeout, addrtypes = [ipv4, i
734 734
 Wait for the specified interface to come up.
735 735
 
736 736
 **Syntax**
737
-~~~~
737
+````
738 738
 net.wait_for_link_up(ifname = interface_name, timeout = timeout)
739
-~~~~
739
+````
740 740
 **Parameters**
741 741
 
742 742
 - ``ifname`` - interface name
... ...
@@ -752,9 +754,9 @@ net.wait_for_link_up(ifname = interface_name, timeout = timeout)
752 752
 Get the specified network configuration parameter for the specified interface or filename.
753 753
 
754 754
 **Syntax**
755
-~~~~
755
+````
756 756
 net.get_network_param(object = IfName or Filename, paramname = SectionName_KeyName)
757
-~~~~
757
+````
758 758
 **Parameters**
759 759
 
760 760
 - ``object`` - an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf)
... ...
@@ -770,9 +772,9 @@ net.get_network_param(object = IfName or Filename, paramname = SectionName_KeyNa
770 770
 Set the value of a network configuration parameter for the specified interface or filename.
771 771
 
772 772
 **Syntax**
773
-~~~~
773
+````
774 774
 net.set_network_param(object = interface_name or filename, paramname = SectionName_KeyName, paramvalue = key_value)
775
-~~~~
775
+````
776 776
 **Parameters**
777 777
 
778 778
 - ``object`` - an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf)
... ...
@@ -781,4 +783,4 @@ net.set_network_param(object = interface_name or filename, paramname = SectionNa
781 781
 **Returns**
782 782
 
783 783
 - success: 0
784
-- failure: exception
785 784
\ No newline at end of file
785
+- failure: exception
786 786
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+package.json
1
+README 
2
+CHANGELOG
3
+LICENSE / LICENCE
0 4
\ No newline at end of file
1 5
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+#Chapter fold for GitBook
1
+==============
2
+
3
+Extended from the **expandable-chapters** plugin, and make a little modify. Thx for the original author.  
4
+Tiny change to the expandable-chapters plugin from https://github.com/DomainDrivenArchitecture/ to use smaller arrows.  
5
+
6
+### Anything Change?
7
+
8
+Modify the feature of the chapter links, make the links could be clicked to fold or expand their content.  
9
+And add a new feature in order to keep the last chapter which the user browses at last time.  
10
+
11
+### How to use it?
12
+
13
+Add it to your `book.json` configuration:
14
+
15
+```
16
+{
17
+    plugins: ["chapter-fold"]
18
+}
19
+```
20
+
21
+Install your plugins using:
22
+
23
+```
24
+$ gitbook install
25
+```
26
+
27
+### Configuration
28
+
29
+There is _no_ configuration needed at the moment, can be left empty.
30
+
31
+```
32
+{
33
+	"pluginsConfig": {
34
+		"chapter-fold":{}
35
+	}
36
+}
37
+```
38
+
0 39
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+.book .book-summary .chapter > .articles {
1
+	overflow: hidden;
2
+	max-height: 0px;
3
+}
4
+
5
+.book .book-summary .chapter.expanded > .articles {
6
+	max-height: 9999px;
7
+}
8
+
9
+.book .book-summary .exc-trigger {
10
+	position: absolute;
11
+  	left: 12px;
12
+  	top: 12px;
13
+}
14
+
15
+.book .book-summary ul.summary li a,
16
+.book .book-summary ul.summary li span {
17
+	padding-left: 30px;
18
+}
19
+
20
+.book .book-summary .exc-trigger:before {
21
+  	content: "\f105";
22
+}
23
+
24
+.book .book-summary .expanded > a .exc-trigger:before,
25
+.book .book-summary .expanded > span .exc-trigger:before {
26
+	content: "\f107";
27
+}
28
+
0 29
new file mode 100644
... ...
@@ -0,0 +1,67 @@
0
+require(['gitbook', 'jQuery'], function(gitbook, $) {
1
+  var TOGGLE_CLASSNAME = 'expanded',
2
+      CHAPTER = '.chapter',
3
+      ARTICLES = '.articles',
4
+      TRIGGER_TEMPLATE = '<i class="exc-trigger fa"></i>',
5
+      LS_NAMESPACE = 'expChapters';
6
+  var init = function () {
7
+    // adding the trigger element to each ARTICLES parent and binding the event
8
+    var chapterLink = $(ARTICLES).parent(CHAPTER).children('a');
9
+    chapterLink.append($(TRIGGER_TEMPLATE));
10
+    chapterLink.on('click', function (e) {
11
+      e.preventDefault();
12
+      //e.stopPropagation();
13
+      toggle($(e.target).closest(CHAPTER));
14
+    });  
15
+
16
+    expand(lsItem());
17
+    //expand current selected chapter with it's parents
18
+    collapse($(CHAPTER));
19
+    var activeChapter = $(CHAPTER + '.active');
20
+    expand(activeChapter);
21
+    expand(activeChapter.parents(CHAPTER));
22
+  } 
23
+  //on page.change will happend the function.
24
+
25
+  var toggle = function ($chapter) {
26
+    if ($chapter.hasClass('expanded')) {
27
+      collapse($chapter);
28
+    } else {
29
+      expand($chapter);
30
+      //$chapter.addClass('active').siblings().removeClass('active');
31
+    }
32
+  }
33
+  var collapse = function ($chapter) {
34
+    if ($chapter.length && $chapter.hasClass(TOGGLE_CLASSNAME)) {
35
+      $chapter.removeClass(TOGGLE_CLASSNAME);
36
+      lsItem($chapter);
37
+    }
38
+  }
39
+  var expand = function ($chapter) {
40
+    if ($chapter.length && !$chapter.hasClass(TOGGLE_CLASSNAME)) {
41
+      $chapter.addClass(TOGGLE_CLASSNAME);
42
+      lsItem($chapter);
43
+    }
44
+  }
45
+  var lsItem = function () {
46
+    var map = JSON.parse(localStorage.getItem(LS_NAMESPACE)) || {}
47
+    if (arguments.length) {
48
+      var $chapters = arguments[0];
49
+      $chapters.each(function (index, element) {
50
+        var level = $(this).data('level');
51
+        var value = $(this).hasClass(TOGGLE_CLASSNAME);
52
+        map[level] = value;
53
+      })
54
+      localStorage.setItem(LS_NAMESPACE, JSON.stringify(map));
55
+    } else {
56
+      return $(CHAPTER).map(function(index, element){
57
+        if (map[$(this).data('level')]) {
58
+          return this;
59
+        }
60
+      })
61
+    }
62
+  }
63
+  gitbook.events.bind('page.change', function() {
64
+    init()
65
+  }); 
66
+});
0 67
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+module.exports = {
1
+    // Extend website resources and html
2
+    website: {
3
+        assets: "./book",
4
+        js: [
5
+            "chapter-fold.js"
6
+        ],
7
+        css: [
8
+            "chapter-fold.css"
9
+        ]
10
+    }
11
+};
0 12
\ No newline at end of file
1 13
new file mode 100644
... ...
@@ -0,0 +1,85 @@
0
+{
1
+  "_args": [
2
+    [
3
+      {
4
+        "name": "gitbook-plugin-chapter-fold",
5
+        "raw": "gitbook-plugin-chapter-fold@0.0.4",
6
+        "rawSpec": "0.0.4",
7
+        "scope": null,
8
+        "spec": "0.0.4",
9
+        "type": "version"
10
+      },
11
+      "C:\\Users\\vasudevanv\\Documents\\photon\\docs"
12
+    ]
13
+  ],
14
+  "_from": "gitbook-plugin-chapter-fold@0.0.4",
15
+  "_id": "gitbook-plugin-chapter-fold@0.0.4",
16
+  "_inCache": true,
17
+  "_installable": true,
18
+  "_location": "/gitbook-plugin-chapter-fold",
19
+  "_nodeVersion": "8.9.4",
20
+  "_npmOperationalInternal": {
21
+    "host": "s3://npm-registry-packages",
22
+    "tmp": "tmp/gitbook-plugin-chapter-fold_0.0.4_1529402331863_0.19505579298587006"
23
+  },
24
+  "_npmUser": {
25
+    "email": "crazypad@qq.com",
26
+    "name": "coco9420"
27
+  },
28
+  "_npmVersion": "4.6.1",
29
+  "_phantomChildren": {},
30
+  "_requested": {
31
+    "name": "gitbook-plugin-chapter-fold",
32
+    "raw": "gitbook-plugin-chapter-fold@0.0.4",
33
+    "rawSpec": "0.0.4",
34
+    "scope": null,
35
+    "spec": "0.0.4",
36
+    "type": "version"
37
+  },
38
+  "_requiredBy": [
39
+    "#USER"
40
+  ],
41
+  "_resolved": "https://registry.npmjs.org/gitbook-plugin-chapter-fold/-/gitbook-plugin-chapter-fold-0.0.4.tgz",
42
+  "_shasum": "dcd5a21f80bcbc98c088419774c397ae6d4463ef",
43
+  "_shrinkwrap": null,
44
+  "_spec": "gitbook-plugin-chapter-fold@0.0.4",
45
+  "_where": "C:\\Users\\vasudevanv\\Documents\\photon\\docs",
46
+  "author": {
47
+    "name": "Colin"
48
+  },
49
+  "bugs": {
50
+    "url": "https://github.com/ColinCollins/gitbook-plugin-chapter-fold/issues"
51
+  },
52
+  "dependencies": {},
53
+  "description": "This is the fold plugin, extended from the expandable chapter plugin.",
54
+  "devDependencies": {},
55
+  "directories": {},
56
+  "dist": {
57
+    "fileCount": 6,
58
+    "shasum": "dcd5a21f80bcbc98c088419774c397ae6d4463ef",
59
+    "tarball": "https://registry.npmjs.org/gitbook-plugin-chapter-fold/-/gitbook-plugin-chapter-fold-0.0.4.tgz",
60
+    "unpackedSize": 4555
61
+  },
62
+  "engines": {
63
+    "gitbook": ">=1.0.0"
64
+  },
65
+  "gitHead": "523aa84802ccbeabfae13d66c3dda66b4961b72f",
66
+  "homepage": "https://github.com/ColinCollins/gitbook-plugin-chapter-fold",
67
+  "license": "Apache 2",
68
+  "main": "index.js",
69
+  "maintainers": [
70
+    {
71
+      "email": "crazypad@qq.com",
72
+      "name": "coco9420"
73
+    }
74
+  ],
75
+  "name": "gitbook-plugin-chapter-fold",
76
+  "optionalDependencies": {},
77
+  "readme": "ERROR: No README data found!",
78
+  "repository": {
79
+    "type": "git",
80
+    "url": "git+https://github.com/ColinCollins/gitbook-plugin-chapter-fold.git"
81
+  },
82
+  "scripts": {},
83
+  "version": "0.0.4"
84
+}
0 85
new file mode 100644
... ...
@@ -0,0 +1,25 @@
0
+# Logs
1
+logs
2
+*.log
3
+
4
+# Runtime data
5
+pids
6
+*.pid
7
+*.seed
8
+
9
+# Directory for instrumented libs generated by jscoverage/JSCover
10
+lib-cov
11
+
12
+# Coverage directory used by tools like istanbul
13
+coverage
14
+
15
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
16
+.grunt
17
+
18
+# Compiled binary addons (http://nodejs.org/api/addons.html)
19
+build/Release
20
+
21
+# Dependency directory
22
+# Deployed apps should consider commenting this line out:
23
+# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
24
+node_modules
0 25
new file mode 100644
... ...
@@ -0,0 +1,201 @@
0
+Apache License
1
+                           Version 2.0, January 2004
2
+                        http://www.apache.org/licenses/
3
+
4
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
5
+
6
+   1. Definitions.
7
+
8
+      "License" shall mean the terms and conditions for use, reproduction,
9
+      and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+      "Licensor" shall mean the copyright owner or entity authorized by
12
+      the copyright owner that is granting the License.
13
+
14
+      "Legal Entity" shall mean the union of the acting entity and all
15
+      other entities that control, are controlled by, or are under common
16
+      control with that entity. For the purposes of this definition,
17
+      "control" means (i) the power, direct or indirect, to cause the
18
+      direction or management of such entity, whether by contract or
19
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
20
+      outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+      "You" (or "Your") shall mean an individual or Legal Entity
23
+      exercising permissions granted by this License.
24
+
25
+      "Source" form shall mean the preferred form for making modifications,
26
+      including but not limited to software source code, documentation
27
+      source, and configuration files.
28
+
29
+      "Object" form shall mean any form resulting from mechanical
30
+      transformation or translation of a Source form, including but
31
+      not limited to compiled object code, generated documentation,
32
+      and conversions to other media types.
33
+
34
+      "Work" shall mean the work of authorship, whether in Source or
35
+      Object form, made available under the License, as indicated by a
36
+      copyright notice that is included in or attached to the work
37
+      (an example is provided in the Appendix below).
38
+
39
+      "Derivative Works" shall mean any work, whether in Source or Object
40
+      form, that is based on (or derived from) the Work and for which the
41
+      editorial revisions, annotations, elaborations, or other modifications
42
+      represent, as a whole, an original work of authorship. For the purposes
43
+      of this License, Derivative Works shall not include works that remain
44
+      separable from, or merely link (or bind by name) to the interfaces of,
45
+      the Work and Derivative Works thereof.
46
+
47
+      "Contribution" shall mean any work of authorship, including
48
+      the original version of the Work and any modifications or additions
49
+      to that Work or Derivative Works thereof, that is intentionally
50
+      submitted to Licensor for inclusion in the Work by the copyright owner
51
+      or by an individual or Legal Entity authorized to submit on behalf of
52
+      the copyright owner. For the purposes of this definition, "submitted"
53
+      means any form of electronic, verbal, or written communication sent
54
+      to the Licensor or its representatives, including but not limited to
55
+      communication on electronic mailing lists, source code control systems,
56
+      and issue tracking systems that are managed by, or on behalf of, the
57
+      Licensor for the purpose of discussing and improving the Work, but
58
+      excluding communication that is conspicuously marked or otherwise
59
+      designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+      "Contributor" shall mean Licensor and any individual or Legal Entity
62
+      on behalf of whom a Contribution has been received by Licensor and
63
+      subsequently incorporated within the Work.
64
+
65
+   2. Grant of Copyright License. Subject to the terms and conditions of
66
+      this License, each Contributor hereby grants to You a perpetual,
67
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+      copyright license to reproduce, prepare Derivative Works of,
69
+      publicly display, publicly perform, sublicense, and distribute the
70
+      Work and such Derivative Works in Source or Object form.
71
+
72
+   3. Grant of Patent License. Subject to the terms and conditions of
73
+      this License, each Contributor hereby grants to You a perpetual,
74
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+      (except as stated in this section) patent license to make, have made,
76
+      use, offer to sell, sell, import, and otherwise transfer the Work,
77
+      where such license applies only to those patent claims licensable
78
+      by such Contributor that are necessarily infringed by their
79
+      Contribution(s) alone or by combination of their Contribution(s)
80
+      with the Work to which such Contribution(s) was submitted. If You
81
+      institute patent litigation against any entity (including a
82
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
83
+      or a Contribution incorporated within the Work constitutes direct
84
+      or contributory patent infringement, then any patent licenses
85
+      granted to You under this License for that Work shall terminate
86
+      as of the date such litigation is filed.
87
+
88
+   4. Redistribution. You may reproduce and distribute copies of the
89
+      Work or Derivative Works thereof in any medium, with or without
90
+      modifications, and in Source or Object form, provided that You
91
+      meet the following conditions:
92
+
93
+      (a) You must give any other recipients of the Work or
94
+          Derivative Works a copy of this License; and
95
+
96
+      (b) You must cause any modified files to carry prominent notices
97
+          stating that You changed the files; and
98
+
99
+      (c) You must retain, in the Source form of any Derivative Works
100
+          that You distribute, all copyright, patent, trademark, and
101
+          attribution notices from the Source form of the Work,
102
+          excluding those notices that do not pertain to any part of
103
+          the Derivative Works; and
104
+
105
+      (d) If the Work includes a "NOTICE" text file as part of its
106
+          distribution, then any Derivative Works that You distribute must
107
+          include a readable copy of the attribution notices contained
108
+          within such NOTICE file, excluding those notices that do not
109
+          pertain to any part of the Derivative Works, in at least one
110
+          of the following places: within a NOTICE text file distributed
111
+          as part of the Derivative Works; within the Source form or
112
+          documentation, if provided along with the Derivative Works; or,
113
+          within a display generated by the Derivative Works, if and
114
+          wherever such third-party notices normally appear. The contents
115
+          of the NOTICE file are for informational purposes only and
116
+          do not modify the License. You may add Your own attribution
117
+          notices within Derivative Works that You distribute, alongside
118
+          or as an addendum to the NOTICE text from the Work, provided
119
+          that such additional attribution notices cannot be construed
120
+          as modifying the License.
121
+
122
+      You may add Your own copyright statement to Your modifications and
123
+      may provide additional or different license terms and conditions
124
+      for use, reproduction, or distribution of Your modifications, or
125
+      for any such Derivative Works as a whole, provided Your use,
126
+      reproduction, and distribution of the Work otherwise complies with
127
+      the conditions stated in this License.
128
+
129
+   5. Submission of Contributions. Unless You explicitly state otherwise,
130
+      any Contribution intentionally submitted for inclusion in the Work
131
+      by You to the Licensor shall be under the terms and conditions of
132
+      this License, without any additional terms or conditions.
133
+      Notwithstanding the above, nothing herein shall supersede or modify
134
+      the terms of any separate license agreement you may have executed
135
+      with Licensor regarding such Contributions.
136
+
137
+   6. Trademarks. This License does not grant permission to use the trade
138
+      names, trademarks, service marks, or product names of the Licensor,
139
+      except as required for reasonable and customary use in describing the
140
+      origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+   7. Disclaimer of Warranty. Unless required by applicable law or
143
+      agreed to in writing, Licensor provides the Work (and each
144
+      Contributor provides its Contributions) on an "AS IS" BASIS,
145
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+      implied, including, without limitation, any warranties or conditions
147
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+      PARTICULAR PURPOSE. You are solely responsible for determining the
149
+      appropriateness of using or redistributing the Work and assume any
150
+      risks associated with Your exercise of permissions under this License.
151
+
152
+   8. Limitation of Liability. In no event and under no legal theory,
153
+      whether in tort (including negligence), contract, or otherwise,
154
+      unless required by applicable law (such as deliberate and grossly
155
+      negligent acts) or agreed to in writing, shall any Contributor be
156
+      liable to You for damages, including any direct, indirect, special,
157
+      incidental, or consequential damages of any character arising as a
158
+      result of this License or out of the use or inability to use the
159
+      Work (including but not limited to damages for loss of goodwill,
160
+      work stoppage, computer failure or malfunction, or any and all
161
+      other commercial damages or losses), even if such Contributor
162
+      has been advised of the possibility of such damages.
163
+
164
+   9. Accepting Warranty or Additional Liability. While redistributing
165
+      the Work or Derivative Works thereof, You may choose to offer,
166
+      and charge a fee for, acceptance of support, warranty, indemnity,
167
+      or other liability obligations and/or rights consistent with this
168
+      License. However, in accepting such obligations, You may act only
169
+      on Your own behalf and on Your sole responsibility, not on behalf
170
+      of any other Contributor, and only if You agree to indemnify,
171
+      defend, and hold each Contributor harmless for any liability
172
+      incurred by, or claims asserted against, such Contributor by reason
173
+      of your accepting any such warranty or additional liability.
174
+
175
+   END OF TERMS AND CONDITIONS
176
+
177
+   APPENDIX: How to apply the Apache License to your work.
178
+
179
+      To apply the Apache License to your work, attach the following
180
+      boilerplate notice, with the fields enclosed by brackets "{}"
181
+      replaced with your own identifying information. (Don't include
182
+      the brackets!)  The text should be enclosed in the appropriate
183
+      comment syntax for the file format. We also recommend that a
184
+      file or class name and description of purpose be included on the
185
+      same "printed page" as the copyright notice for easier
186
+      identification within third-party archives.
187
+
188
+   Copyright {yyyy} {name of copyright owner}
189
+
190
+   Licensed under the Apache License, Version 2.0 (the "License");
191
+   you may not use this file except in compliance with the License.
192
+   You may obtain a copy of the License at
193
+
194
+       http://www.apache.org/licenses/LICENSE-2.0
195
+
196
+   Unless required by applicable law or agreed to in writing, software
197
+   distributed under the License is distributed on an "AS IS" BASIS,
198
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
199
+   See the License for the specific language governing permissions and
200
+   limitations under the License.
0 201
\ No newline at end of file
1 202
new file mode 100644
... ...
@@ -0,0 +1,110 @@
0
+GitBook Plugin: Edit Link
1
+======================================
2
+
3
+This GitBook Plugin adds "Edit This Page" link on every page.
4
+
5
+Link target will be that page's source file on Github or Gitlab or any repo.
6
+
7
+## Screenshot
8
+
9
+![gitbook-plugin-edit-link](https://cloud.githubusercontent.com/assets/4115/5695161/f5b79002-99b8-11e4-821a-d2af6c729348.png)
10
+
11
+## Usage
12
+
13
+### Step #1 - Update `book.json` file
14
+
15
+1. In you gitbook's `book.json` file, add `edit-link` to `plugins` list.
16
+2. In `pluginsConfig`, Set `base` value which is base path to your github or gitlab or other code repo. Trailing slash is NOT required.
17
+3. By default link label will be "Edit This Page". You can change it using plugin config `label`.
18
+
19
+#### Sample `book.json` file for gitbook version 2.0.1 and above
20
+
21
+```
22
+{
23
+    "gitbook": "2.0.1",
24
+    "plugins": ["edit-link"],
25
+    "pluginsConfig": {
26
+            "edit-link": {
27
+                "base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
28
+                "label": "Edit This Page"
29
+            }
30
+    }
31
+}
32
+```
33
+
34
+#### Sample `book.json` file for gitbook version 2.0.1+ and multilingual labels
35
+
36
+```
37
+{
38
+    "gitbook": "2.0.1",
39
+    "plugins": ["edit-link"],
40
+    "pluginsConfig": {
41
+            "edit-link": {
42
+                "base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
43
+                "label": {
44
+                    "en": "Edit This Page",
45
+                    "de": "Seite bearbeiten"
46
+                }
47
+            }
48
+    }
49
+}
50
+```
51
+
52
+#### Sample `book.json` file for older gitbook versions <= 1.5.0
53
+
54
+```
55
+{
56
+    "gitbook": "1.5.0",
57
+    "plugins": ["edit-link@1.1.0"],
58
+    "pluginsConfig": {
59
+            "edit-link": {
60
+                "base": "https://github.com/USER/REPO/edit/BRANCH/path/to/book",
61
+                "label": "Edit This Page"
62
+            }
63
+    }
64
+}
65
+```
66
+
67
+**Note**: Above snippet can be used as complete `book.json` file, if your book doesn't have one yet.
68
+
69
+**Github/Gitlab**: In string `...REPO/edit/BRANCH...`, you may replace `edit` with `tree` if you want source file to open in read-mode, rather than edit-mode directly on github/gitlab.
70
+
71
+### Step #2 - gitbook commands
72
+
73
+1. Run `gitbook install`. It will automatically install `edit-link` gitbook plugin for your book. This is needed only once.
74
+2. Build your book (`gitbook build`) or serve (`gitbook serve`) as usual.
75
+
76
+## Troubleshooting
77
+
78
+1. If you are not seeing the "Edit this page" link, check if your `book.json` is valid. You can use this online tool - [http://json.parser.online.fr/beta/](http://json.parser.online.fr/beta/)
79
+2. Check if you are using default gitbook theme. It is NOT recommended to modify gitbook themes directly.
80
+
81
+## Known Issue
82
+
83
+Gitbook 2.0.1 has removed `page:after` hook which this plugin needs. An issue has been reported here - https://github.com/GitbookIO/gitbook/issues/724 but meanwhile this plugin is using workaround added by this pull request - https://github.com/rtCamp/gitbook-plugin-edit-link/pull/4
84
+
85
+So when using Gitbook 2.0.1, you may see following warning in console at the time of running build:
86
+
87
+> warn: hook 'page' used by plugin 'gitbook-plugin-edit-link' is deprecated, and will be remove in the coming versions
88
+
89
+You can safely ignore above warning for now.
90
+
91
+## How this work?
92
+
93
+This plugin simply looks for HTML comment `<!-- Actions Right -->` in parsed page content and insert "edit link" HTML just before `<!-- Actions Right -->`.
94
+
95
+This means if that HTML comment changes, this plugin will break but I hope to fix it easily whenever that happen.
96
+
97
+## Changelog
98
+
99
+**1.3 - 28 April 2015**
100
+
101
+- Gitbook 2.0.1 compatibility added by [@todvora](https://github.com/rtCamp/gitbook-plugin-edit-link/pull/4). Please see known-issues for more details.
102
+
103
+**1.2 - 03 April 2015**
104
+
105
+- Multiligual gitbook support added by [@aniav](https://github.com/aniav) ([#2](https://github.com/rtCamp/gitbook-plugin-edit-link/pull/2))
106
+
107
+**1.1.3 - 11 Jan 2015**
108
+
109
+- Initial release
0 110
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+require(["gitbook", "jQuery"], function(gitbook, $) {
1
+    gitbook.events.bind('start', function (e, config) {
2
+        var conf = config['edit-link'];
3
+        var label = conf.label;
4
+        var base = conf.base;
5
+        var lang = gitbook.state.innerLanguage;
6
+        if (lang) {
7
+            // label can be a unique string for multi-languages site
8
+            if (typeof label === 'object') label = label[lang];
9
+
10
+            lang = lang + '/';
11
+        }
12
+
13
+        // Add slash at the end if not present
14
+        if (base.slice(-1) != "/") {
15
+            base = base + "/";
16
+        }
17
+
18
+        gitbook.toolbar.createButton({
19
+            icon: 'fa fa-edit',
20
+            text: label,
21
+            onClick: function() {
22
+                var filepath = gitbook.state.filepath;
23
+
24
+                window.open(base + lang + filepath);
25
+            }
26
+        });
27
+    });
28
+
29
+});
0 30
\ No newline at end of file
1 31
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+var path = require('path');
1
+
2
+module.exports = {
3
+    book: {
4
+        assets: "./book",
5
+        js: ["plugin.js"]
6
+    }
7
+};
0 8
new file mode 100644
... ...
@@ -0,0 +1,121 @@
0
+{
1
+  "_args": [
2
+    [
3
+      {
4
+        "name": "gitbook-plugin-edit-link",
5
+        "raw": "gitbook-plugin-edit-link@2.0.2",
6
+        "rawSpec": "2.0.2",
7
+        "scope": null,
8
+        "spec": "2.0.2",
9
+        "type": "version"
10
+      },
11
+      "C:\\Users\\vasudevanv\\Documents\\photon\\docs"
12
+    ]
13
+  ],
14
+  "_from": "gitbook-plugin-edit-link@2.0.2",
15
+  "_id": "gitbook-plugin-edit-link@2.0.2",
16
+  "_inCache": true,
17
+  "_installable": true,
18
+  "_location": "/gitbook-plugin-edit-link",
19
+  "_nodeVersion": "5.1.0",
20
+  "_npmUser": {
21
+    "email": "samypesse@gmail.com",
22
+    "name": "samypesse"
23
+  },
24
+  "_npmVersion": "3.3.12",
25
+  "_phantomChildren": {},
26
+  "_requested": {
27
+    "name": "gitbook-plugin-edit-link",
28
+    "raw": "gitbook-plugin-edit-link@2.0.2",
29
+    "rawSpec": "2.0.2",
30
+    "scope": null,
31
+    "spec": "2.0.2",
32
+    "type": "version"
33
+  },
34
+  "_requiredBy": [
35
+    "#USER"
36
+  ],
37
+  "_resolved": "https://registry.npmjs.org/gitbook-plugin-edit-link/-/gitbook-plugin-edit-link-2.0.2.tgz",
38
+  "_shasum": "d8fcd927eced81e7a662a72d59db609eafd7e72f",
39
+  "_shrinkwrap": null,
40
+  "_spec": "gitbook-plugin-edit-link@2.0.2",
41
+  "_where": "C:\\Users\\vasudevanv\\Documents\\photon\\docs",
42
+  "author": {
43
+    "email": "admin@rtcamp.com",
44
+    "name": "rtCamp"
45
+  },
46
+  "bugs": {
47
+    "url": "https://github.com/rtCamp/gitbook-plugin-edit-link/issues"
48
+  },
49
+  "contributors": [
50
+    {
51
+      "email": "rahul.bansal@rtcamp.com",
52
+      "name": "Rahul Bansal"
53
+    },
54
+    {
55
+      "email": "samy@gitbook.com",
56
+      "name": "Samy Pessé"
57
+    }
58
+  ],
59
+  "dependencies": {},
60
+  "description": "GitBook Plugin to add \"Edit this page\" link on every page. Link target will be that page's source file on Github or Gitlab or any repo.",
61
+  "devDependencies": {},
62
+  "directories": {},
63
+  "dist": {
64
+    "shasum": "d8fcd927eced81e7a662a72d59db609eafd7e72f",
65
+    "tarball": "https://registry.npmjs.org/gitbook-plugin-edit-link/-/gitbook-plugin-edit-link-2.0.2.tgz"
66
+  },
67
+  "engines": {
68
+    "gitbook": ">=2.5.0"
69
+  },
70
+  "gitHead": "51a5d22a76f46dd41a057837c6ef4c0f09ec9cbb",
71
+  "gitbook": {
72
+    "properties": {
73
+      "base": {
74
+        "required": true,
75
+        "title": "Base for the edit redirection",
76
+        "type": "string"
77
+      },
78
+      "label": {
79
+        "default": "Edit This Page",
80
+        "title": "Label for the edit button",
81
+        "type": [
82
+          "string",
83
+          "object"
84
+        ]
85
+      }
86
+    }
87
+  },
88
+  "homepage": "https://github.com/rtCamp/gitbook-plugin-edit-link",
89
+  "keywords": [
90
+    "gitbook",
91
+    "plugin",
92
+    "edit-with",
93
+    "github"
94
+  ],
95
+  "license": "Apache-2.0",
96
+  "main": "index.js",
97
+  "maintainers": [
98
+    {
99
+      "email": "rahul.bansal@rtcamp.com",
100
+      "name": "rahul286"
101
+    },
102
+    {
103
+      "email": "admin@rtcamp.com",
104
+      "name": "rtcamp"
105
+    },
106
+    {
107
+      "email": "samypesse@gmail.com",
108
+      "name": "samypesse"
109
+    }
110
+  ],
111
+  "name": "gitbook-plugin-edit-link",
112
+  "optionalDependencies": {},
113
+  "readme": "ERROR: No README data found!",
114
+  "repository": {
115
+    "type": "git",
116
+    "url": "git+https://github.com/rtCamp/gitbook-plugin-edit-link.git"
117
+  },
118
+  "scripts": {},
119
+  "version": "2.0.2"
120
+}
0 121
new file mode 100644
... ...
@@ -0,0 +1,24 @@
0
+This is free and unencumbered software released into the public domain.
1
+
2
+Anyone is free to copy, modify, publish, use, compile, sell, or
3
+distribute this software, either in source code form or as a compiled
4
+binary, for any purpose, commercial or non-commercial, and by any
5
+means.
6
+
7
+In jurisdictions that recognize copyright laws, the author or authors
8
+of this software dedicate any and all copyright interest in the
9
+software to the public domain. We make this dedication for the benefit
10
+of the public at large and to the detriment of our heirs and
11
+successors. We intend this dedication to be an overt act of
12
+relinquishment in perpetuity of all present and future rights to this
13
+software under copyright law.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21
+OTHER DEALINGS IN THE SOFTWARE.
22
+
23
+For more information, please refer to <https://unlicense.org>
0 24
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+GitBook plugin: Insert logo
1
+===========================
2
+
3
+NPM package [here](https://www.npmjs.com/package/gitbook-plugin-insert-logo)
4
+
5
+```
6
+npm i gitbook-plugin-insert-logo
7
+```
8
+
9
+The following plugin inserts a logo into the navigation bar (above the summary and above the search input). Simply, drop a `logo.png` file into the root folder of your GitBook and add this plugin into your `book.json`:
10
+
11
+```json
12
+{
13
+    "plugins": ["insert-logo", "another plugin 1", "another plugin 2"]
14
+}
15
+```
16
+
17
+You will also need to provide url for the logo. The url can be local file, a remote URL, or base64 hash. Add the url into the plugin configuration in your `book.json`:
18
+
19
+```json
20
+{
21
+    "plugins": ["insert-logo", "another plugin 1", "another plugin 2"],
22
+    "pluginsConfig": {
23
+        "insert-logo": {
24
+            "url": "http://www.example.com/my-logo.png"
25
+            "style": "background: none;"
26
+        }
27
+    }
28
+}
29
+```
0 30
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+module.exports = {
1
+    book: {
2
+        assets: './lib',
3
+        js: [
4
+            'plugin.js'
5
+        ],
6
+        css: [
7
+            'plugin.css'
8
+        ]
9
+    }
10
+
11
+};
0 12
\ No newline at end of file
1 13
new file mode 100644
... ...
@@ -0,0 +1,4 @@
0
+.book .book-summary .book-logo {
1
+    text-align: center;
2
+    padding: 20px;
3
+}
0 4
\ No newline at end of file
1 5
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+require(['gitbook', 'jQuery'], function (gitbook, $) {
1
+  var url = ''
2
+  var style = ''
3
+  var insertLogo = function (url, style) {
4
+    $('.book-summary').children().eq(0).before('<div class="book-logo"><img src="' + url + '" style="' + style + '"></div>')
5
+  }
6
+  gitbook.events.bind('start', function (e, config) {
7
+    url = config['insert-logo']['url']
8
+    style = config['insert-logo']['style']
9
+  })
10
+
11
+  gitbook.events.bind("page.change", function() {
12
+    insertLogo(url, style)
13
+  })
14
+})
0 15
new file mode 100644
... ...
@@ -0,0 +1,106 @@
0
+{
1
+  "_args": [
2
+    [
3
+      {
4
+        "name": "gitbook-plugin-insert-logo",
5
+        "raw": "gitbook-plugin-insert-logo@0.1.5",
6
+        "rawSpec": "0.1.5",
7
+        "scope": null,
8
+        "spec": "0.1.5",
9
+        "type": "version"
10
+      },
11
+      "C:\\Users\\vasudevanv\\Documents\\photon\\docs"
12
+    ]
13
+  ],
14
+  "_from": "gitbook-plugin-insert-logo@0.1.5",
15
+  "_id": "gitbook-plugin-insert-logo@0.1.5",
16
+  "_inCache": true,
17
+  "_installable": true,
18
+  "_location": "/gitbook-plugin-insert-logo",
19
+  "_nodeVersion": "6.11.4",
20
+  "_npmOperationalInternal": {
21
+    "host": "s3://npm-registry-packages",
22
+    "tmp": "tmp/gitbook-plugin-insert-logo_0.1.5_1521716276866_0.7489566873105806"
23
+  },
24
+  "_npmUser": {
25
+    "email": "matusnov@gmail.com",
26
+    "name": "matusnov"
27
+  },
28
+  "_npmVersion": "3.5.2",
29
+  "_phantomChildren": {},
30
+  "_requested": {
31
+    "name": "gitbook-plugin-insert-logo",
32
+    "raw": "gitbook-plugin-insert-logo@0.1.5",
33
+    "rawSpec": "0.1.5",
34
+    "scope": null,
35
+    "spec": "0.1.5",
36
+    "type": "version"
37
+  },
38
+  "_requiredBy": [
39
+    "#USER"
40
+  ],
41
+  "_resolved": "https://registry.npmjs.org/gitbook-plugin-insert-logo/-/gitbook-plugin-insert-logo-0.1.5.tgz",
42
+  "_shasum": "daae8dda41a236d54f13931e570b26729557885a",
43
+  "_shrinkwrap": null,
44
+  "_spec": "gitbook-plugin-insert-logo@0.1.5",
45
+  "_where": "C:\\Users\\vasudevanv\\Documents\\photon\\docs",
46
+  "author": {
47
+    "email": "matusnov@gmail.com",
48
+    "name": "matusnovak"
49
+  },
50
+  "bugs": {
51
+    "url": "https://github.com/matusnovak/gitbook-plugin-insert-logo/issues"
52
+  },
53
+  "dependencies": {},
54
+  "description": "GitBook Plugin to insert (url or file or base64) into the navigation above search input.",
55
+  "devDependencies": {},
56
+  "directories": {},
57
+  "dist": {
58
+    "fileCount": 6,
59
+    "shasum": "daae8dda41a236d54f13931e570b26729557885a",
60
+    "tarball": "https://registry.npmjs.org/gitbook-plugin-insert-logo/-/gitbook-plugin-insert-logo-0.1.5.tgz",
61
+    "unpackedSize": 3785
62
+  },
63
+  "engines": {
64
+    "gitbook": ">1.x.x"
65
+  },
66
+  "gitHead": "fba26154a69508a0a84898423749f7dbea433485",
67
+  "gitbook": {
68
+    "properties": {
69
+      "style": {
70
+        "default": "background: none;",
71
+        "title": "Custom CSS",
72
+        "type": "string"
73
+      },
74
+      "url": {
75
+        "default": "http://www.example.com/my-logo.png",
76
+        "title": "Logo URL",
77
+        "type": "string"
78
+      }
79
+    }
80
+  },
81
+  "homepage": "https://github.com/matusnovak/gitbook-plugin-insert-logo#readme",
82
+  "keywords": [
83
+    "gitbook",
84
+    "plugin",
85
+    "insert-logo",
86
+    "logo",
87
+    "github"
88
+  ],
89
+  "main": "index.js",
90
+  "maintainers": [
91
+    {
92
+      "email": "matusnov@gmail.com",
93
+      "name": "matusnov"
94
+    }
95
+  ],
96
+  "name": "gitbook-plugin-insert-logo",
97
+  "optionalDependencies": {},
98
+  "readme": "ERROR: No README data found!",
99
+  "repository": {
100
+    "type": "git",
101
+    "url": "git+https://github.com/matusnovak/gitbook-plugin-insert-logo.git"
102
+  },
103
+  "scripts": {},
104
+  "version": "0.1.5"
105
+}
0 106
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+.DS_Store
1
+*.log
0 2
\ No newline at end of file
1 3
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+# Gitbook plugin Noembed
1
+
2
+Get any video or iframe card supported by [Noembed](https://noembed.com/#supported-sites). (Vimeo, YouTube, Facebook, Twitter, Instagram, etc)
3
+
4
+*If the sites you need to embed are not supported by Noembed, you can try [gitbook-plugin-iframely](https://github.com/1cgonza/gitbook-plugin-iframely). They claim to support 1,800+ sites but you need at least a free account to get an API key.*
5
+
6
+## Installation
7
+Add "noembed" to your plugins in `book.json`.
8
+
9
+```js
10
+{
11
+  "plugins": ["noembed"]
12
+}
13
+```
14
+
15
+## Usage
16
+- You can use two filters: `noembed` or `video`. *(At the moment they both do exactly the same)*
17
+- Make sure you wrap your URL around single or double quotes.
18
+
19
+```md
20
+{{ 'https://vimeo.com/31942602' | noembed }}
21
+
22
+or
23
+
24
+{{ 'https://vimeo.com/31942602' | video }}
25
+```
26
+
0 27
new file mode 100644
... ...
@@ -0,0 +1,93 @@
0
+function renderNoembed(event) {
1
+  var iframes         = document.querySelectorAll('.noembed-wrapper');
2
+  var loaded          = 0;
3
+  var total           = iframes.length;
4
+  var externalScripts = [];
5
+
6
+  function calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) {
7
+    var ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight);
8
+
9
+    return {width: (srcWidth * ratio) | 0, height: (srcHeight * ratio) | 0};
10
+  }
11
+
12
+  function ajaxReq(url, callback) {
13
+    var req = new XMLHttpRequest();
14
+    req.onreadystatechange = function() {
15
+      if (req.readyState === XMLHttpRequest.DONE) {
16
+        if (req.status === 200) {
17
+          callback(JSON.parse(req.responseText));
18
+        }
19
+      }
20
+    };
21
+
22
+    req.open('GET', url, true);
23
+    req.send();
24
+    return req;
25
+  }
26
+
27
+  function checkForScripts(html) {
28
+    var tempElement = document.createElement('div');
29
+    tempElement.innerHTML = html;
30
+
31
+    var scripts = tempElement.querySelectorAll('script');
32
+
33
+    if (scripts.length) {
34
+      for (var i = 0; i < scripts.length; i++) {
35
+        if (externalScripts.indexOf(scripts[i].src) < 0) {
36
+          externalScripts.push(scripts[i].src);
37
+          scripts[i].parentElement.removeChild(scripts[i]);
38
+        }
39
+      }
40
+    }
41
+
42
+    return tempElement;
43
+  }
44
+
45
+  function getVideoData(url, wrapper) {
46
+    if (!!url.length) {
47
+      ajaxReq(url, function(res) {
48
+        var safeHtml = '';
49
+
50
+        if (res.html) {
51
+          safeHtml = checkForScripts(res.html);
52
+
53
+          if (res.type === 'video' && res.hasOwnProperty('width') && res.hasOwnProperty('height')) {
54
+            var dims = calculateAspectRatioFit(res.width, res.height, wrapper.clientWidth, 9999);
55
+            wrapper.classList.add('noembed-type-video');
56
+            wrapper.style.width = dims.width + 'px';
57
+            wrapper.style.height = dims.height + 'px';
58
+          }
59
+
60
+        } else {
61
+          safeHtml = document.createElement('a');
62
+          safeHtml.href = res.url;
63
+          safeHtml.innerText = res.url;
64
+        }
65
+
66
+        wrapper.innerHTML = '';
67
+        wrapper.appendChild(safeHtml);
68
+
69
+        loaded++;
70
+
71
+        if (loaded === total) {
72
+          externalScripts.forEach(function(script) {
73
+            var newScript = document.createElement('script');
74
+            newScript.src = script;
75
+            document.body.appendChild(newScript);
76
+          });
77
+        }
78
+      });
79
+    }
80
+  }
81
+
82
+  for (var i = 0; i < iframes.length; i++) {
83
+    var wrapper = iframes[i];
84
+    var url     = wrapper.dataset.url;
85
+
86
+    getVideoData(url, wrapper);
87
+  }
88
+}
89
+
90
+require(['gitbook'], function(gitbook) {
91
+  gitbook.events.on('page.change', renderNoembed);
92
+});
0 93
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+.noembed-wrapper {
1
+  position: relative;
2
+  margin: 1em 0;
3
+}
4
+
5
+.noembed-type-video iframe {
6
+  width: 100%;
7
+  height: 100%;
8
+  position: absolute;
9
+}
0 10
\ No newline at end of file
1 11
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+function noembed(url) {
1
+  var endpoint = '//noembed.com/embed?';
2
+
3
+  if (!!url.length) {
4
+    endpoint += 'url=' + encodeURIComponent(url);
5
+    return '<div class="noembed-wrapper" data-url="' + endpoint + '">' + url + '</div>';
6
+  }
7
+
8
+  return url;
9
+}
10
+
11
+module.exports = {
12
+  website: {
13
+    assets: './assets',
14
+    js: ['scripts.js'],
15
+    css: ['style.css']
16
+  },
17
+  filters: {
18
+    noembed: noembed,
19
+    video: noembed,
20
+  }
21
+};
0 22
new file mode 100644
... ...
@@ -0,0 +1,97 @@
0
+{
1
+  "_args": [
2
+    [
3
+      {
4
+        "name": "gitbook-plugin-noembed",
5
+        "raw": "gitbook-plugin-noembed@0.1.0",
6
+        "rawSpec": "0.1.0",
7
+        "scope": null,
8
+        "spec": "0.1.0",
9
+        "type": "version"
10
+      },
11
+      "C:\\Users\\vasudevanv\\Documents\\photon\\docs"
12
+    ]
13
+  ],
14
+  "_from": "gitbook-plugin-noembed@0.1.0",
15
+  "_id": "gitbook-plugin-noembed@0.1.0",
16
+  "_inCache": true,
17
+  "_installable": true,
18
+  "_location": "/gitbook-plugin-noembed",
19
+  "_nodeVersion": "7.4.0",
20
+  "_npmOperationalInternal": {
21
+    "host": "packages-18-east.internal.npmjs.com",
22
+    "tmp": "tmp/gitbook-plugin-noembed-0.1.0.tgz_1485114395790_0.36705310526303947"
23
+  },
24
+  "_npmUser": {
25
+    "email": "info@juancgonzalez.com",
26
+    "name": "juancgonza"
27
+  },
28
+  "_npmVersion": "4.1.1",
29
+  "_phantomChildren": {},
30
+  "_requested": {
31
+    "name": "gitbook-plugin-noembed",
32
+    "raw": "gitbook-plugin-noembed@0.1.0",
33
+    "rawSpec": "0.1.0",
34
+    "scope": null,
35
+    "spec": "0.1.0",
36
+    "type": "version"
37
+  },
38
+  "_requiredBy": [
39
+    "#USER"
40
+  ],
41
+  "_resolved": "https://registry.npmjs.org/gitbook-plugin-noembed/-/gitbook-plugin-noembed-0.1.0.tgz",
42
+  "_shasum": "e0953fc194a42702404e9ca2e865b5f3ee0d6b23",
43
+  "_shrinkwrap": null,
44
+  "_spec": "gitbook-plugin-noembed@0.1.0",
45
+  "_where": "C:\\Users\\vasudevanv\\Documents\\photon\\docs",
46
+  "author": {
47
+    "email": "info@juancgonzalez.com",
48
+    "name": "Juan Camilo Gonzalez",
49
+    "url": "http://juancgonzalez.com"
50
+  },
51
+  "bugs": {
52
+    "url": "https://github.com/1cgonza/gitbook-plugin-noembed/issues"
53
+  },
54
+  "dependencies": {},
55
+  "description": "Get any video or iframe card supported by https://noembed.com/#supported-sites. (Vimeo, YouTube, Facebook, Twitter, Instagram, etc)",
56
+  "devDependencies": {},
57
+  "directories": {},
58
+  "dist": {
59
+    "shasum": "e0953fc194a42702404e9ca2e865b5f3ee0d6b23",
60
+    "tarball": "https://registry.npmjs.org/gitbook-plugin-noembed/-/gitbook-plugin-noembed-0.1.0.tgz"
61
+  },
62
+  "engines": {
63
+    "gitbook": ">2.0.0"
64
+  },
65
+  "gitHead": "66c29b5aa6bc6981ed68d3afd3385fc32e5af0fe",
66
+  "homepage": "https://github.com/1cgonza/gitbook-plugin-noembed#readme",
67
+  "keywords": [
68
+    "gitbook",
69
+    "gitbook-plugin",
70
+    "videos",
71
+    "oembed",
72
+    "iframe",
73
+    "noembed",
74
+    "vimeo",
75
+    "youtube",
76
+    "instagram",
77
+    "facebook"
78
+  ],
79
+  "license": "Apache-2.0",
80
+  "main": "index.js",
81
+  "maintainers": [
82
+    {
83
+      "email": "info@juancgonzalez.com",
84
+      "name": "juancgonza"
85
+    }
86
+  ],
87
+  "name": "gitbook-plugin-noembed",
88
+  "optionalDependencies": {},
89
+  "readme": "ERROR: No README data found!",
90
+  "repository": {
91
+    "type": "git",
92
+    "url": "git+https://github.com/1cgonza/gitbook-plugin-noembed.git"
93
+  },
94
+  "scripts": {},
95
+  "version": "0.1.0"
96
+}
... ...
@@ -7,8 +7,8 @@
7 7
         Version](#looking-at-the-differences-between-the-minimal-and-the-full-version)
8 8
     -   [The Root Account and the `sudo` and `su`
9 9
         Commands](#the-root-account-and-the-sudo-and-su-commands)
10
--   [Getting Start for Photon OS 2.0](#getting-started-with-photon-os)
11
--   [Quick Start for Photon OS 1.0](#quick-start-for-photon-os)
10
+-   [Getting Started with Photon OS 2.0](#getting-started-with-photon-os-20)
11
+-   [Quick Start for Photon OS 1.0](#quick-start-for-photon-os-10)
12 12
     -   [Obtaining the ISO from Bintray and Creating a Photon OS VM
13 13
         in VMware
14 14
         Workstation](#obtaining-the-iso-from-bintray-and-creating-a-photon-os-vm-in-vmware-workstation)
... ...
@@ -51,6 +51,8 @@
51 51
         systemd](#migrating-scripts-to-systemd)
52 52
 -   [Managing the Network
53 53
     Configuration](#managing-the-network-configuration)
54
+    -   [Using the Photon Management Daemon](#using-the-photon-management-daemon)
55
+    -   [Using the Network Configuration Manager](#using-the-network-configuration-manager)
54 56
     -   [Use `ip` and `ss` Commands Instead of `ifconfig` and
55 57
         `netstat`](#use-ip-and-ss-commands-instead-of-ifconfig-and-netstat)
56 58
     -   [Configuring Network
... ...
@@ -83,7 +85,6 @@
83 83
         GCE](#running-a-photon-os-machine-on-gce)
84 84
 -   [Docker Containers](#docker-containers)
85 85
 -   [Kubernetes](#kubernetes)
86
--   [RPM-OSTree](#rpm-ostree)
87 86
 -   [Installing Sendmail](#installing-sendmail)
88 87
     -   [Fixing Sendmail If Installed Before an FQDN Was
89 88
         Set](#fixing-sendmail-if-installed-before-an-fqdn-was-set)
... ...
@@ -113,7 +114,7 @@ This guide describes the fundamentals of administering Photon OS, the open-sourc
113 113
 
114 114
 The guide covers the basics of managing packages, controlling services with systemd, setting up networking, initializing Photon OS with cloud-init, running Docker containers, and working with other technologies, such as Kubernetes. The guide also includes a section to get you started using Photon OS quickly and easily. 
115 115
 
116
-Photon OS is a Linux container host optimized for vSphere and cloud-computing platforms such as Amazon Elastic Compute and Google Compute Engine. As a lightweight and extensible operating system, Photon OS works with the most common container formats, including Docker, Rocket, and Garden. Photon OS includes a yum-compatible, package-based lifecycle management system called tdnf. Photon OS optionally works with RPM-OSTree for image-based system versioning.
116
+Photon OS is a Linux container host optimized for vSphere and cloud-computing platforms such as Amazon Elastic Compute and Google Compute Engine. As a lightweight and extensible operating system, Photon OS works with the most common container formats, including Docker, Rocket, and Garden. Photon OS includes a yum-compatible, package-based lifecycle management system called tdnf.
117 117
 
118 118
 When used with development tools and environments such as VMware Fusion, VMware Workstation, HashiCorp (Vagrant and Atlas), and production runtime environments (vSphere, vCloud Air), Photon OS lets you seamlessly migrate container-based applications from development to production. With a small footprint and fast boot and run times, Photon OS is optimized for cloud computing and cloud  applications.  
119 119
 
... ...
@@ -188,25 +189,29 @@ One notable difference between the two versions of Photon OS pertains to OpenJDK
188 188
 	openjre 	x86_64    1.8.0.92-1.ph1    95.09 M
189 189
 	openjdk 	x86_64    1.8.0.92-1.ph1    37.63 M
190 190
 
191
+**NOTE:** openjdk and openjre are available as openjdk8 and openjre8 in Photon OS 2.0
192
+
191 193
 A later section covers tdnf. 
192 194
 
193 195
 ### The Root Account and the `sudo` and `su` Commands
194 196
 
195 197
 This guide assumes that you are logged in to Photon OS with the root account and running commands as root. The sudo program comes with the full version of Photon OS. On the minimal version, you must install sudo with tdnf if you want to use it. As an alternative to installing sudo on the minimal version, you can switch users as needed with the `su` command to run commands that require root privileges. 
196 198
 
197
-## Getting Started with Photon OS
199
+## Getting Started with Photon OS 2.0
198 200
 
199 201
 **NOTE:** This section applies to Photon OS w.0 only.
200 202
 
201 203
 To get started with Photon OS 2.0, refer to the installation instructions for your target environment:
202
-- [Running Photon OS on VMware vSphere](#https://github.com/vmware/photon/wiki/Running-Photon-OS-on-vSphere)
203
-- [Running Photon OS on VMware Fusion](#https://github.com/vmware/photon/wiki/Running-Project-Photon-on-Fusion)
204
-- [Running Photon OS on VMware Workstation](#https://github.com/vmware/photon/wiki/Running-Photon-OS-on-vSphere)
205
-- [Running Photon OS on Amazon EC2](#https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute)
206
-- [Running Photon OS on Google Compute Engine](#https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Google-Compute-Engine)
207
-- [Running Photon OS on Microsoft Azure](#https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Microsoft-Azure)
204
+- [Running Photon OS on VMware vSphere](Running-Photon-OS-on-vSphere.md)
205
+- [Running Photon OS on VMware Fusion](Running-Project-Photon-on-Fusion.md)
206
+- [Running Photon OS on VMware Workstation](Running-Photon-OS-on-Workstation.md)
207
+- [Running Photon OS on Amazon EC2](Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute.md)
208
+- [Running Photon OS on Google Compute Engine](Running-Photon-OS-on-Google-Compute-Engine.md)
209
+- [Running Photon OS on Microsoft Azure](Running-Photon-OS-on-Microsoft-Azure.md)
210
+
211
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](Upgrading-to-Photon-OS-2.0.md). 
208 212
 
209
-## Quick Start for Photon OS
213
+## Quick Start for Photon OS 1.0
210 214
 
211 215
 **NOTE:** This section applies to Photon OS 1.0 only.
212 216
 
... ...
@@ -220,7 +225,7 @@ This section helps you get Photon OS up and running quickly and easily. There ar
220 220
 
221 221
 The full version of Photon OS installs from an ISO in VMware Workstation and other hypervisors in a matter of minutes. Photon OS is a free download from the Bintray web site.
222 222
 
223
-This section demonstrates how to create a virtual machine running Photon OS in VMware Workstation 12 Pro. If you are using a different hypervisor, the example set by this section should help you install it in your system. For instructions on how to install Photon OS from an ISO in VMware vSphere, see [Installing Photon OS on VMware vSphere from an ISO Image](https://github.com/vmware/photon/wiki/Running-Project-Photon-on-vSphere).
223
+This section demonstrates how to create a virtual machine running Photon OS in VMware Workstation 12 Pro. If you are using a different hypervisor, the example set by this section should help you install it in your system. For instructions on how to install Photon OS from an ISO in VMware vSphere, see [Installing Photon OS on VMware vSphere from an ISO Image](Running-Project-Photon-on-vSphere.md).
224 224
 
225 225
 1. Go to the following Bintray URL and download the ISO for the general availability release of Photon OS:
226 226
 
... ...
@@ -252,7 +257,7 @@ The installation typically completes in about 150 seconds for the full version a
252 252
 
253 253
 To connect to Photon OS by SSH, see the section on permitting root login with SSH below.  
254 254
 
255
-You can also build an ISO containing Photon OS from its source code on GitHub by following the instructions in the document on [building Photon OS](https://github.com/vmware/photon/blob/master/docs/build-photon.md). 
255
+You can also build an ISO containing Photon OS from its source code on GitHub by following the instructions in the document on [building Photon OS](build-photon.md). 
256 256
 
257 257
 ### Installing the OVA for the Minimal Version in vSphere
258 258
 
... ...
@@ -268,7 +273,7 @@ In vSphere Client, turn on the power of the Photon OS virtual machine and open a
268 268
 
269 269
 The default password for the root account is `changeme`, and you must change it when you first login. For security, Photon OS forbids common dictionary words for the root password. 
270 270
 
271
-There are other options for installing Photon OS in vSphere, such as building an ISO from the source code. For more information about the versions of Photon and their installation options, see [Running Photon OS on vSphere](https://github.com/vmware/photon/wiki/Running-Project-Photon-on-vSphere).
271
+There are other options for installing Photon OS in vSphere, such as building an ISO from the source code. For more information about the versions of Photon and their installation options, see [Running Photon OS on vSphere](Running-Project-Photon-on-vSphere.md).
272 272
 
273 273
 ### Rapidly Deploying the Photon OS OVA in VMware Workstation 12 Pro
274 274
 
... ...
@@ -324,11 +329,11 @@ You can then connect to the Photon OS machine with the root account over SSH:
324 324
 
325 325
 ### PXE Boot
326 326
 
327
-Photon OS works with the Preboot Execution Environment, or PXE, to boot by retrieving software from a PXE server over a network connection. For instructions on how to set Photon OS to boot from a PXE server, see [Network PXE Boot](https://github.com/vmware/photon/blob/master/docs/PXE-boot.md).
327
+Photon OS works with the Preboot Execution Environment, or PXE, to boot by retrieving software from a PXE server over a network connection. For instructions on how to set Photon OS to boot from a PXE server, see [Network PXE Boot](PXE-boot.md).
328 328
 
329 329
 ### Kickstart
330 330
 
331
-Photon OS supports kickstart for unattended installations through a CD-ROM or an HTTP server. On Photon OS, kickstart can set the hostname, password, run post-installation scripts, and add public keys for SSH. See [Kickstart Support](https://github.com/vmware/photon/blob/master/docs/kickstart.md).
331
+Photon OS supports kickstart for unattended installations through a CD-ROM or an HTTP server. On Photon OS, kickstart can set the hostname, password, run post-installation scripts, and add public keys for SSH. See [Kickstart Support](kickstart.md).
332 332
 
333 333
 ### Checking the Version and Build Number
334 334
 
... ...
@@ -796,7 +801,7 @@ Second, set the service to auto-start when the system boots:
796 796
 
797 797
 If your application or appliance includes its own HTTP server, you should turn off and disable the HTTP server that comes with Photon OS so that it does not conflict with your own HTTP server. 
798 798
 
799
-To support the option to run RPM-OSTree, the full version of Photon OS runs the <code>httpd.service</code> by default. To stop it and disable it, run the following commands as root: 
799
+To stop it and disable it, run the following commands as root: 
800 800
 
801 801
 	systemctl stop httpd.service
802 802
 	systemctl disable httpd.service
... ...
@@ -888,7 +893,7 @@ The pmd package is included with your Photon OS 2.0 distribution. To make sure t
888 888
 
889 889
 ##### pmd-cli
890 890
 
891
-The pmd-cli utility enables Photon customers to invoke API requests securely on local and remote servers. For details, see [Photon Management Daemon Command-line Interface (pmd-cli)](#https://github.com/vmware/photon/blob/master/docs/pmd-cli.md).
891
+The pmd-cli utility enables Photon customers to invoke API requests securely on local and remote servers. For details, see [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md).
892 892
 
893 893
 ##### PMD REST API
894 894
 
... ...
@@ -897,7 +902,7 @@ You can also browse it using the copenapi_cli tool that comes with the pmd packa
897 897
 ~~~~
898 898
 # copenapi_cli --apispec /etc/pmd/restapispec.json
899 899
 ~~~~
900
-For more information about the copenapi_cli tool, refer to [github.com/vmware/copenapi](#https://github.com/vmware/copenapi).
900
+For more information about the copenapi_cli tool, refer to [github.com/vmware/copenapi](https://github.com/vmware/copenapi).
901 901
 
902 902
 ##### PMD Python API
903 903
 
... ...
@@ -920,15 +925,15 @@ To show help text for individual interfaces:
920 920
 >>> help(pmd.server().firewall)
921 921
 >>> help(pmd.server().user)
922 922
 ~~~~
923
-For details about the network commands, see also the [Network Configuration Manager - Python API](#https://github.com/vmware/photon/blob/master/docs/netmgr.python.md).
923
+For details about the network commands, see also the [Network Configuration Manager - Python API](netmgr.python.md).
924 924
 
925 925
 ##### PMD C Documentation
926 926
 
927 927
 PMD C APIs are defined in the header files (pmd_fwmgmt.h, pmd_netmgr.h, pmd_pkgmgmt.h, pmd_usermgmt.h) that are stored in the following location:  
928 928
 ~~~~
929
-[https://github.com/vmware/pmd/tree/master/include](#https://github.com/vmware/pmd/tree/master/include)
929
+[https://github.com/vmware/pmd/tree/master/include](https://github.com/vmware/pmd/tree/master/include)
930 930
 ~~~~
931
-For details about the network commands, see also the [Network Configuration Manager - C API](#https://github.com/vmware/photon/blob/master/docs/netmgr.c.md).
931
+For details about the network commands, see also the [Network Configuration Manager - C API](netmgr.c.md).
932 932
 
933 933
 ### Using the Network Configuration Manager
934 934
 
... ...
@@ -943,9 +948,9 @@ The Network Configuration Manager library that ships with Photon OS 2.0 provides
943 943
 - object parameters (interfaces and files)
944 944
 
945 945
 For additional details, see:
946
-- **CLI** - see the ``-net`` commands in the [Photon Management Daemon Command-line Interface (pmd-cli)](#https://github.com/vmware/photon/blob/master/docs/pmd-cli.md)
947
-- **C APIs** - [Network Configuration Manager - C API](#https://github.com/vmware/photon/blob/master/docs/netmgr.c.md)
948
-- **Python APIs** - [Network Configuration Manager - Python API](#https://github.com/vmware/photon/blob/master/docs/netmgr.python.md)
946
+- **CLI** - see the ``-net`` commands in the [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md)
947
+- **C APIs** - [Network Configuration Manager - C API](netmgr.c.md)
948
+- **Python APIs** - [Network Configuration Manager - Python API](netmgr.python.md)
949 949
 
950 950
 ### Use `ip` and `ss` Commands Instead of `ifconfig` and `netstat`
951 951
 
... ...
@@ -979,11 +984,11 @@ Using the `ip route` version of a command instead of the net-tools version often
979 979
 Network configuration files for systemd-networkd reside in /etc/systemd/network and /usr/lib/systemd/network. Example:
980 980
 
981 981
 	root@photon-rc [ ~ ]# ls /etc/systemd/network/
982
-	10-dhcp-en.network
982
+	99-dhcp-en.network
983 983
 
984
-By default, when Photon OS starts, it creates a DHCP network configuration file, or rule, which appears in /etc/systemd/network, the highest priority directory for network configuration files:
984
+By default, when Photon OS starts, it creates a DHCP network configuration file, or rule, which appears in /etc/systemd/network, the highest priority directory for network configuration files with the lowest priority filename:
985 985
 
986
-	cat /etc/systemd/network/10-dhcp-en.network
986
+	cat /etc/systemd/network/99-dhcp-en.network
987 987
 	[Match]
988 988
 	Name=e*
989 989
 
... ...
@@ -995,7 +1000,7 @@ Network configuration files can also appear in the system network directory, /us
995 995
 	root@photon-rc [ ~ ]# updatedb
996 996
 	root@photon-rc [ ~ ]# locate systemd/network
997 997
 	/etc/systemd/network
998
-	/etc/systemd/network/10-dhcp-en.network
998
+	/etc/systemd/network/99-dhcp-en.network
999 999
 	/usr/lib/systemd/network
1000 1000
 	/usr/lib/systemd/network/80-container-host0.network
1001 1001
 	/usr/lib/systemd/network/80-container-ve.network
... ...
@@ -1055,9 +1060,8 @@ For more information, see the man page for systemd-networkd: `man systemd.networ
1055 1055
 
1056 1056
 ### Turning Off DHCP
1057 1057
 
1058
-By default, when Photon OS first starts, it creates a DHCP network configuration file, or rule, which appears in /etc/systemd/network, the highest priority directory for network configuration files:
1059
-
1060
-	cat /etc/systemd/network/10-dhcp-en.network
1058
+By default, when Photon OS first starts, it creates a DHCP network configuration file, or rule, which appears in /etc/systemd/network, the highest priority directory for network configuration files with the lowest priority filename:
1059
+	cat /etc/systemd/network/99-dhcp-en.network
1061 1060
 	[Match]
1062 1061
 	Name=e*
1063 1062
 
... ...
@@ -1068,6 +1072,8 @@ To turn off DHCP for all Ethernet interfaces, change the value of `DHCP` from `y
1068 1068
 
1069 1069
 	systemctl restart systemd-networkd
1070 1070
 
1071
+If you create a configuration file with a higher priority filename (e.g. `10-static-en.network`), it is not necessary but still recommended to turn off DHCP.
1072
+
1071 1073
 ### Adding a DNS Server 
1072 1074
 
1073 1075
 Photon OS resolves domain names, IP addresses, and network names for local applications by using systemd-resolved. The systemd-resolved daemon automatically creates and maintains the /etc/resolv.conf file, into which systemd-resolved places the IP address of the DNS server. You should therefore never modify the /etc/resolv.conf file.
... ...
@@ -1275,7 +1281,7 @@ You can then add a network link, such as the Ethernet connection, as the argumen
1275 1275
 	root@photon-rc [ ~ ]# networkctl status eth0
1276 1276
 	* 2: eth0
1277 1277
 	       Link File: /usr/lib/systemd/network/99-default.link
1278
-	    Network File: /etc/systemd/network/10-dhcp-en.network
1278
+	    Network File: /etc/systemd/network/99-dhcp-en.network
1279 1279
 	            Type: ether
1280 1280
 	           State: routable (configured)
1281 1281
 	            Path: pci-0000:02:01.0
... ...
@@ -1346,7 +1352,7 @@ The nfs-utils package is installed by default in the full version of Photon OS b
1346 1346
 
1347 1347
 	tdnf install nfs-utils
1348 1348
 
1349
-For instructions on how to use nfs-utils to share files over a network, see [Photon OS nfs-utils](https://github.com/vmware/photon/blob/master/docs/nfs-utils.md).
1349
+For instructions on how to use nfs-utils to share files over a network, see [Photon OS nfs-utils](nfs-utils.md).
1350 1350
 
1351 1351
 ### Installing the Packages for tcpdump and netcat with tdnf
1352 1352
 
... ...
@@ -1505,9 +1511,9 @@ Now check the cloud-init output log file on EC2 at `/var/log/cloud-init-output.l
1505 1505
 
1506 1506
 For more information on using cloud-init user data on EC2, see [Running Commands on Your Linux Instance at Launch](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html).
1507 1507
 
1508
-An article on the Photon OS GitHub wiki demonstrates how to get Photon OS up and running on EC2 and run a containerized application in the Docker engine. See [Running Photon OS on Amazon Elastic Cloud Compute](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute).
1508
+An article on the Photon OS GitHub wiki demonstrates how to get Photon OS up and running on EC2 and run a containerized application in the Docker engine. See [Running Photon OS on Amazon Elastic Cloud Compute](Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute.md).
1509 1509
 
1510
-With Photon OS, you can also build cloud images on Google Compute Engine and other cloud providers; see [Compatible Cloud Images](https://github.com/vmware/photon/blob/master/docs/cloud-images.md).
1510
+With Photon OS, you can also build cloud images on Google Compute Engine and other cloud providers; see [Compatible Cloud Images](cloud-images.md).
1511 1511
 
1512 1512
 ### Running a Photon OS Machine on GCE
1513 1513
 
... ...
@@ -1570,19 +1576,7 @@ Photon OS also enables you to run a docker container that, in turn, runs Photon
1570 1570
 
1571 1571
 ## Kubernetes
1572 1572
 
1573
-The full version of Photon OS includes Kubernetes so you can manage clusters of containers. For more information, see [Running Kubernetes on Photon OS](https://github.com/vmware/photon/blob/master/docs/kubernetes.md).
1574
-
1575
-## RPM-OSTree
1576
-
1577
-RPM-OSTree is a package-aware file tree replication system that can keep Linux machines synchronized with the latest bits in a predictable and reliable way. To maintain consistency across file systems, RPM-OSTree uses a git-like repository that records the changes to any file and replicates them to any subscriber.
1578
-
1579
-RPM-OSTree lets you compose packages and other configuration options into a file tree on a server. The hosts download the file tree from the server and incrementally upgrade when the file tree changes. In this way, RPM-OSTree delivers identical, predicatable installed systems to solve the problems that commonly plague system administrators as they struggle to maintain a farm of computers with different packages, files, and configurations installed in different order. 
1580
-
1581
-When you install Photon OS from its ISO, it offers two installation options to take advantage of OSTree, a server and a host. The OSTree Host installation option creates a Photon OS instance that obtains its packages from an RPM-OSTree server. The host instance's packages and library are then centrally managed by the server.
1582
-
1583
-The OSTree Server installation option creates an instance of a server that manages the file system tree of the OSTree hosts. Creating a Photon OSTree Server establishes a new repository and management node for the Photon OS OSTree hosts. The Photon OS OSTree Server then manages the hosts as versioned, atomic entities to simply lifecycle management and security on an enterprise scale.   
1584
-
1585
-For more information, see the extensive sections on RPM-OSTree in the [Photon OS wiki](https://github.com/vmware/photon/wiki).
1573
+The full version of Photon OS includes Kubernetes so you can manage clusters of containers. For more information, see [Running Kubernetes on Photon OS](kubernetes.md).
1586 1574
 
1587 1575
 ## Installing Sendmail
1588 1576
 
... ...
@@ -1964,29 +1958,6 @@ Here's the `tdnf` command to install these packages:
1964 1964
 
1965 1965
 ## References
1966 1966
 
1967
-* [Photon OS Troubleshooting Guide](https://github.com/vmware/photon/blob/master/docs/photon-os-troubleshooting-guide.md).
1968
-
1969
-The following technical articles and guides appear in the [Photon OS wiki](https://github.com/vmware/photon/wiki): 
1970
-
1971
-* FAQ
1972
-* Running Photon OS on vSphere
1973
-* Running Photon OS on Fusion
1974
-* Running Photon OS on vCloud Air
1975
-* Install and Configure a Swarm Cluster with DNS Service on Photon OS
1976
-* Install and Configure a Production Ready Mesos Cluster on Photon OS
1977
-* Install and Configure Marathon for Mesos Cluster on Photon OS
1978
-* Install and Configure DCOS CLI for Mesos
1979
-* Install and Configure Mesos DNS on a Mesos Cluster
1980
-* RPM OSTree Documentation
1981
-
1982
-
1983
-
1984
-
1985
-
1986
-
1987
-
1988
-
1989
-
1990
-
1991
-
1992
-
1967
+* [Photon OS Getting Started Guides](getting-started-guides.md)
1968
+* [Photon OS Troubleshooting Guide](photon-os-troubleshooting-guide.md)
1969
+* [FAQ](Frequently-Asked-Questions.md)
1993 1970
new file mode 100644
1994 1971
Binary files /dev/null and b/docs/photon-logo.png differ
... ...
@@ -67,6 +67,7 @@
67 67
     -   [Checking Disk Space](#checking-disk-space)
68 68
     -   [Adding a Disk and Partitioning
69 69
         It](#adding-a-disk-and-partitioning-it)
70
+    -   [Expanding Disk Partition](#expanding-disk-partition)
70 71
     -   [fdisk](#fdisk)
71 72
     -   [fsck](#fsck)
72 73
     -   [Fixing File System Errors When fsck
... ...
@@ -1080,6 +1081,66 @@ Check your work:
1080 1080
 	tmpfs            35M     0   35M   0% /run/user/0
1081 1081
 	/dev/sdb1       945M  1.3M  895M   1% /newdata
1082 1082
 
1083
+### Expanding Disk Partition
1084
+
1085
+If you need more space, you can expand the last partition of your disk after resizing the disk. In the examples we are assuming `sda` as disk device.
1086
+
1087
+After the disk is resized in the virtual machine, it's necessary to tell the system to recognize the new disk ending boundary without rebooting:
1088
+
1089
+	echo 1 > /sys/class/block/sda/device/rescan
1090
+
1091
+You will need to install the parted package to resize the disk partition, which is not available by default. Just run the following command to install it: `tdnf install parted`.
1092
+
1093
+	# parted /dev/sda
1094
+	GNU Parted 3.2
1095
+	Using /dev/sda
1096
+	Welcome to GNU Parted! Type 'help' to view a list of commands.
1097
+
1098
+List all partitions available to fix the GPT and check the last partition number:
1099
+
1100
+	(parted) print
1101
+
1102
+	Warning: Not all of the space available to /dev/sda appears to be used, you can
1103
+	fix the GPT to use all of the space (an extra 4194304 blocks) or continue with
1104
+	the current setting? 
1105
+	Fix/Ignore?
1106
+
1107
+Press `f` to fix the GPT layout.
1108
+
1109
+	Model: VMware Virtual disk (scsi)
1110
+	Disk /dev/sda: 34.4GB
1111
+	Sector size (logical/physical): 512B/512B
1112
+	Partition Table: gpt
1113
+	Disk Flags: 
1114
+
1115
+	Number  Start   End     Size    File system  Name  Flags
1116
+	1      1049kB  3146kB  2097kB                     bios_grub
1117
+	2      3146kB  8590MB  8587MB  ext4
1118
+
1119
+In this case we have the partition `2` as last, then we extend the partition to 100% of the remaining size:
1120
+
1121
+	(parted) resizepart 2 100%
1122
+
1123
+Finally, expand the filesystem to the new size:
1124
+
1125
+	resize2fs /dev/sda2
1126
+	resize2fs 1.42.13 (17-May-2015)
1127
+	Filesystem at /dev/sda2 is mounted on /; on-line resizing required
1128
+	old_desc_blocks = 1, new_desc_blocks = 2
1129
+	The filesystem on /dev/sda2 is now 8387835 (4k) blocks long.
1130
+
1131
+The new space is already available in the system:
1132
+
1133
+	df -h
1134
+	Filesystem      Size  Used Avail Use% Mounted on
1135
+	/dev/root        32G  412M   30G   2% /
1136
+	devtmpfs       1001M     0 1001M   0% /dev
1137
+	tmpfs          1003M     0 1003M   0% /dev/shm
1138
+	tmpfs          1003M  252K 1003M   1% /run
1139
+	tmpfs          1003M     0 1003M   0% /sys/fs/cgroup
1140
+	tmpfs          1003M     0 1003M   0% /tmp
1141
+	tmpfs           201M     0  201M   0% /run/user/0
1142
+
1083 1143
 ### fdisk
1084 1144
 
1085 1145
 The `fdisk` command manipulates the disk partition table. You can, for example, use `fdisk` to list the disk partitions so that you can identify the root Linux file system. Here is an truncated example showing `/dev/sda1` to be the root Linux partition: 
... ...
@@ -13,11 +13,11 @@ Photon OS 2.0 provides the Photon Management Daemon command line interface (pmd-
13 13
 
14 14
 The pmd-cli utility is included with your Photon OS 2.0 distribution. To make sure that you have the latest version, you can run:
15 15
 ~~~~
16
-tndf install pmd-cli
16
+tdnf install pmd-cli
17 17
 ~~~~
18 18
 # Syntax
19 19
 ~~~~
20
-pmd-cli [connection_auth_options] &lt;component&gt; &lt;command&gt; [command_options]
20
+pmd-cli [connection_auth_options] <component> <command> [command_options]
21 21
 ~~~~
22 22
 Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&quot;) as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether.
23 23
 
... ...
@@ -27,7 +27,7 @@ Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&
27 27
 
28 28
 For local connections, you omit the connection and authorization options:
29 29
 ~~~~
30
-pmd-cli &lt;component&gt; &lt;cmd&gt; &lt;options&gt;
30
+pmd-cli <component> <cmd> <options>
31 31
 ~~~~
32 32
 Permissions for the currently logged-in user apply when executing commands. This is the same as specifying --servername localhost.
33 33
 
... ...
@@ -44,23 +44,23 @@ What follows are three options for remote connections.
44 44
 
45 45
 **System User**
46 46
 ~~~~
47
-pmd-cli --servername &lt;server&gt; --user &lt;username&gt;
47
+pmd-cli --servername <server> --user <username>
48 48
 ~~~~
49 49
 **Lightwave User**
50 50
 
51 51
 Before using this method, the pmd server must be joined or should be part of embedded Lightwave.
52 52
 ~~~~
53
-pmd-cli --servername &lt;server&gt; --user &lt;username&gt; --domain &lt;lightwave_domain&gt;
53
+pmd-cli --servername <server> --user <username> --domain <lightwave_domain>
54 54
 ~~~~
55 55
 **Kerberos spn**
56 56
 
57 57
 Before using this method, the client must run kinit successfully.
58 58
 ~~~~
59
-pmd-cli --servername &lt;server&gt; --spn &lt;service_principal_name&gt;
59
+pmd-cli --servername <server> --spn <service_principal_name>
60 60
 ~~~~
61 61
 ## Component
62 62
 
63
-``&lt;component&gt;`` is one of the following values:
63
+``<component>`` is one of the following values:
64 64
 
65 65
 - ``firewall``
66 66
 - ``net``
... ...
@@ -73,7 +73,7 @@ The Photon Management Daemon provides CLI commands to help you get information a
73 73
 
74 74
 ## Syntax
75 75
 ~~~~
76
-pmd-cli [connection_auth_options] firewall &lt;command&gt; [command_options]
76
+pmd-cli [connection_auth_options] firewall <command> [command_options]
77 77
 ~~~~
78 78
 ## firewall help
79 79
 
... ...
@@ -91,20 +91,25 @@ This command returns information about each firewall rule, such as the chain to
91 91
 
92 92
 Add a new firewall rule.
93 93
 ~~~~
94
-pmd-cli firewall rules --chain &lt;chain_name&gt; --add &lt;rule_specification&gt;
94
+pmd-cli firewall rules --chain <chain_name> --add <rule_specification>
95 95
 ~~~~
96 96
 Example:
97 97
 ~~~~
98
-pmd-cli firewall rules --chain INPUT --add &quot;-p tcp -m tcp --dport 21 -j ACCEPT&quot;
98
+pmd-cli firewall rules --chain INPUT --add "-p tcp -m tcp --dport 21 -j ACCEPT"
99 99
 ~~~~
100 100
 **Note:** To confirm that the firewall rule was added, run iptables -S. Running pmd-cli firewall rules lists only persistent rules.
101 101
 
102 102
 Delete a new firewall rule.
103 103
 ~~~~
104
-pmd-cli firewall rules --chain &lt;chain_name&gt; --delete &lt;rule_specification&gt;
104
+pmd-cli firewall rules --chain <chain_name> --delete <rule_specification>
105 105
 ~~~~
106 106
 **Note:**  To confirm that the firewall rule was removed, run iptables -S. Running pmd-cli firewall rules lists only persistent rules.
107 107
 
108
+Make firewall rule changes peristent (add --persist flag)
109
+~~~~
110
+pmd-cli firewall rules --chain <chain_name> --add <rule_specification> --persist
111
+~~~~
112
+
108 113
 ## firewall version
109 114
 
110 115
 Get the version number of the fwmgmt component on the server.
... ...
@@ -117,61 +122,61 @@ The Photon Management Daemon provides CLI commands to help you manage network in
117 117
 
118 118
 ## Syntax
119 119
 ~~~~
120
-pmd-cli [connection_auth_options] net &lt;command&gt; [command_options]
120
+pmd-cli [connection_auth_options] net <command> [command_options]
121 121
 ~~~~
122
-Many of these commands require the interface name (–interface &lt;ifname&gt;). IP addresses can be specified in dot-decimal notation or as prefixes. Other command options are described below.
122
+Many of these commands require the interface name (–interface &lt;ifname&gt;). Command options are described below.
123 123
 
124 124
 ## net link_info
125 125
 
126 126
 Get the mac address, mtu, link state, and link mode for the specified interface.
127 127
 ~~~~
128
-pmd-cli net link_info --get --interface &lt;ifame&gt;
128
+pmd-cli net link_info --get --interface <ifname>
129 129
 ~~~~
130 130
 Set the MAC address, mode (manual or auto), link state (up or down), link mode (manual or auto), and MTU for the specified interface.
131 131
 ~~~~
132
-pmd-cli net link_info --set --interface &lt;ifname&gt; --macaddr &lt;mac_address&gt; --mode &lt;manual|auto&gt; --state &lt;up|down&gt; --mtu &lt;mtu&gt;
132
+pmd-cli net link_info --set --interface <ifname> --macaddr <mac_address> --mode <manual|auto> --state <up|down> --mtu <mtu>
133 133
 ~~~~
134 134
 ## net ip4_address
135 135
 
136 136
 Get the IPv4 address for the specified interface.
137 137
 ~~~~
138
-pmd-cli net ip4_address --get --interface &lt;ifame&gt;
138
+pmd-cli net ip4_address --get --interface <ifname>
139 139
 ~~~~
140
-Set the IPv4 address (dot-decimal or prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
140
+Set the IPv4 address (dot-decimal/prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
141 141
 ~~~~
142
-pmd-cli net ip4_address --set --interface &lt;ifname&gt; --mode &lt;dhcp|static|none&gt; --addr &lt;IPv4Address/prefix&gt; --gateway &lt;gateway_address&gt;
142
+pmd-cli net ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <IPv4Address/prefix> --gateway <gateway_address>
143 143
 ~~~~
144 144
 ## net ip6_address
145 145
 
146 146
 Get IPv6 address(es) for the specified interface.
147 147
 ~~~~
148
-pmd-cli net ip6_address --get --interface &lt;ifame&gt;
148
+pmd-cli net ip6_address --get --interface <ifname>
149 149
 ~~~~
150
-Add one or more IPv6 addresses (comma-separated list in dot-decimal or prefix notation) to the specified interface.
150
+Add one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) to the specified interface.
151 151
 ~~~~
152
-pmd-cli net ip6_address --add --interface &lt;ifame&gt; --addrlist &lt;IPv6Addr1/prefix,IPv6Addr2/prefix,...&gt;
152
+pmd-cli net ip6_address --add --interface <ifname> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...>
153 153
 ~~~~
154
-Delete one or more IPv6 addresses (comma-separated list in dot-decimal or prefix notation) from the specified interface.
154
+Delete one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) from the specified interface.
155 155
 ~~~~
156
-pmd-cli net ip6_address --del --interface &lt;ifame&gt; --addrlist &lt;IPv6Addr1/prefix,IPv6Addr2/prefix,...&gt;
156
+pmd-cli net ip6_address --del --interface <ifname> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...>
157 157
 ~~~~
158 158
 Set the DHCP mode (1=enable, 0=disable) and autoconfigure settings (1=enable, 0=disable) for the specified interface.
159 159
 ~~~~
160
-pmd-cli net ip6_address --set --interface &lt;ifname&gt; --dhcp &lt;1|0&gt; --autoconf &lt;1|0&gt;
160
+pmd-cli net ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0>
161 161
 ~~~~
162 162
 ## net ip_route
163 163
 
164 164
 Get the static IP route for the specified interface.
165 165
 ~~~~
166
-pmd-cli net ip_route --get --interface &lt;ifame&gt;
166
+pmd-cli net ip_route --get --interface <ifname>
167 167
 ~~~~
168 168
 Add the static IP route (gateway IP, destination network, and metric) to the specified interface.
169 169
 ~~~~
170
-pmd-cli net ip_route --add --interface &lt;ifname&gt; --gateway &lt;GatewayIP&gt; --destination &lt;DestinationNetwork/prefix&gt; --metric &lt;N&gt;
170
+pmd-cli net ip_route --add --interface <ifname> --gateway <GatewayIP> --destination <DestinationNetwork/prefix> --metric <N>
171 171
 ~~~~
172 172
 Delete the specified static IP route from the specified interface.
173 173
 ~~~~
174
-pmd-cli net ip_route --del --interface &lt;ifname&gt; --destination &lt;DestIP/N&gt;
174
+pmd-cli net ip_route --del --interface <ifname> --destination <DestinationNetwork/prefix>
175 175
 ~~~~
176 176
 ## net dns_servers
177 177
 
... ...
@@ -181,15 +186,15 @@ pmd-cli net dns_servers --get
181 181
 ~~~~
182 182
 Set the DNS mode (dhcp or static) for one or more DNS servers (comma-separated list).
183 183
 ~~~~
184
-pmd-cli net dns_servers --set --mode &lt;dhcp|static&gt; --servers &lt;server1,server2,...&gt;
184
+pmd-cli net dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
185 185
 ~~~~
186 186
 Add a DNS server to the list of DNS servers.
187 187
 ~~~~
188
-pmd-cli net dns_servers --add --servers &lt;server&gt;
188
+pmd-cli net dns_servers --add --servers <server>
189 189
 ~~~~
190 190
 Remove the specified DNS server from the list of DNS servers.
191 191
 ~~~~
192
-pmd-cli net dns_servers --del --servers &lt;server&gt;
192
+pmd-cli net dns_servers --del --servers <server>
193 193
 ~~~~
194 194
 ## net dns_domains
195 195
 
... ...
@@ -199,35 +204,35 @@ pmd-cli net dns_domains --get
199 199
 ~~~~
200 200
 Set the list of DNS domains (one or more DNS domains in a comma-separated list).
201 201
 ~~~~
202
-pmd-cli net dns_domains --set --domains &lt;domain1,domain2,...&gt;
202
+pmd-cli net dns_domains --set --domains <domain1,domain2,...>
203 203
 ~~~~
204 204
 Add a DNS domain to the list of DNS domains.
205 205
 ~~~~
206
-pmd-cli net dns_domains --add --domains &lt;domain1&gt;
206
+pmd-cli net dns_domains --add --domains <domain1>
207 207
 ~~~~
208 208
 Delete a DNS domain from the list of DNS domains.
209 209
 ~~~~
210
-pmd-cli net dns_domains --del --domains &lt;domain1&gt;
210
+pmd-cli net dns_domains --del --domains <domain1>
211 211
 ~~~~
212 212
 ## net dhcp_duid
213 213
 
214
-Get the DHCP DUID per interface for all interfaces in the system.
214
+Get the DHCP DUID (optionally interface-specific DUID) for the system.
215 215
 ~~~~
216 216
 pmd-cli net dhcp_duid --get
217 217
 ~~~~
218
-Set the DHCP DUID for all interfaces in the system.
218
+Set the DHCP DUID for the system, optionally per-interface if the interface is specified.
219 219
 ~~~~
220
-pmd-cli net dhcp_duid --set --duid &lt;duid&gt;
220
+pmd-cli net dhcp_duid --set --duid <duid>
221 221
 ~~~~
222 222
 ## net if_iaid
223 223
 
224 224
 Get the IAID for the specified interface.
225 225
 ~~~~
226
-pmd-cli net if_iaid --get --interface &lt;ifname&gt;
226
+pmd-cli net if_iaid --get --interface <ifname>
227 227
 ~~~~
228 228
 Set the IAID for the specified interface.
229 229
 ~~~~
230
-pmd-cli net if_iaid --set --interface &lt;ifname&gt; --iaid &lt;iaid&gt;
230
+pmd-cli net if_iaid --set --interface <ifname> --iaid <iaid>
231 231
 ~~~~
232 232
 ## net ntp_servers
233 233
 
... ...
@@ -237,15 +242,15 @@ pmd-cli net ntp_servers --get
237 237
 ~~~~
238 238
 Set the NTP servers list.
239 239
 ~~~~
240
-pmd-cli net ntp_servers --set --servers &lt;server1,server2,...&gt;
240
+pmd-cli net ntp_servers --set --servers <server1,server2,...>
241 241
 ~~~~
242 242
 Add the specified server to the NTP servers list.
243 243
 ~~~~
244
-pmd-cli net ntp_servers --add --servers &lt;server&gt;
244
+pmd-cli net ntp_servers --add --servers <server>
245 245
 ~~~~
246 246
 Delete the specified server from the NTP servers list.
247 247
 ~~~~
248
-pmd-cli net ntp_servers --del --servers &lt;server&gt;
248
+pmd-cli net ntp_servers --del --servers <server>
249 249
 ~~~~
250 250
 ## net hostname
251 251
 
... ...
@@ -255,13 +260,13 @@ pmd-cli net hostname --get
255 255
 ~~~~
256 256
 Set the system hostname.
257 257
 ~~~~
258
-pmd-cli net hostname --set --name &lt;hostname&gt;
258
+pmd-cli net hostname --set --name <hostname>
259 259
 ~~~~
260 260
 ## net wait_for_link
261 261
 
262 262
 Wait for the specified network interface to be up and usable (it can send and receive packets).
263 263
 ~~~~
264
-pmd-cli net wait_for_link --interface &lt;ifname&gt; --timeout &lt;timeout&gt;
264
+pmd-cli net wait_for_link --interface <ifname> --timeout <timeout>
265 265
 ~~~~
266 266
 The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
267 267
 
... ...
@@ -271,7 +276,7 @@ The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no ti
271 271
 
272 272
 Wait for the specified interface to acquire a valid IP address for the specified address type.
273 273
 ~~~~
274
-pmd-cli net wait_for_ip --interface &lt;ifname&gt; --timeout &lt;timeout&gt; --addrtype &lt;ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6&gt;
274
+pmd-cli net wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6>
275 275
 ~~~~
276 276
 The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
277 277
 
... ...
@@ -279,7 +284,7 @@ The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no ti
279 279
 
280 280
 Get error information about the specified error code.
281 281
 ~~~~
282
-pmd-cli net error_info --errcode &lt;error_code&gt;
282
+pmd-cli net error_info --errcode <error_code>
283 283
 ~~~~
284 284
 Here is a list of error codes:
285 285
 
... ...
@@ -299,13 +304,13 @@ Here is a list of error codes:
299 299
 
300 300
 Get the specified network configuration parameter for the specified object.
301 301
 ~~~~
302
-pmd-cli net net_info --get --object &lt;ifname or filename&gt; --paramname &lt;param_name&gt;
302
+pmd-cli net net_info --get --object <ifname or filename> --paramname <param_name>
303 303
 ~~~~
304 304
 **Note:** The object can be an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf).
305 305
 
306 306
 Set the value of the specified network configuration parameter for the specified object (interface or file).
307 307
 ~~~~
308
-pmd-cli net net_info --set --object &lt;ifname or filename&gt; --paramname &lt;param_name&gt; --paramvalue &lt;param_value&gt;
308
+pmd-cli net net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value>
309 309
 ~~~~
310 310
 **Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -.
311 311
 
... ...
@@ -315,11 +320,11 @@ The Photon Management Daemon provides CLI commands to help you manage packages a
315 315
 
316 316
 ## Syntax
317 317
 ~~~~
318
-pmd-cli [connection options] pkg &lt;command&gt; [command options]
318
+pmd-cli [connection options] pkg <command> [command options]
319 319
 ~~~~
320 320
 If a command allows for multiple package names, simply specify on the command line, separated by spaces.
321 321
 ~~~~
322
-pmd-cli pkg info &lt;package_name_1&gt; &lt;package_name_2&gt; &lt;package_name_3&gt; ...
322
+pmd-cli pkg info <package_name_1> <package_name_2> <package_name_3> ...
323 323
 ~~~~
324 324
 ## pkg help
325 325
 
... ...
@@ -343,19 +348,19 @@ pmd-cli pkg distro-sync
343 343
 
344 344
 Downgrade the specified package(s). If no packages are specified, then all available packages are downgraded.
345 345
 ~~~~
346
-pmd-cli pkg downgrade &lt;package_name&gt;
346
+pmd-cli pkg downgrade <package_name>
347 347
 ~~~~
348 348
 ## pkg erase
349 349
 
350 350
 Remove the specified package(s).
351 351
 ~~~~
352
-pmd-cli pkg erase &lt;package_name&gt;
352
+pmd-cli pkg erase <package_name>
353 353
 ~~~~
354 354
 ## pkg info
355 355
 
356 356
 Get general information about the specified package(s),  such as name, version, release, repository, install size, and so on.
357 357
 ~~~~
358
-pmd-cli pkg info &lt;package_name&gt;
358
+pmd-cli pkg info <package_name>
359 359
 ~~~~
360 360
 If no packages are specified, then this command returns information about all packages.
361 361
 ~~~~
... ...
@@ -363,7 +368,7 @@ If no packages are specified, then this command returns information about all pa
363 363
 ~~~~
364 364
 Install the specified package(s). Update the package if an update is available.
365 365
 ~~~~
366
-pmd-cli pkg install &lt;package_name&gt;
366
+pmd-cli pkg install <package_name>
367 367
 ~~~~
368 368
 ## pkg list
369 369
 
... ...
@@ -383,7 +388,7 @@ pmd-cli pkg list ph\*
383 383
 
384 384
 Reinstall the specified package(s).
385 385
 ~~~~
386
-pmd-cli pkg reinstall &lt;package_name&gt;
386
+pmd-cli pkg reinstall <package_name>
387 387
 ~~~~
388 388
 ## pkg repolist
389 389
 
... ...
@@ -397,7 +402,7 @@ This command returns a list of the configured software repositories, including t
397 397
 
398 398
 Update the specified package(s).
399 399
 ~~~~
400
-pmd-cli pkg update &lt;package_name&gt;
400
+pmd-cli pkg update <package_name>
401 401
 ~~~~
402 402
 If no parameters are specified, then all available packages are updated.
403 403
 
... ...
@@ -413,7 +418,7 @@ The Photon Management Daemon provides CLI commands to help you manage users and
413 413
 
414 414
 ## Syntax
415 415
 ~~~~
416
-pmd-cli [connection options] usr &lt;command&gt; [command options]
416
+pmd-cli [connection options] usr <command> [command options]
417 417
 ~~~~
418 418
 ## usr help
419 419
 
... ...
@@ -431,7 +436,7 @@ pmd-cli usr users
431 431
 
432 432
 Add a new user. Specify the username.
433 433
 ~~~~
434
-pmd-cli usr useradd &lt;username&gt;
434
+pmd-cli usr useradd <username>
435 435
 ~~~~
436 436
 The system assigns a user ID, home directory, and default shell to the new user. The user group is unspecified.
437 437
 
... ...
@@ -439,13 +444,13 @@ The system assigns a user ID, home directory, and default shell to the new user.
439 439
 
440 440
 Delete the specified user.
441 441
 ~~~~
442
-pmd-cli usr userdel &lt;username&gt;
442
+pmd-cli usr userdel <username>
443 443
 ~~~~
444 444
 ## usr userid
445 445
 
446 446
 Get the user ID of the specified user (by name). Used to determine whether the specified user exists.
447 447
 ~~~~
448
-pmd-cli usr userid &lt;username&gt;
448
+pmd-cli usr userid <username>
449 449
 ~~~~
450 450
 ## usr groups
451 451
 
... ...
@@ -457,7 +462,7 @@ pmd-cli usr groups
457 457
 
458 458
 Add a new user group.
459 459
 ~~~~
460
-pmd-cli usr groupadd &lt;user_group_name&gt;
460
+pmd-cli usr groupadd <user_group_name>
461 461
 ~~~~
462 462
 The system assigns a group ID to the new user group.
463 463
 
... ...
@@ -465,13 +470,13 @@ The system assigns a group ID to the new user group.
465 465
 
466 466
 Delete the specified user group.
467 467
 ~~~~
468
-pmd-cli usr groupdel &lt;user_group_name&gt;
468
+pmd-cli usr groupdel <user_group_name>
469 469
 ~~~~
470 470
 ## usr groupid
471 471
 
472 472
 Get the group ID for the specified user group (by name). Used to determine whether the specified user group exists.
473 473
 ~~~~
474
-pmd-cli usr groupid &lt;user_group_name&gt;
474
+pmd-cli usr groupid <user_group_name>
475 475
 ~~~~
476 476
 ## usr version
477 477
 
... ...
@@ -44,4 +44,4 @@ List enabled repositories:
44 44
 
45 45
 Tdnf implements a subset of the dnf commands as listed in the [dnf guide](http://dnf.readthedocs.org/en/latest/).
46 46
 
47
-For a description of the tdnf commands and options, including examples, see the [Photon OS Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md).
48 47
\ No newline at end of file
48
+For a description of the tdnf commands and options, including examples, see the [Photon OS Administration Guide](photon-admin-guide.md).
49 49
\ No newline at end of file