Browse code

Merge branch 'master' of https://github.com/vmware/photon

archive authored on 2018/10/04 23:30:26
Showing 44 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,106 @@
0
+Download the Photon OS version that’s right for you. Click one of the links below.
1
+
2
+**Selecting a Download Format**
3
+----------------
4
+
5
+Photon OS is available in the following pre-packaged, binary formats.
6
+#### Download Formats ####
7
+| Format | Description |
8
+| --- | --- |
9
+| 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. |
10
+| 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. |
11
+| 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. |
12
+| 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. | 
13
+| 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. |
14
+
15
+**Downloading Photon OS 2.0 GA**
16
+------------------------------
17
+
18
+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.
19
+#### Photon OS 2.0 GA Binaries ####
20
+| Download | Size | sha1 checksum | md5 checksum |
21
+| --- | --- | --- | --- |
22
+| [Full ISO](http://dl.bintray.com/vmware/photon/2.0/GA/iso/photon-2.0-304b817.iso) | 2.3GB | 68ec892a66e659b18917a12738176bd510cde829 | 6ce66c763589cf1ee49f0144ff7182dc |
23
+| [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 |
24
+| [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 |
25
+| [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 |
26
+| [Amazon AMI](http://dl.bintray.com/vmware/photon/2.0/GA/ami/photon-ami-2.0-304b817.tar.gz) | 135MB | 45f4e9bc27f7316fae77c648c8133195d38f96b3 | 486d59eca17ebc948e2f863f2af06eee |
27
+| [Google GCE](http://dl.bintray.com/vmware/photon/2.0/GA/gce/photon-gce-2.0-304b817.tar.gz) | 705MB | b1385dd8464090b96e6b402c32c5d958d43f9fbd | 34953176901f194f02090988e596b1a7 |
28
+| [Azure VHD - gz file](http://dl.bintray.com/vmware/photon/2.0/GA/azure/photon-azure-2.0-304b817.vhd.gz) | 170MB | a77d54351cca43eefcf289a907ec751c32372930 | 86d281f033f3584b11e5721a5cbda2d3 |
29
+| [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 |
30
+
31
+***Photon OS 2.0 AMI ID (Update: November 7th, 2017)***
32
+-------------------------
33
+| Region | AMI ID|
34
+| --- | --- |
35
+| N.Virginia | ami-47fe4c3d |
36
+| Ohio | ami-29dff04c |
37
+| N.California | ami-065f6166 |
38
+| Oregon | ami-f6ab7f8e |
39
+
40
+**Downloading Photon OS 2.0 RC**
41
+------------------------------
42
+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.
43
+#### Photon OS 2.0 RC Binaries ####
44
+| Download | Size | sha1 checksum | md5 checksum |
45
+| --- | --- | --- | --- |
46
+| [Full ISO](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FRC%2Fiso%2Fphoton-2.0-31bb961.iso) | 2.2GB | 5c049d5ff40c8f22ae5e969eabd1ee8cd6b834e7 | 88cc8ecf2a7f6ae5ac8eb15f54e4a821 |
47
+| [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 |
48
+| [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 |
49
+| [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 |
50
+| [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 |
51
+| [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 |
52
+
53
+**Downloading Photon OS 2.0 Beta**
54
+------------------------------
55
+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.
56
+#### Photon OS 2.0 Beta Binaries ####
57
+| Download | Size | sha1 checksum | md5 checksum |
58
+| --- | --- | --- | --- |
59
+| [Full ISO](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fiso%2Fphoton-2.0-8553d58.iso) | 2.1GB | 7a0e837061805b7aa2649f9ba6652afb2d4591fc | a52c50240726cb3c4219c5c608f9acf3 |
60
+| [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 |
61
+| [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 |
62
+| [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 |
63
+| [Azure VHD](https://bintray.com/vmware/photon/download_file?file_path=2.0%2FBeta%2Fazure%2Fphoton-azure-2.0-8553d58.vhd) | 17GB | 20cfc506a2425510e68a9d12ea48218676008ffe | 6a531eab9e1f8cba89b1f150d344ecab |
64
+
65
+**Downloading Photon OS 1.0**
66
+-------------------------
67
+
68
+
69
+***Photon OS 1.0 AMI ID (Update: September 28th, 2017)***
70
+-------------------------
71
+| Region | AMI ID|
72
+| --- | --- |
73
+| N Virginia | ami-18758762 |
74
+| Ohio | ami-96200df3 |
75
+| N.California | ami-37360657 |
76
+| Oregon | ami-66b74f1e |
77
+
78
+***Photon OS 1.0, Revision 2 Binaries (Update: January 19th, 2017)***
79
+-------------------------------------------------------------
80
+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**.
81
+
82
+Choose the download that’s right for you and click one of the links below.
83
+#### Photon OS 1.0, Revision 2 Binaries ####
84
+| Download | Size | sha1 checksum | md5 checksum |
85
+| --- | --- | --- | --- |
86
+| [Full ISO](https://bintray.com/vmware/photon/download_file?file_path=photon-1.0-62c543d.iso) | 2.4GB | c4c6cb94c261b162e7dac60fdffa96ddb5836d66| 69500c07d25ce9caa9b211a8b6eefd61|
87
+| [OVA with virtual hardware v10](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw10-1.0-62c543d.ova) | 159MB | 6e9087ed25394e1bbc56496ae368b8c77efb21cb | 3e4b1a5f24ab463677e3edebd1ecd218|
88
+| [OVA with virtual hardware v11](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw11-1.0-62c543d.ova) | 159MB | 18c1a6d31545b757d897c61a0c3cc0e54d8aeeba| be9961a232ad5052b746fccbb5a9672d|
89
+| [Amazon AMI](https://bintray.com/vmware/photon/download_file?file_path=photon-ami-1.0-62c543d.tar.gz) | 590MB | 6df9ed7fda83b54c20bc95ca48fa467f09e58548| 5615a56e5c37f4a9c762f6e3bda7f9d0|
90
+| [Google GCE](https://bintray.com/vmware/photon/download_file?file_path=photon-gce-1.0-62c543d.tar.gz) | 164MB | 1feb68ec00aaa79847ea7d0b00eada7a1ac3b527| 5adb7b30803b168e380718db731de5dd|
91
+
92
+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. 
93
+
94
+***Photon OS 1.0, Original Binaries***
95
+--------------------------------
96
+
97
+If you're looking for the original Photon OS, version 1.0 binaries, they can still be found here:
98
+#### Photon OS 1.0, Original Binaries ####
99
+| Download | Size | sha1 checksum | md5 checksum |
100
+| --- | --- | --- | --- |
101
+| [Full ISO](https://bintray.com/artifact/download/vmware/photon/photon-1.0-13c08b6.iso) | 2.1GB | ebd4ae77f2671ef098cf1e9f16224a4d4163bad1 | 15aea2cf5535057ecb019f3ee3cc9d34 |
102
+| [OVA with virtual hardware v10](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw10-1.0-13c08b6.ova) | 292MB | 8669842446b6aac12bd3c8158009305d46b95eac | 3ca7fa49128d1fd16eef1993cdccdd4d |
103
+| [OVA with virtual hardware v11](https://bintray.com/vmware/photon/download_file?file_path=photon-custom-hw11-1.0-13c08b6.ova) | 292MB | 2ee56c5ce355fe6c59888f2f3731fd9d51ff0b4d | 8838498fb8202aac5886518483639073 |
104
+| [Amazon AMI](https://bintray.com/artifact/download/vmware/photon/photon-ami-1.0-13c08b6.tar.gz) | 148.5MB | 91deb839d788ec3c021c6366c192cf5ac601575b | fe657aafdc8189a85430e19ef82fc04a |
105
+| [Google GCE](https://bintray.com/artifact/download/vmware/photon/photon-gce-1.0-13c08b6.tar.gz) | 411.7MB | 397ccc7562f575893c89a899d9beafcde6747d7d | 67a671e032996a26d749b7d57b1b1887 |
0 106
new file mode 100644
... ...
@@ -0,0 +1,167 @@
0
+* [What is Photon OS?](#q-what-is-photon-os)
1
+* [How do I get started with Photon OS?](#q-how-do-i-get-started-with-photon-os)
2
+* [Can I upgrade my existing Photon OS 1.0 VMs?](#q-can-i-upgrade-my-existing-photon-os-10-vms)
3
+* [What kind of support comes with Photon OS?](#q-what-kind-of-support-comes-with-photon-os)
4
+* [How can I contribute to Photon OS?](#q-how-can-i-contribute-to-photon-os)
5
+* [How is Photon OS patched?](#q-how-is-Photon-OS-patched)
6
+* [How does Photon OS relate to Project Lightwave?](#q-how-does-photon-os-relate-to-project-lightwave)
7
+* [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)
8
+* [How to report a security vulnerability in Photon OS?](#q-how-to-report-a-security-vulnerability-in-photon-os)
9
+* [What are the Docker improvements in Photon OS 2.0?](#q-what-are-the-docker-improvements-in-photon-os-20)
10
+* [Why is VMware creating Photon OS?](#q-why-is-vmware-creating-photon-os)
11
+* [Why is VMware open-sourcing Photon OS?](#q-why-is-vmware-open-sourcing-photon-os)
12
+* [In what way is Photon OS "optimized for VMware?"](#q-in-what-way-is-photon-os-optimized-for-vmware)
13
+* [Why can't I SSH in as root?](#q-why-cant-i-ssh-in-as-root)
14
+* [Why isn't netstat working?](#q-why-is-netstat-not-working)
15
+* [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)
16
+* [How to install new packages?](#how-to-install-new-packages)
17
+* [Why is the yum command not working in a minimal installation?](#q-why-the-yum-command-not-working-in-a-minimal-installation)
18
+* [How to install all build essentials?](#q-how-to-install-all-build-essentials)
19
+* [How to build new package for Photon OS?](#q-how-to-build-new-package-for-photon-os)
20
+* [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)
21
+* [What is the difference between Minimal and Full installation?](#q-what-is-the-difference-between-minimal-and-full-installation)
22
+* [What packages are included in Minimal and Full?](#q-what-packages-are-included-in-minimal-and-full)
23
+* [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)
24
+* [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)
25
+
26
+***
27
+
28
+# Getting Started
29
+
30
+## Q. What is Photon OS?
31
+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/).
32
+
33
+## Q. How do I get started with Photon OS?
34
+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.
35
+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](https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
36
+Finally, go to the installation instructions for your target platform, which are listed here: [https://github.com/vmware/photon/wiki](https://github.com/vmware/photon/wiki).
37
+
38
+## Q. Can I upgrade my existing Photon OS 1.0 VMs?
39
+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](https://github.com/vmware/photon/wiki/Upgrading-to-Photon-OS-2.0).
40
+
41
+## Q. What kind of support comes with Photon OS?
42
+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).
43
+
44
+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). 
45
+
46
+## Q. How can I contribute to Photon OS?
47
+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). 
48
+
49
+## Q. How is Photon OS patched?
50
+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.
51
+
52
+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>"
53
+ 
54
+## Q. How does Photon OS relate to Project Lightwave?
55
+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.
56
+Through integration between Photon OS and Project Lightwave, organizations can enforce security and 
57
+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).
58
+
59
+## Q. Will VMware continue to support other container host runtime offerings on vSphere?
60
+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. 
61
+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.
62
+
63
+# Photon OS
64
+## Q. What is Photon OS?
65
+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.
66
+
67
+## Q. How to report a security vulnerability in Photon OS?
68
+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.
69
+
70
+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).
71
+
72
+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.
73
+
74
+In the case of vulnerabilities found in third-party software components used in VMware products, please also notify VMware as described above.
75
+
76
+## Q. What are the Docker improvements in Photon OS 2.0?
77
+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:
78
+- using toybox (instead of standard core tools), which brings the docker image size from 50MB (in 1.0) to 14MB (in 2.0)
79
+- 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.
80
+
81
+## Q. Why is VMware creating Photon OS?
82
+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. 
83
+
84
+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.
85
+
86
+## Q. Why is VMware open-sourcing Photon OS?
87
+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. 
88
+Additionally, VMware is committed to supporting industry and de facto standards, as doing so also supports stronger security, interoperability, and choice for our customers. 
89
+
90
+## Q. In what way is Photon OS "optimized for VMware?"
91
+
92
+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.
93
+
94
+## Q. Why can't I SSH in as root?
95
+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.
96
+
97
+## Q. Why is netstat not working?
98
+A. netstat is deprecated, ss or ip (part of iproute2) should be used instead.
99
+
100
+## Q. Why do all of my cloned Photon OS instances have the same IP address when using DHCP?
101
+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:
102
+~~~~
103
+    echo -n > /etc/machine-id
104
+~~~~
105
+With this value cleared, systemd will regenerate the machine-id and, as a result, all DHCP requests will contain a unique duid. 
106
+
107
+# How to install new packages?
108
+## Q. Why is the yum command not working in a minimal installation?
109
+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
110
+~~~~
111
+     mount /dev/cdrom /media/cdrom
112
+~~~~
113
+Then, you can use tdnf to install new packages. For example, to install the vim editor, 
114
+~~~~
115
+     tdnf install vim
116
+~~~~
117
+## Q. How to install all build essentials?
118
+A. Following command can be used to install all build essentials.
119
+~~~~
120
+curl -L https://git.io/v1boE | xargs -I {} tdnf install -y {}
121
+~~~~
122
+## Q. How to build new package for Photon OS??
123
+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.
124
+~~~~
125
+    cp foo-1.0.tar.gz /workspace/photon/SOURCES
126
+    cp foo.spec /workspace/photon/SPECS/foo/
127
+    cd /workspace/photon/support/package-builder
128
+    sudo python ./build_package.py -i foo
129
+~~~~
130
+## Q. I just booted into freshly installed Photon OS instance, why isn't "docker ps" working?
131
+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:
132
+~~~~
133
+    systemctl start docker
134
+~~~~
135
+To start the docker daemon, on boot, use the command:
136
+~~~~
137
+    systemctl enable docker
138
+~~~~
139
+## Q. What is the difference between Minimal and Full installation?
140
+A. Minimal is the minimal set of packages for a container runtime, plus cloud-init.
141
+Full contains all the packages shipped with ISO.
142
+
143
+## Q. What packages are included in Minimal and Full?
144
+A. See [packages_minimal.json](https://github.com/vmware/photon/blob/dev/common/data/packages_minimal.json) as an example
145
+
146
+## Q. How do I transfer or share files between Photon and my host machine?
147
+A. Use vmhgfs-fuse to transfer files between Photon and your host machine:
148
+1. Enable Shared folders in the Workstation or Fusion UI (edit the VM settings and choose Options->Enabled shared folders).
149
+2. Make sure open-vm-tools is installed (it is installed by default in the Minimal installation and OVA import).
150
+3. Run vmware-hgfsclient to list the shares.
151
+
152
+Next, do one of the following:
153
+
154
+- Run the following to mount:
155
+~~~~
156
+vmhgfs-fuse .host:/$(vmware-hgfsclient) /mnt/hgfs
157
+~~~~
158
+OR
159
+
160
+- Add the following line to /etc/fstab:
161
+~~~~
162
+.host:/ /mnt/hgfs fuse.vmhgfs-fuse <options> 0 0
163
+~~~~
164
+
165
+## Q. Why is the ISO over 2GB, when I hear that Photon OS is a minimal container runtime?
166
+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 167
\ No newline at end of file
1 168
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+![Photon](https://cloud.githubusercontent.com/assets/11306358/9800286/cb4c9eb6-57d1-11e5-916c-6eba8e40fa99.png)
1
+# Welcome to the Photon OS Wiki
2
+
3
+This wiki serves as an unofficial supplement to the documentation that is published in the project .md files. 
4
+
5
+### Photon OS 2.0 GA Available!
6
+
7
+Photon OS 2.0 introduces new security and OS management capabilities, along with new and updated packages for cloud-native applications and VMware appliances. To download the distribution images, go to [Downloading Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS). To learn more, see [What is New in Photon OS 2.0](https://github.com/vmware/photon/wiki/What-is-New-in-Photon-OS-2.0).
8
+
9
+# Table of Contents
10
+
11
+1. [Frequently Asked Questions](https://github.com/vmware/photon/wiki/Frequently-Asked-Questions)
12
+2. Getting Started Guides
13
+    * [Downloading Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS)
14
+    * [Running Photon OS on vSphere](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-vSphere)
15
+    * [Running Photon OS on Fusion](https://github.com/vmware/photon/wiki/Running-Project-Photon-on-Fusion)
16
+    * [Running Photon OS on Workstation](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Workstation)
17
+    * [Running Photon OS on AWS EC2](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute)
18
+    * [Running Photon OS on Microsoft Azure](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Microsoft-Azure)
19
+    * [Running Photon OS on Google Compute Engine](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Google-Compute-Engine)
20
+
21
+3. Administration Guides
22
+    * [Photon OS Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md)
23
+    * [How to use Photon Management Daemon](https://github.com/vmware/photon/blob/master/docs/pmd-cli.md)
24
+
25
+4. How-To Guides
26
+    * [Install and Configure a Swarm Cluster with DNS Service on Photon OS](https://github.com/vmware/photon/wiki/Install-and-Configure-a-Swarm-Cluster-with-DNS-Service-on-PhotonOS)
27
+    * [Install and Configure a Production Ready Mesos Cluster on Photon OS](https://github.com/vmware/photon/wiki/Install-and-Configure-a-Production-Ready-Mesos-Cluster-on-Photon-OS)
28
+ 
0 29
new file mode 100644
... ...
@@ -0,0 +1,34 @@
0
+<sub>Posted on January 13, 2016 by [https://il.linkedin.com/in/knesenko '''Kiril Nesenko''']</sub><br />
1
+
2
+To install the DCOS CLI:
3
+Install virtualenv. The Python tool virtualenv is used to manage the DCOS CLI’s environment.
4
+<source lang="bash" enclose="div">
5
+sudo pip install virtualenv
6
+</source><br />
7
+Tip: On some older Python versions, ignore any ‘Insecure Platform’ warnings. For more information, see https://virtualenv.pypa.io/en/latest/installation.html.
8
+From the command line, create a new directory named dcos and navigate into it.
9
+<source lang="bash" enclose="div">
10
+$ mkdir dcos
11
+$ cd dcos
12
+$ curl -O https://downloads.mesosphere.io/dcos-cli/install.sh
13
+</source><br />
14
+Run the DCOS CLI install script, where &lt;hosturl&gt; is the hostname of your master node prefixed with http://:
15
+<source lang="bash" enclose="div">
16
+$ bash install.sh <install_dir> <mesos-master-host>
17
+</source><br />
18
+For example, if the hostname of your Mesos master node is mesos-master.example.com:
19
+<source lang="bash" enclose="div">
20
+$ bash install.sh . http://mesos-master.example.com
21
+</source><br />
22
+Follow the on-screen DCOS CLI instructions and enter the Mesosphere verification code. You can ignore any Python ‘Insecure Platform’ warnings.
23
+<source lang="bash" enclose="div">
24
+Confirm whether you want to add DCOS to your system PATH:
25
+$ Modify your bash profile to add DCOS to your PATH? [yes/no]
26
+</source><br />
27
+Since DCOS CLI is used for DCOS cluster, reconfigure Marathon and Mesos masters URLs with the following commands:
28
+<source lang="bash" enclose="div">
29
+dcos config set core.mesos_master_url http://<mesos-master-host>:5050
30
+dcos config set marathon.url http://<marathon-host>:8080
31
+</source><br />
32
+<br /><br />
33
+Next - [[Install and Configure Mesos DNS on a Mesos Cluster]]
0 34
\ No newline at end of file
1 35
new file mode 100644
... ...
@@ -0,0 +1,52 @@
0
+<sub>Posted on January 13, 2016 by [https://il.linkedin.com/in/knesenko '''Kiril Nesenko''']</sub><br />
1
+<br />
2
+In my previous How-To [[Install and Configure a Production Ready Mesos Cluster on PhotonOS]]. 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
+First, download Marathon:
4
+<source lang="bash" enclose="div">
5
+root@pt-mesos-master2 [ ~ ]# mkdir -p  /opt/mesosphere/marathon/ && cd /opt/mesosphere/marathon/
6
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]#  curl -O http://downloads.mesosphere.com/marathon/v0.13.0/marathon-0.13.0.tgz
7
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# tar -xf marathon-0.13.0.tgz
8
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# mv marathon-0.13.0 marathon
9
+</source><br />
10
+Create a configuration for Marathon:
11
+<source lang="bash" enclose="div">
12
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# ls -l /etc/marathon/conf/
13
+total 8
14
+-rw-r--r-- 1 root root 68 Dec 24 14:33 master
15
+-rw-r--r-- 1 root root 71 Dec 24 14:33 zk
16
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# cat /etc/marathon/conf/*
17
+zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/mesos
18
+zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/marathon
19
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# cat /etc/systemd/system/marathon.service
20
+[Unit]
21
+Description=Marathon
22
+After=network.target
23
+Wants=network.target
24
+ 
25
+[Service]
26
+Environment="JAVA_HOME=/opt/OpenJDK-1.8.0.51-bin"
27
+ExecStart=/opt/mesosphere/marathon/bin/start \
28
+    --master zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/mesos \
29
+    --zk zk://192.168.0.2:2181,192.168.0.1:2181,192.168.0.3:2181/marathon
30
+Restart=always
31
+RestartSec=20
32
+ 
33
+[Install]
34
+WantedBy=multi-user.target
35
+</source><br />
36
+Finally, we need to change the Marathon startup script, since PhotonOS do not use the standard JRE. Make sure you add JAVA_HOME to Java path:
37
+<source lang="bash" enclose="div">
38
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# tail -n3 /opt/mesosphere/marathon/bin/start
39
+# Start Marathon
40
+marathon_jar=$(find "$FRAMEWORK_HOME"/target -name 'marathon-assembly-*.jar' | sort | tail -1)
41
+exec "${JAVA_HOME}/bin/java" "${java_args[@]}" -jar "$marathon_jar" "${app_args[@]}"
42
+</source><br />
43
+Now we can start the Marthon service:
44
+<source lang="bash" enclose="div">
45
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# systemctl start marathon
46
+root@pt-mesos-master2 [ /opt/mesosphere/marathon ]# ps -ef | grep marathon
47
+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
48
+root     15854 14692  0 17:14 pts/0    00:00:00 grep --color=auto marathon
49
+</source><br />
50
+<br /><br />
51
+Next - [[Install and Configure DCOS CLI for Mesos]]
0 52
\ No newline at end of file
1 53
new file mode 100644
... ...
@@ -0,0 +1,141 @@
0
+<sub>Posted on January 13, 2016 by [https://il.linkedin.com/in/knesenko '''Kiril Nesenko''']</sub><br />
1
+= Overview =<br />
2
+Before you read this How-To, please read: [[Install and Configure a Production-Ready Mesos Cluster on PhotonOS]] , [[Install and Configure Marathon for Mesos Cluster on PhotonOS]] and [[Install and Configure DCOS CLI for Mesos]].
3
+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.
4
+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.
5
+[[ http://mesosphere.github.io/mesos-dns/img/architecture.png ]]<br />
6
+= Installation =<br />
7
+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.
8
+<source lang="bash" enclose="div">
9
+root@pt-mesos-node1 [ ~ ]# cat /etc/mesos-dns/config.json
10
+{
11
+  "zk": "zk://192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181/mesos",
12
+  "masters": ["192.168.0.1:5050", "192.168.0.2:5050", "192.168.0.3:5050"],
13
+  "refreshSeconds": 60,
14
+  "ttl": 60,
15
+  "domain": "mesos",
16
+  "port": 53,
17
+  "resolvers": ["8.8.8.8"],
18
+  "timeout": 5,
19
+  "httpon": true,
20
+  "dnson": true,
21
+  "httpport": 8123,
22
+  "externalon": true,
23
+  "SOAMname": "ns1.mesos",
24
+  "SOARname": "root.ns1.mesos",
25
+  "SOARefresh": 60,
26
+  "SOARetry":   600,
27
+  "SOAExpire":  86400,
28
+  "SOAMinttl": 60
29
+}
30
+</source><br />
31
+'''Create Application Run File'''<br />
32
+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.
33
+<source lang="bash" enclose="div">
34
+client:~/mesos/jobs$ cat mesos-dns-docker.json
35
+{
36
+    "args": [
37
+        "/mesos-dns",
38
+        "-config=/config.json"
39
+    ],
40
+    "container": {
41
+        "docker": {
42
+            "image": "mesosphere/mesos-dns",
43
+            "network": "HOST"
44
+        },
45
+        "type": "DOCKER",
46
+        "volumes": [
47
+            {
48
+                "containerPath": "/config.json",
49
+                "hostPath": "/etc/mesos-dns/config.json",
50
+                "mode": "RO"
51
+            }
52
+        ]
53
+    },
54
+    "cpus": 0.2,
55
+    "id": "mesos-dns-docker",
56
+    "instances": 3,
57
+    "constraints": [["hostname", "CLUSTER", "pt-mesos-node2.example.com"]]
58
+}
59
+</source>
60
+Now we can see in the Marthon and Mesos UI that we launched the application.
61
+<br /><br />
62
+'''Setup Resolvers and Testing'''<br />
63
+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.
64
+<source lang="bash" enclose="div">
65
+root@pt-mesos-node2 [ ~/mesos-dns ]# cat /etc/resolv.conf
66
+# This file is managed by systemd-resolved(8). Do not edit.
67
+#
68
+# Third party programs must not access this file directly, but
69
+#only through the symlink at /etc/resolv.conf. To manage
70
+# resolv.conf(5) in a different way, replace the symlink by a
71
+# static file or a different symlink.
72
+nameserver 192.168.0.5
73
+nameserver 192.168.0.4
74
+nameserver 8.8.8.8
75
+</source><br />
76
+Let's run a simple Docker app and see if we can resolve it in DNS.
77
+<source lang="bash" enclose="div">
78
+client:~/mesos/jobs$ cat docker.json
79
+{
80
+    "id": "docker-hello",
81
+    "container": {
82
+        "docker": {
83
+            "image": "centos"
84
+        },
85
+        "type": "DOCKER",
86
+        "volumes": []
87
+    },
88
+    "cmd": "echo hello; sleep 10000",
89
+    "mem": 16,
90
+    "cpus": 0.1,
91
+    "instances": 10,
92
+    "disk": 0.0,
93
+    "ports": [0]
94
+}
95
+</source>
96
+<source lang="bash" enclose="div">
97
+client:~/mesos/jobs$ dcos marathon app add docker.json
98
+</source><br />
99
+Let's try to resolve it.
100
+
101
+<pre>
102
+root@pt-mesos-node2 [ ~/mesos-dns ]# dig _docker-hello._tcp.marathon.mesos SRV
103
+;; Truncated, retrying in TCP mode.
104
+; <<>> DiG 9.10.1-P1 <<>> _docker-hello._tcp.marathon.mesos SRV
105
+;; global options: +cmd
106
+;; Got answer:
107
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25958
108
+;; flags: qr aa rd ra; QUERY: 1, ANSWER: 10, AUTHORITY: 0, ADDITIONAL: 10
109
+;; QUESTION SECTION:
110
+;_docker-hello._tcp.marathon.mesos. IN SRV
111
+;; ANSWER SECTION:
112
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31998 docker-hello-4bjcf-s2.marathon.slave.mesos.
113
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31844 docker-hello-jexm6-s1.marathon.slave.mesos.
114
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31111 docker-hello-6ms44-s2.marathon.slave.mesos.
115
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31719 docker-hello-muhui-s2.marathon.slave.mesos.
116
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31360 docker-hello-jznf4-s1.marathon.slave.mesos.
117
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31306 docker-hello-t41ti-s1.marathon.slave.mesos.
118
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31124 docker-hello-mq3oz-s1.marathon.slave.mesos.
119
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31816 docker-hello-tcep8-s1.marathon.slave.mesos.
120
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31604 docker-hello-5uu37-s1.marathon.slave.mesos.
121
+_docker-hello._tcp.marathon.mesos. 60 IN SRV 0 0 31334 docker-hello-jqihw-s1.marathon.slave.mesos.
122
+ 
123
+;; ADDITIONAL SECTION:
124
+docker-hello-muhui-s2.marathon.slave.mesos. 60 IN A 192.168.0.5
125
+docker-hello-4bjcf-s2.marathon.slave.mesos. 60 IN A 192.168.0.5
126
+docker-hello-jexm6-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
127
+docker-hello-jqihw-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
128
+docker-hello-mq3oz-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
129
+docker-hello-tcep8-s1.marathon.slave.mesos. 60 IN A 192.168.0.6
130
+docker-hello-6ms44-s2.marathon.slave.mesos. 60 IN A 192.168.0.5
131
+docker-hello-t41ti-s1.marathon.slave.mesos. 60 IN A 192.168.0.4
132
+docker-hello-jznf4-s1.marathon.slave.mesos. 60 IN A 192.168.0.4
133
+docker-hello-5uu37-s1.marathon.slave.mesos. 60 IN A 192.168.0.4
134
+;; Query time: 0 msec
135
+;; SERVER: 192.168.0.5#53(192.168.0.5)
136
+;; WHEN: Sun Dec 27 14:36:32 UTC 2015
137
+;; MSG SIZE  rcvd: 1066
138
+</pre>
139
+
140
+We can see that we can resolve our app!
0 141
\ No newline at end of file
1 142
new file mode 100644
... ...
@@ -0,0 +1,171 @@
0
+== Overview ==
1
+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.<br />
2
+<br />
3
+''' Masters: '''<br />
4
+{| class="wikitable"
5
+! style="text-align: center; font-weight: bold;" | Hostname
6
+! style="font-weight: bold;" | IP Address
7
+|-
8
+| pt-mesos-master1.example.com
9
+| 192.168.0.1
10
+|-
11
+| pt-mesos-master2.example.com
12
+| 192.168.0.2
13
+|-
14
+| pt-mesos-master3.example.com
15
+| 192.168.0.3
16
+|}
17
+''' Agents: '''<br />
18
+{| class="wikitable"
19
+! style="text-align: center; font-weight: bold; font-size: 0.100em;" | Hostname
20
+! style="font-weight: bold;" | IP Address
21
+|-
22
+| pt-mesos-node1.example.com
23
+| 192.168.0.4
24
+|-
25
+| pt-mesos-node2.example.com
26
+| 192.168.0.5
27
+|-
28
+| pt-mesos-node3.example.com
29
+| 192.168.0.6
30
+|}
31
+<br />
32
+== Masters Installation and Configuration ==
33
+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:
34
+<source lang="bash" enclose="div">
35
+root@pt-mesos-master1 [ ~ ]# mkdir -p /opt/mesosphere && cd /opt/mesosphere && wget http://apache.mivzakim.net/zookeeper/stable/zookeeper-3.4.7.tar.gz
36
+root@pt-mesos-master1 [ /opt/mesosphere ]# tar -xf zookeeper-3.4.7.tar.gz && mv zookeeper-3.4.7 zookeeper
37
+root@pt-mesos-master1 [ ~ ]# cat /opt/mesosphere/zookeeper/conf/zoo.cfg | grep -v '#'
38
+tickTime=2000
39
+initLimit=10
40
+syncLimit=5
41
+dataDir=/var/lib/zookeeper
42
+clientPort=2181
43
+server.1=192.168.0.1:2888:3888
44
+server.2=192.168.0.2:2888:3888
45
+server.3=192.168.0.3:2888:3888
46
+</source><br />
47
+Example of Zookeeper systemd configuration file:
48
+<source lang="bash" enclose="div">
49
+root@pt-mesos-master1 [ ~ ]# cat /etc/systemd/system/zookeeper.service
50
+[Unit]
51
+Description=Apache ZooKeeper
52
+After=network.target
53
+ 
54
+[Service]
55
+Environment="JAVA_HOME=/opt/OpenJDK-1.8.0.51-bin"
56
+WorkingDirectory=/opt/mesosphere/zookeeper
57
+ExecStart=/bin/bash -c "/opt/mesosphere/zookeeper/bin/zkServer.sh start-foreground"
58
+Restart=on-failure
59
+RestartSec=20
60
+User=root
61
+Group=root
62
+ 
63
+[Install]
64
+WantedBy=multi-user.target
65
+</source><br />
66
+Add server id to the configuration file, so zookeeper will understand the id of your master server. This should be done for each master with its own id.
67
+<source lang="bash" enclose="div">
68
+root@pt-mesos-master1 [ ~ ]# echo 1 > /var/lib/zookeeper/myid
69
+root@pt-mesos-master1 [ ~ ]# cat /var/lib/zookeeper/myid
70
+1
71
+</source><br />
72
+Now lets install the Mesos masters. Do the following for each master:
73
+<source lang="bash" enclose="div">
74
+root@pt-mesos-master1 [ ~ ]# yum -y install mesos
75
+Setting up Install Process
76
+Package mesos-0.23.0-2.ph1tp2.x86_64 already installed and latest version
77
+Nothing to do
78
+root@pt-mesos-master1 [ ~ ]# cat /etc/systemd/system/mesos-master.service
79
+[Unit]
80
+Description=Mesos Slave
81
+After=network.target
82
+Wants=network.target
83
+ 
84
+[Service]
85
+ExecStart=/bin/bash -c "/usr/sbin/mesos-master \
86
+    --ip=192.168.0.1 \
87
+    --work_dir=/var/lib/mesos \
88
+    --log_dir=/var/log/mesos \
89
+    --cluster=EXAMPLE \
90
+    --zk=zk://192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181/mesos \
91
+    --quorum=2"
92
+KillMode=process
93
+Restart=always
94
+RestartSec=20
95
+LimitNOFILE=16384
96
+CPUAccounting=true
97
+MemoryAccounting=true
98
+ 
99
+[Install]
100
+WantedBy=multi-user.target
101
+</source><br />
102
+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:
103
+<source lang="bash" enclose="div">
104
+root@pt-mesos-master1 [ ~ ]# systemctl start zookeeper
105
+root@pt-mesos-master1 [ ~ ]# systemctl start mesos-master
106
+root@pt-mesos-master1 [ ~ ]# ps -ef | grep mesos
107
+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
108
+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
109
+root     11601  9117  0 12:09 pts/0    00:00:00 grep --color=auto mesos
110
+</source><br />
111
+== Slaves Installation and Configuration ==
112
+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:
113
+<source lang="bash" enclose="div">
114
+root@pt-mesos-node1 [ ~ ]# cat /etc/systemd/system/mesos-slave.service
115
+[Unit]
116
+Description=Photon instance running as a Mesos slave
117
+After=network-online.target,docker.service
118
+  
119
+[Service]
120
+Restart=on-failure
121
+RestartSec=10
122
+TimeoutStartSec=0
123
+ExecStartPre=/usr/bin/rm -f /tmp/mesos/meta/slaves/latest
124
+ExecStart=/bin/bash -c "/usr/sbin/mesos-slave \
125
+    --master=zk://192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181/mesos \
126
+        --hostname=$(/usr/bin/hostname) \
127
+        --log_dir=/var/log/mesos_slave \
128
+        --containerizers=docker,mesos \
129
+        --docker=$(which docker) \
130
+        --executor_registration_timeout=5mins \
131
+        --ip=192.168.0.4"
132
+  
133
+[Install]
134
+WantedBy=multi-user.target
135
+</source>
136
+Please make sure to replace the NIC name under '''''–ip''''' setting. Start the mesos-slave service on each node.
137
+<br />
138
+Now you should have ready Mesos cluster with 3 masters, 3 Zookeepers and 3 slaves.
139
+[[https://www.devops-experts.com/wp-content/uploads/2015/12/Screen-Shot-2015-12-24-at-2.22.27-PM.png]]
140
+<br />
141
+If you want to use private docker registry, you will need to edit docker systemd file. In my example I am using cse-artifactory.eng.vmware.com registry:
142
+<source lang="bash" enclose="div">
143
+root@pt-mesos-node1 [ ~ ]# cat /lib/systemd/system/docker.service
144
+[Unit]
145
+Description=Docker Daemon
146
+Wants=network-online.target
147
+After=network-online.target
148
+  
149
+[Service]
150
+EnvironmentFile=-/etc/sysconfig/docker
151
+ExecStart=/bin/docker -d $OPTIONS -s overlay
152
+ExecReload=/bin/kill -HUP $MAINPID
153
+KillMode=process
154
+Restart=always
155
+MountFlags=slave
156
+LimitNOFILE=1048576
157
+LimitNPROC=1048576
158
+LimitCORE=infinity
159
+  
160
+[Install]
161
+WantedBy=multi-user.target
162
+  
163
+root@pt-mesos-node1 [ ~ ]# cat /etc/sysconfig/docker
164
+OPTIONS='--insecure-registry cse-artifactory.eng.vmware.com'
165
+root@pt-mesos-node1 [ ~ ]# systemctl daemon-reload && systemctl restart docker
166
+root@pt-mesos-node1 [ ~ ]# ps -ef | grep cse-artifactory
167
+root      5286     1  0 08:39 ?        00:00:00 /bin/docker -d --insecure-registry <your_privet_registry> -s overlay
168
+</source><br />
169
+<br /><br />
170
+Next - [[Install and Configure Marathon for Mesos Cluster on PhotonOS]]
0 171
\ No newline at end of file
1 172
new file mode 100644
... ...
@@ -0,0 +1,277 @@
0
+<sub>Posted on January 13, 2016 by [https://il.linkedin.com/in/tgabay '''Tal Gabay''']</sub>
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
+The cluster that will be set up will be on VMware Photon hosts. <br />
6
+<br />
7
+A prerequisite to using this guide is to be familiar with Docker Swarm - information can be found [https://docs.docker.com/swarm/ here].
8
+
9
+== Cluster description ==
10
+
11
+The cluster will have 2 Swarm Managers and 3 Swarm Agents:
12
+
13
+=== Masters ===
14
+
15
+{| class="wikitable"
16
+! style="text-align: center; font-weight: bold;" | Hostname
17
+! style="font-weight: bold;" | IP Address
18
+|-
19
+| pt-swarm-master1.example.com
20
+| 192.168.0.1
21
+|-
22
+| pt-swarm-master2.example.com
23
+| 192.168.0.2
24
+|}
25
+
26
+=== Agents ===
27
+
28
+{| class="wikitable"
29
+! style="text-align: center; font-weight: bold; font-size: 0.100em;" | Hostname
30
+! style="font-weight: bold;" | IP Address
31
+|-
32
+| pt-swarm-agent1.example.com
33
+| 192.168.0.3
34
+|-
35
+| pt-swarm-agent2.example.com
36
+| 192.168.0.4
37
+|-
38
+| pt-swarm-agent3.example.com
39
+| 192.168.0.5
40
+|}<br />
41
+
42
+= Docker Swarm Installation and Configuration =
43
+
44
+== Setting Up the Managers ==
45
+
46
+The following steps should be done on both managers.<br />
47
+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.<br />
48
+Download the latest stable version of Zookeeper and create the '' zoo.cfg '' file under the '' conf '' directory:
49
+<br />
50
+<br />
51
+
52
+=== Zookeeper installation ===
53
+
54
+<source lang="bash" enclose="div">
55
+root@pt-swarm-master1 [ ~ ]# mkdir -p /opt/swarm && cd /opt/swarm && wget http://apache.mivzakim.net/zookeeper/stable/zookeeper-3.4.6.tar.gz
56
+root@pt-swarm-master1 [ /opt/swarm ]# tar -xf zookeeper-3.4.6.tar.gz && mv zookeeper-3.4.6 zookeeper
57
+root@pt-swarm-master1 [ ~ ]# cat /opt/swarm/zookeeper/conf/zoo.cfg | grep -v '#'
58
+tickTime=2000
59
+initLimit=10
60
+syncLimit=5
61
+dataDir=/var/lib/zookeeper
62
+clientPort=2181
63
+server.1=192.168.0.1:2888:3888
64
+server.2=192.168.0.2:2888:3888
65
+</source><br />
66
+The dataDir should be an empty, existing directory.
67
+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.
68
+<br />
69
+<br />
70
+Set Zookeeper ID
71
+<source lang="bash" enclose="div">
72
+root@pt-swarm-master1 [ ~ ]# echo 1 > /var/lib/zookeeper/myid
73
+</source><br />
74
+Project Photon uses [https://en.wikipedia.org/wiki/Systemd Systemd] for services, so a zookeeper service should be created using systemd unit file.<br />
75
+<source lang="bash" enclose="div">
76
+root@pt-swarm-master1 [ ~ ]# cat /etc/systemd/system/zookeeper.service
77
+[Unit]
78
+Description=Apache ZooKeeper
79
+After=network.target
80
+ 
81
+[Service]
82
+Environment="JAVA_HOME=/opt/OpenJDK-1.8.0.51-bin"
83
+WorkingDirectory=/opt/swarm/zookeeper
84
+ExecStart=/bin/bash -c "/opt/swarm/zookeeper/bin/zkServer.sh start-foreground"
85
+Restart=on-failure
86
+RestartSec=20
87
+User=root
88
+Group=root
89
+ 
90
+[Install]
91
+WantedBy=multi-user.target
92
+</source><br />
93
+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.
94
+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.<br />
95
+<source lang="bash" enclose="div">
96
+root@pt-swarm-master1 [ ~ ]# systemctl enable zookeeper
97
+root@pt-swarm-master1 [ ~ ]# systemctl start zookeeper
98
+</source><br />
99
+Verify that the service was able to start:<br />
100
+<source lang="bash" enclose="div">
101
+root@pt-swarm-master1 [ ~ ]# systemctl status zookeeper
102
+zookeeper.service - Apache ZooKeeper
103
+   Loaded: loaded (/etc/systemd/system/zookeeper.service; enabled)
104
+   Active: active (running) since Tue 2016-01-12 00:27:45 UTC; 10s ago
105
+ Main PID: 4310 (java)
106
+   CGroup: /system.slice/zookeeper.service
107
+           `-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...
108
+</source><br />
109
+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):
110
+<source lang="bash" enclose="div">
111
+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
112
+</source>
113
+* '' docker run -d ''- run the container in the background.
114
+* '' --name=manager1 ''- give the container a name instead of the auto-generated one.
115
+* '' -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.
116
+* swarm - the image to use for the container.
117
+* manage - the command to send to the container once it's up, alongside the rest of the parameters.
118
+* '' --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.
119
+* '' --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.
120
+* '' 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).<br />
121
+<br />
122
+On the second manager, execute the following:
123
+<source lang="bash" enclose="div">
124
+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
125
+</source>
126
+Notice that the only difference is the --advertise flag value. The first manager will not lose leadership following this command.<br />
127
+<br />
128
+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:
129
+<source lang="bash" enclose="div">
130
+docker-client:~$ docker -H tcp://192.168.0.1:8888 info
131
+Containers: 0
132
+Images: 0
133
+Role: primary
134
+Strategy: spread
135
+Filters: health, port, dependency, affinity, constraint
136
+Nodes: 0
137
+CPUs: 0
138
+Total Memory: 0 B
139
+Name: 82b8516efb7c
140
+</source>
141
+There are a few things that are worth noticing:
142
+* The info command can be executed from ANY machine that can reach the master. The -H tcp://&lt;ip&gt;:&lt;port&gt; command specifies that the docker command should be executed on a remote host.
143
+* Containers - this is the result of the docker ps -a command for the cluster we just set up.
144
+* Images - the result of the docker images command.
145
+* Role - as expected, this is the primary manager.
146
+* 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.
147
+* Filters - Swarm can choose where to run containers based on different filters supplied in the command line. More info can be found [https://docs.docker.com/swarm/scheduler/filter/ here].<br />
148
+<br />
149
+When we now look at the docker info on our replicated manager, we can see the following information:
150
+<source lang="bash" enclose="div">
151
+docker-client:~$ docker -H tcp://192.168.0.2:8888 info
152
+Containers: 0
153
+Images: 0
154
+Role: replica
155
+Primary: 192.168.0.1:8888
156
+Strategy: spread
157
+Filters: health, port, dependency, affinity, constraint
158
+Nodes: 0
159
+CPUs: 0
160
+Total Memory: 0 B
161
+Name: ac06f826e507
162
+</source>
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.<br />
166
+<br />
167
+
168
+== Setting Up the Agents ==
169
+
170
+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.
171
+Edit the '' /usr/lib/systemd/system/docker.service '' file so that each agent will be able to join the cluster:
172
+<source lang="bash" enclose="div">
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
+</source>
192
+* '' -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.
193
+* '' -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. 
194
+** tcp - If you need to access the Docker daemon remotely, you need to enable the tcp Socket.
195
+** fd - On Systemd based systems, you can communicate with the daemon via Systemd socket activation.
196
+* '' --cluster-advertise <NIC>:2375 ''- advertises the machine on the network by stating the ethernet card and the port used by the Swarm Managers.
197
+* '' --cluster-store zk://192.168.0.1,192.168.0.2/swarm ''- as we defined before, the service discovery being used here is Zookeeper.
198
+<br />
199
+Enable and start the docker service:
200
+<source lang="bash" enclose="div">
201
+root@pt-swarm-agent1 [ ~ ]# systemctl enable docker
202
+root@pt-swarm-agent1 [ ~ ]# systemctl daemon-reload && systemctl restart docker
203
+root@pt-swarm-agent1 [ ~ ]# systemctl status docker
204
+docker.service - Docker Daemon
205
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
206
+   Active: active (running) since Tue 2016-01-12 00:46:18 UTC; 4s ago
207
+ Main PID: 11979 (docker)
208
+   CGroup: /system.slice/docker.service
209
+           `-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
210
+</source><br />
211
+All that remains is to have the agents join the cluster:
212
+<source lang="bash" enclose="div">
213
+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
214
+</source><br />
215
+A look at the output of the docker info command will now show:
216
+<source lang="bash" enclose="div">
217
+docker-client:~$ docker -H tcp://192.168.0.1:8888 info
218
+Containers: 3
219
+Images: 9
220
+Role: primary
221
+Strategy: spread
222
+Filters: health, port, dependency, affinity, constraint
223
+Nodes: 3
224
+ pt-swarm-agent1.example.com: 192.168.0.3:2375
225
+  └ Status: Healthy
226
+  └ Containers: 1
227
+  └ Reserved CPUs: 0 / 1
228
+  └ Reserved Memory: 0 B / 2.055 GiB
229
+  └ Labels: executiondriver=native-0.2, kernelversion=4.1.3-esx, operatingsystem=VMware Photon/Linux, storagedriver=overlay
230
+ pt-swarm-agent2.example.com: 192.168.0.4:2375
231
+  └ Status: Healthy
232
+  └ Containers: 1
233
+  └ Reserved CPUs: 0 / 1
234
+  └ Reserved Memory: 0 B / 2.055 GiB
235
+  └ Labels: executiondriver=native-0.2, kernelversion=4.1.3-esx, operatingsystem=VMware Photon/Linux, storagedriver=overlay
236
+ pt-swarm-agent3.example.com: 192.168.0.5:2375
237
+  └ Status: Healthy
238
+  └ Containers: 1
239
+  └ Reserved CPUs: 0 / 1
240
+  └ Reserved Memory: 0 B / 2.055 GiB
241
+  └ Labels: executiondriver=native-0.2, kernelversion=4.1.3-esx, operatingsystem=VMware Photon/Linux, storagedriver=overlay
242
+CPUs: 3
243
+Total Memory: 6.166 GiB
244
+Name: 82b8516efb7c
245
+</source>
246
+
247
+== Setting Up DNS ==
248
+
249
+Docker does not have its own self-provided DNS so we use a [https://github.com/ahmetalpbalkan/wagl wagl] DNS.
250
+Setting it up is very simple. In this case, one of the masters will also be the DNS. Simply execute:
251
+<source lang="bash" enclose="div">
252
+docker-client:~$ docker run -d --restart=always --name=dns -p 53:53/udp --link manager1:swarm ahmet/wagl wagl --swarm tcp://swarm:2375
253
+</source>
254
+* '' --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.
255
+* '' --link manager1:swarm ''- link the manager1 container (by name) and give it the alias swarm.
256
+That's it, DNS is up and running.
257
+
258
+= Test Your Cluster =
259
+
260
+== Running Nginx ==
261
+
262
+Execute the following commands from any docker client:
263
+<source lang="bash" enclose="div">
264
+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
265
+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
266
+</source>
267
+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.<br />
268
+Now, from any container in the cluster that has dnsutils, you can execute the following (for example):
269
+<source lang="bash" enclose="div">
270
+root@13271a2d0fcb:/# dig +short A api.example.swarm
271
+192.168.0.3
272
+192.168.0.4
273
+root@13271a2d0fcb:/# dig +short SRV _api._tcp.example.swarm
274
+1 1 80 192.168.0.3.
275
+1 1 80 192.168.0.4.
276
+</source>
0 277
\ No newline at end of file
1 278
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)
7
+2. [Installing the Lightwave Client on a Photon Image and Joining the Client to a Domain](Installing-Lightwave-Client-and-Joining-a-Domain)
8
+3. [Installing the Photon Management Daemon on a Lightwave Client](Installing-the-Photon-Management-Daemon-on-a-Lightwave-Client)
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)
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)
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,13 @@
0
+The Photon OS Administration 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. The guide is at the following URL: 
1
+
2
+https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md
3
+
4
+The Photon OS Troubleshooting Guide describes the fundamentals of troubleshooting problems on Photon OS. This guide covers the basics of troubleshooting systemd, packages, network interfaces, services such as SSH and Sendmail, the file system, and the Linux kernel. The guide includes a quick tour of the tools that you can use for troubleshooting and provides examples along the way. The guide also demonstrates how to access the system's log files. It is at the following URL:
5
+
6
+https://github.com/vmware/photon/blob/master/docs/photon-os-troubleshooting-guide.md 
7
+
8
+Additional documentation appears in the docs directory of the Photon OS GitHub:
9
+
10
+https://github.com/vmware/photon/tree/master/docs
11
+
12
+
0 13
new file mode 100644
... ...
@@ -0,0 +1,52 @@
0
+### 1.1 What is OSTree? How about RPM-OSTree?
1
+
2
+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.   
3
+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.  
4
+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.
5
+You may read more about OSTree [here](https://wiki.gnome.org/Projects/OSTree).
6
+
7
+### 1.2 Why use RPM-OSTree in Photon?
8
+There are several important benefits:
9
+* 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.
10
+* 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.
11
+* Manageable: You are provided simple tools to figure out exactly what packages have been installed, to compare files, configuration and package changes between versions.
12
+* 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. 
13
+
14
+As drawbacks, I would mention:
15
+* Some applications configured by user on host may have compatibility issues if they save configuration or download into read only directories like /usr.
16
+* 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.
17
+* Administrators need to be aware about the directories re-mapping specific to OSTree and plan accordingly.
18
+
19
+### 1.3 Photon with RPM-OSTree installation profiles
20
+Photon takes advantage of RPM-OSTree and offers several installation choices:
21
+* Photon RPM-OSTree server - used to compose customized Photon OS installations and to prepare updates. I will call it for short 'server'.
22
+* 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'.
23
+* 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'.
24
+
25
+### 1.4 Terminology
26
+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.
27
+When "ostree" and "rpm-ostree" (in small letters) are encountered, they refer to the usage of the specific Unix commands.   
28
+
29
+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. 
30
+
31
+### 1.5 Sample code
32
+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](https://github.com/vmware/photon/blob/1.0/docs/photon-admin-guide.md#permitting-root-login-with-ssh). 
33
+The samples assume that the following VMs have been installed - see the steps in the next chapters:
34
+* A default host VM named **photon-host-def**.
35
+* Two server VMs named **photon-srv1** and **photon-srv2**.
36
+* Two custom host VMs named **photon-host-cus1** and **photon-host-cus2**, connected each to the corresponding server during install.
37
+
38
+### 1.6 How to read this book
39
+I've tried to structure this book to be used both as a sequential read and as a reference documentation.   
40
+If you are just interested in deploying a host system and keeping it up to date, then read chapters 2 and 5.   
41
+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.  
42
+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.
43
+
44
+### 1.7 Difference between versions
45
+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.  
46
+
47
+The guide has been updated significantly for Photon OS 2.0. Information of what's different is scattered through chapters 2, 6, 7, 8. [[Chapter 12|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0]] is dedicated to the topic.    
48
+
49
+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.
50
+
51
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-Preface]] | [[ Next page >|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository]]
0 52
\ No newline at end of file
1 53
new file mode 100644
... ...
@@ -0,0 +1,89 @@
0
+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.
1
+
2
+### 10.1 Listing remotes
3
+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.
4
+```
5
+root@photon-host-def [ ~ ]# ostree remote list
6
+photon
7
+```
8
+We can inquiry about the URL for that remote name, which for the default host is the expected Photon OS online OSTree repo.
9
+```
10
+root@photon-host-def [ ~ ]# ostree remote show-url photon
11
+https://dl.bintray.com/vmware/photon/rpm-ostree/1.0
12
+```
13
+But where is this information stored? The repo's config file has it.
14
+```
15
+root@photon-host-def [ ~ ]# cat /ostree/repo/config 
16
+[core]
17
+repo_version=1
18
+mode=bare
19
+
20
+[remote "photon"]
21
+url=https://dl.bintray.com/vmware/photon/rpm-ostree/1.0
22
+gpg-verify=false
23
+```
24
+
25
+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.
26
+```
27
+root@photon-host-cus [ ~ ]# ostree remote show-url photon
28
+http://10.118.101.168
29
+```
30
+
31
+### 10.2 GPG signature verification
32
+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.  
33
+
34
+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.
35
+
36
+
37
+### 10.3 Switching repositories
38
+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.   
39
+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.  
40
+This may create confusion and it's one of the reasons I insisted on creating your own scheme of versioning.
41
+  
42
+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.  
43
+A better solution would be to add a new remote that will identify where the commits come from.
44
+
45
+### 10.4 Adding and removing remotes
46
+
47
+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#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. 
48
+```
49
+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
50
+root@photon-host-cus [ ~ ]# ostree remote list
51
+photon
52
+photon2
53
+root@photon-host-cus [ ~ ]# ostree remote show-url photon2
54
+http://10.118.101.86
55
+```
56
+Where is this information stored? There is an extra config file created per each remote:
57
+```
58
+root@photon-host-cus [ ~ ]# cat /etc/ostree/remotes.d/photon2.conf 
59
+[remote "photon2"]
60
+url=http://10.118.101.86
61
+branches=photon/2.0/x86_64/minimal;photon/2.0/x86_64/full;
62
+gpg-verify=false
63
+```
64
+You may have guessed what is the effect of ```--no-gpg-verify option```.  
65
+Obviously, remotes could also be deleted.
66
+```
67
+root@photon-host-cus [ ~ ]# ostree remote delete photon2
68
+root@photon-host-cus [ ~ ]# ostree remote list
69
+photon
70
+```
71
+
72
+### 10.5 List available branches
73
+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).  
74
+
75
+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#85-creating-summary-metadata]].  This command lists all branches available for remote **photon2**.
76
+
77
+```
78
+root@photon-host-cus [ ~ ]# ostree remote refs photon2 
79
+photon2:photon/2.0/x86_64/base
80
+photon2:photon/2.0/x86_64/full
81
+photon2:photon/2.0/x86_64/minimal
82
+```
83
+
84
+###10.6 Switching branches (rebasing)
85
+
86
+
87
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-9-Package-oriented-server-operations]] | [[Next page >|Photon-RPM-OSTree:-11-Running-container-applications-between-bootable-images]]
88
+  
0 89
new file mode 100644
... ...
@@ -0,0 +1,211 @@
0
+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.   
1
+We are going to do this twice: first, to verify an existing bootable image installed in parallel and then create a new one.
2
+
3
+### 11.1 Downloading a docker container appliance
4
+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). 
5
+```
6
+root@sample-host-def [ ~ ]# systemctl status docker
7
+* docker.service - Docker Daemon
8
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled)
9
+   Active: inactive (dead)
10
+
11
+root@sample-host-def [ ~ ]# cat /usr/lib/systemd/system/docker.service
12
+[Unit]
13
+Description=Docker Daemon
14
+Wants=network-online.target
15
+After=network-online.target
16
+
17
+[Service]
18
+ExecStart=/bin/docker -d -s overlay
19
+ExecReload=/bin/kill -HUP $MAINPID
20
+KillMode=process
21
+Restart=always
22
+MountFlags=slave
23
+LimitNOFILE=1048576
24
+LimitNPROC=1048576
25
+LimitCORE=infinity
26
+
27
+[Install]
28
+WantedBy=multi-user.target
29
+```
30
+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. 
31
+```
32
+root@sample-host-def [ ~ ]# systemctl enable docker
33
+Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
34
+
35
+root@sample-host-def [ ~ ]# ls -l /etc/systemd/system/multi-user.target.wants
36
+total 0
37
+lrwxrwxrwx 1 root root 38 Sep  6 08:38 docker.service -> /usr/lib/systemd/system/docker.service
38
+lrwxrwxrwx 1 root root 47 Aug 28 20:21 iptables.service -> ../../../../lib/systemd/system/iptables.service
39
+lrwxrwxrwx 1 root root 47 Aug 28 20:21 remote-fs.target -> ../../../../lib/systemd/system/remote-fs.target
40
+lrwxrwxrwx 1 root root 50 Aug 28 20:21 sshd-keygen.service -> ../../../../lib/systemd/system/sshd-keygen.service
41
+lrwxrwxrwx 1 root root 43 Aug 28 20:21 sshd.service -> ../../../../lib/systemd/system/sshd.service
42
+lrwxrwxrwx 1 root root 55 Aug 28 20:21 systemd-networkd.service -> ../../../../lib/systemd/system/systemd-networkd.service
43
+lrwxrwxrwx 1 root root 55 Aug 28 20:21 systemd-resolved.service -> ../../../../lib/systemd/system/systemd-resolved.service
44
+```
45
+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".  
46
+Finally, let's start the daemon, check again that is active. 
47
+```
48
+root@sample-host-def [ ~ ]# systemctl start docker
49
+
50
+root@sample-host-def [ ~ ]# systemctl status -l docker
51
+* docker.service - Docker Daemon
52
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
53
+   Active: active (running) since Sun 2015-09-06 08:56:30 UTC; 42s ago
54
+ Main PID: 349 (docker)
55
+   CGroup: /system.slice/docker.service
56
+           `-349 /bin/docker -d -s overlay
57
+
58
+Sep 06 08:56:30 sample-host-def docker[349]: Warning: '-d' is deprecated, it will be removed soon. See usage.
59
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30Z" level=warning msg="please use 'docker daemon' instead."
60
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.617969465Z" level=info msg="Option DefaultDriver: bridge"
61
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.618264109Z" level=info msg="Option DefaultNetwork: bridge"
62
+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)"
63
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.637516253Z" level=info msg="Firewalld running: false"
64
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.786748372Z" level=info msg="Loading containers: start."
65
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.787252697Z" level=info msg="Loading containers: done."
66
+Sep 06 08:56:30 sample-host-def docker[349]: time="2015-09-06T08:56:30.787410576Z" level=info msg="Daemon has completed initialization"
67
+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
68
+```
69
+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/.
70
+```
71
+root@sample-host-def [ ~ ]# docker ps -a
72
+CONTAINER ID        IMAGE            COMMAND      CREATED           STATUS              PORTS       NAMES
73
+
74
+root@sample-host-def [ ~ ]# docker run -it ubuntu
75
+Unable to find image 'ubuntu:latest' locally
76
+latest: Pulling from library/ubuntu
77
+d3a1f33e8a5a: Downloading [=========================================>         ] 54.55 MB/65.79 MB
78
+c22013c84729: Download complete 
79
+d74508fb6632: Download complete 
80
+91e54dfb1179: Download complete 
81
+```
82
+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.
83
+```
84
+root@sample-host-def [ ~ ]# docker run -it ubuntu
85
+Unable to find image 'ubuntu:latest' locally
86
+latest: Pulling from library/ubuntu
87
+d3a1f33e8a5a: Pull complete 
88
+c22013c84729: Pull complete 
89
+d74508fb6632: Pull complete 
90
+91e54dfb1179: Already exists 
91
+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.
92
+Digest: sha256:fde8a8814702c18bb1f39b3bd91a2f82a8e428b1b4e39d1963c5d14418da8fba
93
+Status: Downloaded newer image for ubuntu:latest
94
+
95
+root@d07ebca78051:/# cat /etc/os-release
96
+NAME="Ubuntu"
97
+VERSION="14.04.3 LTS, Trusty Tahr"
98
+ID=ubuntu
99
+ID_LIKE=debian
100
+PRETTY_NAME="Ubuntu 14.04.3 LTS"
101
+VERSION_ID="14.04"
102
+HOME_URL="http://www.ubuntu.com/"
103
+SUPPORT_URL="http://help.ubuntu.com/"
104
+BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
105
+root@d07ebca78051:/#
106
+```
107
+Now let's write a file into Ubuntu home directory
108
+```
109
+echo "Ubuntu file" > /home/myfile
110
+root@d07ebca78051:/home# cat /home/myfile
111
+Ubuntu file
112
+```
113
+We'll exit back to the Photon prompt and if it's stopped, we will re-start it.
114
+```
115
+root@d07ebca78051:/# exit
116
+exit
117
+
118
+root@sample-host-def [ ~ ]# docker ps -a
119
+CONTAINER ID    IMAGE   COMMAND       CREATED         STATUS                      PORTS   NAMES
120
+d07ebca78051    ubuntu  "/bin/bash"   3 minutes ago   Exited (0) 13 seconds ago           kickass_hodgkin
121
+
122
+root@photon-host-cus1 [ ~ ]# docker start  d07ebca78051
123
+d07ebca78051
124
+
125
+root@photon-host-cus1 [ ~ ]# docker ps -a
126
+CONTAINER ID    IMAGE   COMMAND       CREATED         STATUS                      PORTS   NAMES
127
+d07ebca78051    ubuntu  "/bin/bash"   16 minutes ago  Up 5 seconds                        kickass_hodgkin
128
+```
129
+
130
+### 11.2 Rebooting into an existing image
131
+Now let's reboot the machine and select the other image. First, we'll verify that the docker daemon is automaically started.
132
+```
133
+root@photon-host-cus1 [ ~ ]# systemctl status docker
134
+* docker.service - Docker Daemon
135
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
136
+   Active: active (running) since Sun 2015-09-06 11:19:05 UTC; 2min 9s ago
137
+ Main PID: 292 (docker)
138
+   CGroup: /system.slice/docker.service
139
+           `-292 /bin/docker -d -s overlay
140
+   ...
141
+```
142
+Next, is the Ubuntu OS container still there?
143
+```
144
+root@photon-host-cus1 [ ~ ]# docker ps -a 
145
+CONTAINER ID    IMAGE     COMMAND      CREATED          STATUS                     PORTS   NAMES
146
+57dcac5d0490    ubuntu    "/bin/bash"  25 minutes ago   Exited (137) 5 minutes ago         sad_banach
147
+```
148
+It is, so let's start it, attach and verify that our file is persisted, then add another line to it and save, exit.
149
+```
150
+root@photon-host-cus1 [ ~ ]# docker start -i  57dcac5d0490
151
+root@57dcac5d0490:/# cat /home/myfile 
152
+Ubuntu file
153
+root@57dcac5d0490:/# echo "booted into existing image" >> /home/myfile
154
+root@57dcac5d0490:/# exit
155
+```
156
+### 11.3 Reboot into a newly created image
157
+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).
158
+```
159
+root@photon-host-cus1 [ ~ ]# rpm-ostree status
160
+  TIMESTAMP (UTC)         VERSION               ID             OSNAME     REFSPEC                              
161
+* 2015-09-04 00:36:37     1.0_tp2_minimal.2     092e21d292     photon     photon:photon/tp2/x86_64/minimal     
162
+  2015-08-20 22:27:43     1.0_tp2_minimal       2940e10c4d     photon     photon:photon/tp2/x86_64/minimal     
163
+
164
+root@photon-host-cus1 [ ~ ]# rpm-ostree upgrade
165
+Updating from: photon:photon/tp2/x86_64/minimal
166
+
167
+43 metadata, 209 content objects fetched; 19992 KiB transferred in 0 seconds
168
+Copying /etc changes: 5 modified, 0 removed, 19 added
169
+Transaction complete; bootconfig swap: yes deployment count change: 0
170
+Freed objects: 16.2 MB
171
+Added:
172
+  git-2.1.2-1.ph1tp2.x86_64
173
+  perl-YAML-1.14-1.ph1tp2.noarch
174
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot
175
+
176
+root@photon-host-cus1 [ ~ ]# rpm-ostree status
177
+  TIMESTAMP (UTC)         VERSION               ID             OSNAME     REFSPEC                              
178
+  2015-09-06 18:12:08     1.0_tp2_minimal.3     d16aebd803     photon     photon:photon/tp2/x86_64/minimal     
179
+* 2015-09-04 00:36:37     1.0_tp2_minimal.2     092e21d292     photon     photon:photon/tp2/x86_64/minimal  
180
+```
181
+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.
182
+```
183
+root@photon-host-cus1 [ ~ ]# ls -l /etc/systemd/system/multi-user.target.wants/docker.service 
184
+lrwxrwxrwx 1 root root 38 Sep  6 12:50 /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service
185
+
186
+root@photon-host-cus1 [ ~ ]# systemctl status docker
187
+* docker.service - Docker Daemon
188
+   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
189
+   Active: active (running) since Sun 2015-09-06 12:56:33 UTC; 1min 27s ago
190
+ Main PID: 292 (docker)
191
+   CGroup: /system.slice/docker.service
192
+           `-292 /bin/docker -d -s overlay
193
+
194
+   ...   
195
+```  
196
+Let's revisit the Ubuntu container. Is the container still there? is myfile persisted?
197
+```
198
+root@photon-host-cus1 [ ~ ]# docker ps -a
199
+CONTAINER ID   IMAGE       COMMAND      CREATED       STATUS                        PORTS   NAMES
200
+57dcac5d0490   ubuntu      "/bin/bash"  2 hours ago   Exited (0) About an hour ago          sad_banach
201
+
202
+root@photon-host-cus1 [ ~ ]# docker start 57dcac5d0490
203
+
204
+root@57dcac5d0490:/# cat /home/myfile
205
+Ubuntu file
206
+booted into existing image
207
+root@57dcac5d0490:/# echo "booted into new image" >> /home/myfile
208
+```
209
+
210
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon RPM-OSTree:-10-Remotes]] | [[ Next page >|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0]]
0 211
\ No newline at end of file
1 212
new file mode 100644
... ...
@@ -0,0 +1,38 @@
0
+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.  
1
+Photon OS 2.0 does not offer a 'default host' installation. See chapter 7 and 12 for other options. 
2
+
3
+### 2.1 Who is this for?  
4
+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.
5
+
6
+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.    
7
+
8
+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.
9
+
10
+### 2.2 Installing the ISO, step by step
11
+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.
12
+
13
+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.
14
+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:   
15
+
16
+[[Running Project Photon on Fusion|Running-Project-Photon-on-Fusion]].  
17
+
18
+Select the **Photon OSTree Host** option.
19
+
20
+![PhotonChooseHost](https://cloud.githubusercontent.com/assets/13158414/14757883/15742dce-08ad-11e6-9486-4fe08b4bf7f2.png)  
21
+
22
+Continue with setting up a host name like **photon1-def** and a root password, re-confirm.   
23
+Then, select "Default OSTree Server" and continue.  
24
+
25
+![PhotonChooseHostDefault](https://cloud.githubusercontent.com/assets/13158414/14757878/1557500a-08ad-11e6-9cb7-f917cb0fdaca.png)
26
+
27
+![PhotonHostDefaultFinish](https://cloud.githubusercontent.com/assets/13158414/14757882/1571cde0-08ad-11e6-8e07-47258ca4e8d9.png)  
28
+
29
+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!  
30
+
31
+![PhotonHostFirstRebootGrub](https://cloud.githubusercontent.com/assets/13158414/14757877/155614ec-08ad-11e6-9e36-b43f77b6fb69.png)  
32
+
33
+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]] when new updates are available, skip to [[Chapter 5|Photon-RPM-OSTree:-5-Host-updating-operations]].
34
+
35
+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 [[Chapter 5|Photon-RPM-OSTree:-5-Host-updating-operations]].  
36
+
37
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-1-Introduction#photon-with-rpm-ostree-installation-profiles]] | [[ Next page >|Photon-RPM-OStree:-3-Concepts-in-action]] 
0 38
\ No newline at end of file
1 39
new file mode 100644
... ...
@@ -0,0 +1,256 @@
0
+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.
1
+
2
+### 4.1 Commit history
3
+For a host that is freshly installed, there is only one commit in the history for the only branch.
4
+```
5
+root@photon-host [ ~ ]# ostree log photon/1.0/x86_64/minimal
6
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
7
+Date:  2016-06-07 14:06:17 +0000
8
+Version: 1.0_minimal
9
+```
10
+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.
11
+```
12
+root@photon-host [ ~ ]# ostree log 56ef
13
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
14
+Date:  2016-06-07 14:06:17 +0000
15
+Version: 1.0_minimal
16
+```
17
+```
18
+root@photon-host [ ~ ]# ostree log 56ef --raw
19
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
20
+({'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])
21
+```
22
+
23
+### 4.2 Listing file mappings
24
+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. 
25
+```
26
+root@photon-host [ ~ ]# ostree ls photon/1.0/x86_64/minimal
27
+d00755 0 0      0 /
28
+l00777 0 0      0 /bin -> usr/bin
29
+l00777 0 0      0 /home -> var/home
30
+l00777 0 0      0 /lib -> usr/lib
31
+l00777 0 0      0 /lib64 -> usr/lib
32
+l00777 0 0      0 /media -> run/media
33
+l00777 0 0      0 /mnt -> var/mnt
34
+l00777 0 0      0 /opt -> var/opt
35
+l00777 0 0      0 /ostree -> sysroot/ostree
36
+l00777 0 0      0 /root -> var/roothome
37
+l00777 0 0      0 /sbin -> usr/sbin
38
+l00777 0 0      0 /srv -> var/srv
39
+l00777 0 0      0 /tmp -> sysroot/tmp
40
+d00755 0 0      0 /boot
41
+d00755 0 0      0 /dev
42
+d00755 0 0      0 /proc
43
+d00755 0 0      0 /run
44
+d00755 0 0      0 /sys
45
+d00755 0 0      0 /sysroot
46
+d00755 0 0      0 /usr
47
+d00755 0 0      0 /var
48
+```
49
+Extra columns can be added like checksum (-C) and extended attributes (-X). 
50
+```
51
+root@photon-host [ /usr/share/man/man1 ]# ostree ls photon/1.0/x86_64/minimal -C
52
+d00755 0 0      0 3c6b714407d05ed59dfc4a1c3374961d50a353d5f120b440d06035f2f829cf5f 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /
53
+l00777 0 0      0 389846c2702216e1367c8dfb68326a6b93ccf5703c89c93979052a9bf359608e /bin -> usr/bin
54
+l00777 0 0      0 4344c10bf4931483f918496534f12ed9b50dc6a2cead35e3cd9dd898d6ac9414 /home -> var/home
55
+l00777 0 0      0 f11902ca9d69a80df33918534a3e443251fd0aa7f94b76301e1f55e52aed29dd /lib -> usr/lib
56
+l00777 0 0      0 f11902ca9d69a80df33918534a3e443251fd0aa7f94b76301e1f55e52aed29dd /lib64 -> usr/lib
57
+l00777 0 0      0 75317a3df11447c470ffdd63dde045450ca97dfb2a97a0f3f6a21a5da66f737c /media -> run/media
58
+l00777 0 0      0 97c55dbe24e8f3aecfd3f3e5b3f44646fccbb39799807d37a217e9c871da108b /mnt -> var/mnt
59
+l00777 0 0      0 46b1abbd27a846a9257a8d8c9fc4b384ac0888bdb8ac0d6a2d5de72715bd5092 /opt -> var/opt
60
+l00777 0 0      0 d37269e3f46023fd0275212473e07011894cdf4148cbf3fb5758a7e9471dad8e /ostree -> sysroot/ostree
61
+l00777 0 0      0 6f800e74eed172661278d1e1f09e389a6504dcd3358618e1c1618f91f9d33601 /root -> var/roothome
62
+l00777 0 0      0 e0bead7be9323b06bea05cb9b66eb151839989e3a4e5d1a93e09a36919e91818 /sbin -> usr/sbin
63
+l00777 0 0      0 5d4250bba1ed300f793fa9769474351ee5cebd71e8339078af7ebfbe6256d9b5 /srv -> var/srv
64
+l00777 0 0      0 364fbd62f91ca1e06eb7dbd50c93de8976f2cea633658e2dbe803ce6f7490c09 /tmp -> sysroot/tmp
65
+d00755 0 0      0 1e4f98d92b35c453d8f61e668aea9fae7ca1863f6609db787374b4ad5caf3b2f 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /boot
66
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /dev
67
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /proc
68
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /run
69
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /sys
70
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /sysroot
71
+d00755 0 0      0 b072f4b3e995a491c04d88636401ca156e80f103b002d724ae76c07174ee4c74 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /usr
72
+d00755 0 0      0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /var
73
+```
74
+
75
+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.
76
+```
77
+root@photon-host [ /usr/share/rpm-ostree ]# ostree ls photon/1.0/x86_64/minimal -R | grep -e '[Rr]pm-\?[Oo]stree'
78
+l00777 0 0      0 /usr/bin/atomic -> rpm-ostree
79
+-00755 0 0 131104 /usr/bin/rpm-ostree
80
+l00777 0 0      0 /usr/lib/librpmostree-1.so.1 -> librpmostree-1.so.1.0.0
81
+-00755 0 0 104272 /usr/lib/librpmostree-1.so.1.0.0
82
+-00644 0 0   1296 /usr/lib/girepository-1.0/RpmOstree-1.0.typelib
83
+d00755 0 0      0 /usr/lib/rpm-ostree
84
+-00644 0 0    622 /usr/lib/rpm-ostree/tmpfiles-ostree-integration.conf
85
+-00644 0 0    717 /usr/lib/tmpfiles.d/rpm-ostree-autovar.conf
86
+d00755 0 0      0 /usr/share/rpm-ostree
87
+-00644 0 0   1132 /usr/share/rpm-ostree/treefile.json
88
+```
89
+
90
+**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.
91
+```
92
+root@photon-host [ /usr/share/rpm-ostree ]# ls -l /usr/share/man/man1 
93
+total 0
94
+```
95
+
96
+
97
+### 4.3 Listing configuration changes
98
+
99
+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:
100
+```
101
+root@photon-host [ ~ ]# ostree admin config-diff
102
+M    mtab
103
+M    ssh/sshd_config
104
+M    shadow
105
+M    hosts
106
+M    fstab
107
+M    machine-id
108
+A    ssh/ssh_host_rsa_key
109
+A    ssh/ssh_host_rsa_key.pub
110
+A    ssh/ssh_host_dsa_key
111
+A    ssh/ssh_host_dsa_key.pub
112
+A    ssh/ssh_host_ecdsa_key
113
+A    ssh/ssh_host_ecdsa_key.pub
114
+A    ssh/ssh_host_ed25519_key
115
+A    ssh/ssh_host_ed25519_key.pub
116
+A    ssh/sshd.pid
117
+A    tmpfiles.d/postinstall.sh
118
+A    udev/hwdb.bin
119
+A    resolv.conf
120
+A    hostname
121
+A    postinstall
122
+A    localtime
123
+A    .updated
124
+```
125
+
126
+### 4.4 Listing packages
127
+As expected, there is an rpm-ostree command that lists all the packages for that branch, extracted from RPM database.   
128
+```
129
+root@photon-host [ ~ ]# rpm-ostree db list photon/1.0/x86_64/minimal
130
+ostree commit: photon/1.0/x86_64/minimal (56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4)
131
+ Linux-PAM-1.2.1-3.ph1.x86_64
132
+ attr-2.4.47-3.ph1.x86_64
133
+ autogen-libopts-5.18.7-2.ph1.x86_64
134
+ bash-4.3.30-4.ph1.x86_64
135
+ bc-1.06.95-3.ph1.x86_64
136
+ binutils-2.25.1-2.ph1.x86_64
137
+ bridge-utils-1.5-2.ph1.x86_64
138
+ bzip2-1.0.6-5.ph1.x86_64
139
+ ca-certificates-20160109-5.ph1.x86_64
140
+ coreutils-8.25-2.ph1.x86_64
141
+ cpio-2.12-2.ph1.x86_64
142
+ cracklib-2.9.6-2.ph1.x86_64
143
+ cracklib-dicts-2.9.6-2.ph1.x86_64
144
+ curl-7.47.1-2.ph1.x86_64
145
+ db-6.1.26-2.ph1.x86_64
146
+ dbus-1.8.8-5.ph1.x86_64
147
+ device-mapper-2.02.141-5.ph1.x86_64
148
+ device-mapper-libs-2.02.141-5.ph1.x86_64
149
+ docker-1.11.0-5.ph1.x86_64
150
+ dracut-044-3.ph1.x86_64
151
+ dracut-tools-044-3.ph1.x86_64
152
+ e2fsprogs-1.42.13-2.ph1.x86_64
153
+ elfutils-libelf-0.165-2.ph1.x86_64
154
+ expat-2.1.0-2.ph1.x86_64
155
+ file-5.24-2.ph1.x86_64
156
+ filesystem-1.0-7.ph1.x86_64
157
+ findutils-4.6.0-2.ph1.x86_64
158
+ flex-2.5.39-2.ph1.x86_64
159
+ gdbm-1.11-2.ph1.x86_64
160
+ glib-2.47.6-2.ph1.x86_64
161
+ glib-networking-2.46.1-2.ph1.x86_64
162
+ glibc-2.22-8.ph1.x86_64
163
+ gmp-6.0.0a-3.ph1.x86_64
164
+ gnutls-3.4.11-2.ph1.x86_64
165
+ gobject-introspection-1.46.0-2.ph1.x86_64
166
+ gpgme-1.6.0-2.ph1.x86_64
167
+ grep-2.21-2.ph1.x86_64
168
+ grub2-2.02-4.ph1.x86_64
169
+ gzip-1.6-2.ph1.x86_64
170
+ hawkey-2014.1-4.ph1.x86_64
171
+ iana-etc-2.30-2.ph1.noarch
172
+ iproute2-4.2.0-2.ph1.x86_64
173
+ iptables-1.6.0-4.ph1.x86_64
174
+ iputils-20151218-3.ph1.x86_64
175
+ json-glib-1.0.4-2.ph1.x86_64
176
+ kmod-21-4.ph1.x86_64
177
+ krb5-1.14-4.ph1.x86_64
178
+ libarchive-3.1.2-6.ph1.x86_64
179
+ libassuan-2.4.2-2.ph1.x86_64
180
+ libcap-2.25-2.ph1.x86_64
181
+ libffi-3.2.1-2.ph1.x86_64
182
+ libgcc-5.3.0-3.ph1.x86_64
183
+ libgcrypt-1.6.5-2.ph1.x86_64
184
+ libgomp-5.3.0-3.ph1.x86_64
185
+ libgpg-error-1.21-2.ph1.x86_64
186
+ libgsystem-2015.1-2.ph1.x86_64
187
+ libhif-0.2.2-2.ph1.x86_64
188
+ librepo-1.7.17-2.ph1.x86_64
189
+ libselinux-2.5-2.ph1.x86_64
190
+ libsepol-2.5-2.ph1.x86_64
191
+ libsolv-0.6.19-2.ph1.x86_64
192
+ libsoup-2.53.90-2.ph1.x86_64
193
+ libstdc++-5.3.0-3.ph1.x86_64
194
+ libtasn1-4.7-2.ph1.x86_64
195
+ libtool-2.4.6-2.ph1.x86_64
196
+ libxml2-2.9.4-1.ph1.x86_64
197
+ linux-4.4.8-6.ph1.x86_64
198
+ lua-5.3.2-2.ph1.x86_64
199
+ m4-1.4.17-2.ph1.x86_64
200
+ mkinitcpio-19-2.ph1.x86_64
201
+ mpfr-3.1.3-2.ph1.x86_64
202
+ ncurses-6.0-2.ph1.x86_64
203
+ net-tools-1.60-7.ph1.x86_64
204
+ nettle-3.2-2.ph1.x86_64
205
+ nspr-4.12-2.ph1.x86_64
206
+ nss-3.21-2.ph1.x86_64
207
+ nss-altfiles-2.19.1-2.ph1.x86_64
208
+ openssh-7.1p2-3.ph1.x86_64
209
+ openssl-1.0.2h-2.ph1.x86_64
210
+ ostree-2015.7-5.ph1.x86_64
211
+ pcre-8.38-3.ph1.x86_64
212
+ photon-release-1.0-5.ph1.noarch
213
+ pkg-config-0.28-2.ph1.x86_64
214
+ popt-1.16-2.ph1.x86_64
215
+ procps-ng-3.3.11-2.ph1.x86_64
216
+ python2-2.7.11-4.ph1.x86_64
217
+ python2-libs-2.7.11-4.ph1.x86_64
218
+ readline-6.3-4.ph1.x86_64
219
+ rpm-4.11.2-10.ph1.x86_64
220
+ rpm-ostree-2015.7-2.ph1.x86_64
221
+ sed-4.2.2-2.ph1.x86_64
222
+ shadow-4.2.1-7.ph1.x86_64
223
+ sqlite-autoconf-3.11.0-2.ph1.x86_64
224
+ systemd-228-21.ph1.x86_64
225
+ tcsh-6.19.00-4.ph1.x86_64
226
+ util-linux-2.27.1-2.ph1.x86_64
227
+ vim-7.4-5.ph1.x86_64
228
+ which-2.21-2.ph1.x86_64
229
+ xz-5.2.2-2.ph1.x86_64
230
+ zlib-1.2.8-3.ph1.x86_64
231
+```
232
+
233
+### 4.5 Querying for package details
234
+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.
235
+```
236
+root@photon-host [ /usr/share/man/man1 ]# rpm -ql  rpm-ostree
237
+/usr/bin/atomic
238
+/usr/bin/rpm-ostree
239
+/usr/lib/girepository-1.0/RpmOstree-1.0.typelib
240
+/usr/lib/librpmostree-1.so.1
241
+/usr/lib/librpmostree-1.so.1.0.0
242
+/usr/lib/rpm-ostree
243
+/usr/lib/rpm-ostree/tmpfiles-ostree-integration.conf
244
+/usr/share/man/man1/atomic.1.gz
245
+/usr/share/man/man1/rpm-ostree.1.gz
246
+```
247
+### 4.6 Why am I unable to install, update or delete packages?
248
+
249
+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?
250
+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.
251
+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.
252
+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.
253
+
254
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OStree:-3-Concepts-in-action]]  | [[Next page >|Photon-RPM-OSTree:-5-Host-updating-operations]] 
255
+
0 256
new file mode 100644
... ...
@@ -0,0 +1,506 @@
0
+### 5.1 Is it an update or an upgrade?
1
+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".
2
+
3
+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.
4
+
5
+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.
6
+
7
+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.
8
+
9
+As we'll see in a future chapter, a jump to a different Refspec (branch) is also supported and it's named "rebase".
10
+
11
+
12
+### 5.2 Incremental upgrade
13
+To check if there are any updates available, one would execute:
14
+```
15
+root@photon-host-def [ ~ ]# rpm-ostree upgrade
16
+Updating from: photon:photon/1.0/x86_64/minimal
17
+
18
+
19
+No upgrade available.
20
+```  
21
+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.  
22
+
23
+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**.
24
+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.
25
+```
26
+root@photon-host [ ~ ]# rpm-ostree upgrade --check-diff
27
+Updating from: photon:photon/1.0/x86_64/minimal
28
+
29
+8 metadata, 13 content objects fetched; 1026 KiB transferred in 0 seconds
30
++gawk-4.1.3-2.ph1.x86_64
31
++sudo-1.8.15-3.ph1.x86_64
32
++wget-1.17.1-2.ph1.x86_64
33
+```
34
+
35
+We like what we see and now let's upgrade for real. This command will deploy a new bootable filetree. 
36
+```
37
+root@photon-host [ ~ ]# rpm-ostree upgrade             
38
+Updating from: photon:photon/1.0/x86_64/minimal
39
+
40
+98 metadata, 189 content objects fetched; 14418 KiB transferred in 0 seconds
41
+Copying /etc changes: 6 modified, 0 removed, 16 added
42
+Transaction complete; bootconfig swap: yes deployment count change: 1
43
+Added:
44
+  gawk-4.1.3-2.ph1.x86_64
45
+  sudo-1.8.15-3.ph1.x86_64
46
+  wget-1.17.1-2.ph1.x86_64
47
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot
48
+```
49
+By looking at the commit history, notice that the new commit has the original commit as parent. 
50
+```
51
+root@photon-host [ ~ ]# ostree log photon/1.0/x86_64/minimal
52
+commit 184d9bbcecd4e8401d4a5073a248082f7a8888d232ef9678b6942002547a14e3
53
+Date:  2016-06-13 22:23:25 +0000
54
+Version: 1.0_minimal.1
55
+
56
+
57
+commit 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
58
+Date:  2016-06-07 14:06:17 +0000
59
+Version: 1.0_minimal 
60
+```
61
+
62
+Notice that now we have a new reference, that corresponds to the newly deployed image.
63
+```
64
+root@photon-host [ ~ ]# ostree refs
65
+ostree/1/1/0
66
+ostree/1/1/1
67
+photon:photon/1.0/x86_64/minimal
68
+```
69
+
70
+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. 
71
+```
72
+root@photon-host [ ~ ]# rpm-ostree status
73
+  TIMESTAMP (UTC)        VERSION          ID            OSNAME    REFSPEC                              
74
+  2016-06-13 22:23:25    1.0_minimal.1    184d9bbcec    photon    photon:photon/1.0/x86_64/minimal     
75
+* 2016-06-07 14:06:17    1.0_minimal      56ef687f13    photon    photon:photon/1.0/x86_64/minimal     
76
+```
77
+
78
+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.
79
+
80
+![Grub-dual-boot-1-0](https://cloud.githubusercontent.com/assets/13158414/16056451/68275a40-322a-11e6-8289-b1c82d617a9c.png)
81
+
82
+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.
83
+```
84
+root@photon-host [ ~ ]# rpm-ostree status
85
+  TIMESTAMP (UTC)        VERSION          ID            OSNAME    REFSPEC                              
86
+* 2016-06-13 22:23:25    1.0_minimal.1    184d9bbcec    photon    photon:photon/1.0/x86_64/minimal     
87
+  2016-06-07 14:06:17    1.0_minimal      56ef687f13    photon    photon:photon/1.0/x86_64/minimal         
88
+```
89
+
90
+Also, the current deployment directory is based on the new 82bca commit:
91
+```
92
+root@photon-host-def [ ~ ]# ostree admin config-diff --print-current-dir
93
+/ostree/deploy/photon/deploy/82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.0
94
+```
95
+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.
96
+
97
+### 5.3 Listing file differences   
98
+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.
99
+```
100
+root@photon-host-def [ ~ ]# ostree diff 2940 82bc
101
+M    /usr/etc/group-
102
+M    /usr/etc/gshadow
103
+M    /usr/etc/passwd-
104
+M    /usr/etc/shadow
105
+M    /usr/share/rpm/Basenames
106
+M    /usr/share/rpm/Conflictname
107
+M    /usr/share/rpm/Dirnames
108
+M    /usr/share/rpm/Group
109
+M    /usr/share/rpm/Installtid
110
+M    /usr/share/rpm/Name
111
+M    /usr/share/rpm/Obsoletename
112
+M    /usr/share/rpm/Packages
113
+M    /usr/share/rpm/Providename
114
+M    /usr/share/rpm/Requirename
115
+M    /usr/share/rpm/Sha1header
116
+M    /usr/share/rpm/Sigmd5
117
+M    /usr/share/rpm/Triggername
118
+M    /usr/share/rpm-ostree/treefile.json
119
+D    /boot/initramfs-4.0.9.img-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
120
+D    /boot/vmlinuz-4.0.9-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
121
+D    /usr/etc/gshadow-
122
+D    /usr/etc/shadow-
123
+D    /usr/lib/ostree-boot/initramfs-4.0.9.img-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
124
+D    /usr/lib/ostree-boot/vmlinuz-4.0.9-49c11628bc4b702fcbf4a01abbb5249ddc845a81570a5616010f38b8967db197
125
+A    /boot/initramfs-4.0.9.img-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
126
+A    /boot/vmlinuz-4.0.9-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
127
+A    /usr/bin/awk
128
+A    /usr/bin/gawk
129
+A    /usr/bin/gawk-4.1.0
130
+A    /usr/bin/igawk
131
+A    /usr/bin/sudo
132
+A    /usr/bin/sudoedit
133
+A    /usr/bin/sudoreplay
134
+A    /usr/bin/wget
135
+A    /usr/etc/pam.d/sudo
136
+A    /usr/etc/group.rpmnew
137
+A    /usr/etc/passwd.rpmnew
138
+A    /usr/etc/sudoers
139
+A    /usr/etc/wgetrc
140
+A    /usr/etc/sudoers.d
141
+A    /usr/include/gawkapi.h
142
+A    /usr/include/sudo_plugin.h
143
+A    /usr/lib/ostree-boot/initramfs-4.0.9.img-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
144
+A    /usr/lib/ostree-boot/vmlinuz-4.0.9-334842d15b642e70fac149bd5bbb7dd48965a3aca9da6a42d289a267a142f32f
145
+A    /usr/lib/gawk
146
+A    /usr/lib/gawk/filefuncs.so
147
+A    /usr/lib/gawk/fnmatch.so
148
+A    /usr/lib/gawk/fork.so
149
+A    /usr/lib/gawk/inplace.so
150
+A    /usr/lib/gawk/ordchr.so
151
+A    /usr/lib/gawk/readdir.so
152
+A    /usr/lib/gawk/readfile.so
153
+A    /usr/lib/gawk/revoutput.so
154
+A    /usr/lib/gawk/revtwoway.so
155
+A    /usr/lib/gawk/rwarray.so
156
+A    /usr/lib/gawk/testext.so
157
+A    /usr/lib/gawk/time.so
158
+A    /usr/lib/sudo
159
+A    /usr/lib/sudo/group_file.so
160
+A    /usr/lib/sudo/libsudo_util.so
161
+A    /usr/lib/sudo/libsudo_util.so.0
162
+A    /usr/lib/sudo/libsudo_util.so.0.0.0
163
+A    /usr/lib/sudo/sudo_noexec.so
164
+A    /usr/lib/sudo/sudoers.so
165
+A    /usr/lib/sudo/system_group.so
166
+A    /usr/libexec/awk
167
+A    /usr/libexec/awk/grcat
168
+A    /usr/libexec/awk/pwcat
169
+A    /usr/sbin/visudo
170
+A    /usr/share/doc/gawk-4.1.0
171
+A    /usr/share/doc/gawk-4.1.0/api-figure1.eps
172
+A    /usr/share/doc/gawk-4.1.0/api-figure1.pdf
173
+A    /usr/share/doc/gawk-4.1.0/api-figure2.eps
174
+A    /usr/share/doc/gawk-4.1.0/api-figure2.pdf
175
+A    /usr/share/doc/gawk-4.1.0/api-figure3.eps
176
+A    /usr/share/doc/gawk-4.1.0/api-figure3.pdf
177
+A    /usr/share/doc/gawk-4.1.0/awkforai.txt
178
+A    /usr/share/doc/gawk-4.1.0/general-program.eps
179
+A    /usr/share/doc/gawk-4.1.0/general-program.pdf
180
+A    /usr/share/doc/gawk-4.1.0/lflashlight.eps
181
+A    /usr/share/doc/gawk-4.1.0/lflashlight.pdf
182
+A    /usr/share/doc/gawk-4.1.0/process-flow.eps
183
+A    /usr/share/doc/gawk-4.1.0/process-flow.pdf
184
+A    /usr/share/doc/gawk-4.1.0/rflashlight.eps
185
+A    /usr/share/doc/gawk-4.1.0/rflashlight.pdf
186
+A    /usr/share/doc/gawk-4.1.0/statist.eps
187
+A    /usr/share/doc/gawk-4.1.0/statist.jpg
188
+A    /usr/share/doc/gawk-4.1.0/statist.pdf
189
+A    /usr/share/doc/sudo-1.8.11p1
190
+A    /usr/share/doc/sudo-1.8.11p1/CONTRIBUTORS
191
+A    /usr/share/doc/sudo-1.8.11p1/ChangeLog
192
+A    /usr/share/doc/sudo-1.8.11p1/HISTORY
193
+A    /usr/share/doc/sudo-1.8.11p1/LICENSE
194
+A    /usr/share/doc/sudo-1.8.11p1/NEWS
195
+A    /usr/share/doc/sudo-1.8.11p1/README
196
+A    /usr/share/doc/sudo-1.8.11p1/TROUBLESHOOTING
197
+A    /usr/share/doc/sudo-1.8.11p1/UPGRADE
198
+A    /usr/share/doc/sudo-1.8.11p1/sample.pam
199
+A    /usr/share/doc/sudo-1.8.11p1/sample.sudo.conf
200
+A    /usr/share/doc/sudo-1.8.11p1/sample.sudoers
201
+A    /usr/share/doc/sudo-1.8.11p1/sample.syslog.conf
202
+A    /usr/share/locale/be/LC_MESSAGES/wget.mo
203
+A    /usr/share/locale/bg/LC_MESSAGES/wget.mo
204
+A    /usr/share/locale/ca/LC_MESSAGES/sudo.mo
205
+A    /usr/share/locale/ca/LC_MESSAGES/sudoers.mo
206
+A    /usr/share/locale/ca/LC_MESSAGES/wget.mo
207
+A    /usr/share/locale/cs/LC_MESSAGES/sudo.mo
208
+A    /usr/share/locale/cs/LC_MESSAGES/sudoers.mo
209
+A    /usr/share/locale/cs/LC_MESSAGES/wget.mo
210
+A    /usr/share/locale/da/LC_MESSAGES/gawk.mo
211
+A    /usr/share/locale/da/LC_MESSAGES/sudo.mo
212
+A    /usr/share/locale/da/LC_MESSAGES/sudoers.mo
213
+A    /usr/share/locale/da/LC_MESSAGES/wget.mo
214
+A    /usr/share/locale/de/LC_MESSAGES/gawk.mo
215
+A    /usr/share/locale/de/LC_MESSAGES/sudo.mo
216
+A    /usr/share/locale/de/LC_MESSAGES/sudoers.mo
217
+A    /usr/share/locale/de/LC_MESSAGES/wget.mo
218
+A    /usr/share/locale/el/LC_MESSAGES/sudoers.mo
219
+A    /usr/share/locale/el/LC_MESSAGES/wget.mo
220
+A    /usr/share/locale/en_GB/LC_MESSAGES/wget.mo
221
+A    /usr/share/locale/eo/LC_MESSAGES/sudo.mo
222
+A    /usr/share/locale/eo/LC_MESSAGES/sudoers.mo
223
+A    /usr/share/locale/eo/LC_MESSAGES/wget.mo
224
+A    /usr/share/locale/es/LC_MESSAGES/gawk.mo
225
+A    /usr/share/locale/es/LC_MESSAGES/sudo.mo
226
+A    /usr/share/locale/es/LC_MESSAGES/wget.mo
227
+A    /usr/share/locale/et/LC_MESSAGES/wget.mo
228
+A    /usr/share/locale/eu/LC_MESSAGES/sudo.mo
229
+A    /usr/share/locale/eu/LC_MESSAGES/sudoers.mo
230
+A    /usr/share/locale/eu/LC_MESSAGES/wget.mo
231
+A    /usr/share/locale/fi/LC_MESSAGES/gawk.mo
232
+A    /usr/share/locale/fi/LC_MESSAGES/sudo.mo
233
+A    /usr/share/locale/fi/LC_MESSAGES/sudoers.mo
234
+A    /usr/share/locale/fi/LC_MESSAGES/wget.mo
235
+A    /usr/share/locale/fr/LC_MESSAGES/gawk.mo
236
+A    /usr/share/locale/fr/LC_MESSAGES/sudo.mo
237
+A    /usr/share/locale/fr/LC_MESSAGES/wget.mo
238
+A    /usr/share/locale/ga/LC_MESSAGES/wget.mo
239
+A    /usr/share/locale/gl/LC_MESSAGES/sudo.mo
240
+A    /usr/share/locale/gl/LC_MESSAGES/wget.mo
241
+A    /usr/share/locale/he/LC_MESSAGES/wget.mo
242
+A    /usr/share/locale/hr/LC_MESSAGES/sudo.mo
243
+A    /usr/share/locale/hr/LC_MESSAGES/sudoers.mo
244
+A    /usr/share/locale/hr/LC_MESSAGES/wget.mo
245
+A    /usr/share/locale/hu/LC_MESSAGES/wget.mo
246
+A    /usr/share/locale/id/LC_MESSAGES/wget.mo
247
+A    /usr/share/locale/it/LC_MESSAGES/gawk.mo
248
+A    /usr/share/locale/it/LC_MESSAGES/sudo.mo
249
+A    /usr/share/locale/it/LC_MESSAGES/sudoers.mo
250
+A    /usr/share/locale/it/LC_MESSAGES/wget.mo
251
+A    /usr/share/locale/ja/LC_MESSAGES/gawk.mo
252
+A    /usr/share/locale/ja/LC_MESSAGES/sudo.mo
253
+A    /usr/share/locale/ja/LC_MESSAGES/sudoers.mo
254
+A    /usr/share/locale/ja/LC_MESSAGES/wget.mo
255
+A    /usr/share/locale/lt/LC_MESSAGES/sudoers.mo
256
+A    /usr/share/locale/lt/LC_MESSAGES/wget.mo
257
+A    /usr/share/locale/ms/LC_MESSAGES/gawk.mo
258
+A    /usr/share/locale/nb/LC_MESSAGES/sudo.mo
259
+A    /usr/share/locale/nb/LC_MESSAGES/sudoers.mo
260
+A    /usr/share/locale/nb/LC_MESSAGES/wget.mo
261
+A    /usr/share/locale/nl/LC_MESSAGES/gawk.mo
262
+A    /usr/share/locale/nl/LC_MESSAGES/sudo.mo
263
+A    /usr/share/locale/nl/LC_MESSAGES/sudoers.mo
264
+A    /usr/share/locale/nl/LC_MESSAGES/wget.mo
265
+A    /usr/share/locale/pl/LC_MESSAGES/gawk.mo
266
+A    /usr/share/locale/pl/LC_MESSAGES/sudo.mo
267
+A    /usr/share/locale/pl/LC_MESSAGES/sudoers.mo
268
+A    /usr/share/locale/pl/LC_MESSAGES/wget.mo
269
+A    /usr/share/locale/pt/LC_MESSAGES/wget.mo
270
+A    /usr/share/locale/pt_BR/LC_MESSAGES/sudo.mo
271
+A    /usr/share/locale/pt_BR/LC_MESSAGES/sudoers.mo
272
+A    /usr/share/locale/pt_BR/LC_MESSAGES/wget.mo
273
+A    /usr/share/locale/ro/LC_MESSAGES/wget.mo
274
+A    /usr/share/locale/ru/LC_MESSAGES/sudo.mo
275
+A    /usr/share/locale/ru/LC_MESSAGES/wget.mo
276
+A    /usr/share/locale/sk/LC_MESSAGES/wget.mo
277
+A    /usr/share/locale/sl/LC_MESSAGES/sudo.mo
278
+A    /usr/share/locale/sl/LC_MESSAGES/sudoers.mo
279
+A    /usr/share/locale/sl/LC_MESSAGES/wget.mo
280
+A    /usr/share/locale/sr/LC_MESSAGES/sudo.mo
281
+A    /usr/share/locale/sr/LC_MESSAGES/sudoers.mo
282
+A    /usr/share/locale/sr/LC_MESSAGES/wget.mo
283
+A    /usr/share/locale/sv/LC_MESSAGES/gawk.mo
284
+A    /usr/share/locale/sv/LC_MESSAGES/sudo.mo
285
+A    /usr/share/locale/sv/LC_MESSAGES/sudoers.mo
286
+A    /usr/share/locale/sv/LC_MESSAGES/wget.mo
287
+A    /usr/share/locale/tr/LC_MESSAGES/sudo.mo
288
+A    /usr/share/locale/tr/LC_MESSAGES/sudoers.mo
289
+A    /usr/share/locale/tr/LC_MESSAGES/wget.mo
290
+A    /usr/share/locale/uk/LC_MESSAGES/sudo.mo
291
+A    /usr/share/locale/uk/LC_MESSAGES/sudoers.mo
292
+A    /usr/share/locale/uk/LC_MESSAGES/wget.mo
293
+A    /usr/share/locale/vi/LC_MESSAGES/gawk.mo
294
+A    /usr/share/locale/vi/LC_MESSAGES/sudo.mo
295
+A    /usr/share/locale/vi/LC_MESSAGES/sudoers.mo
296
+A    /usr/share/locale/vi/LC_MESSAGES/wget.mo
297
+A    /usr/share/locale/zh_CN/LC_MESSAGES/sudo.mo
298
+A    /usr/share/locale/zh_CN/LC_MESSAGES/sudoers.mo
299
+A    /usr/share/locale/zh_CN/LC_MESSAGES/wget.mo
300
+A    /usr/share/locale/zh_TW/LC_MESSAGES/wget.mo
301
+A    /usr/share/man/man1/gawk.1.gz
302
+A    /usr/share/man/man1/igawk.1.gz
303
+A    /usr/share/man/man1/wget.1.gz
304
+A    /usr/share/man/man3/filefuncs.3am.gz
305
+A    /usr/share/man/man3/fnmatch.3am.gz
306
+A    /usr/share/man/man3/fork.3am.gz
307
+A    /usr/share/man/man3/ordchr.3am.gz
308
+A    /usr/share/man/man3/readdir.3am.gz
309
+A    /usr/share/man/man3/readfile.3am.gz
310
+A    /usr/share/man/man3/revoutput.3am.gz
311
+A    /usr/share/man/man3/revtwoway.3am.gz
312
+A    /usr/share/man/man3/rwarray.3am.gz
313
+A    /usr/share/man/man3/time.3am.gz
314
+A    /usr/share/man/man5/sudo.conf.5.gz
315
+A    /usr/share/man/man5/sudoers.5.gz
316
+A    /usr/share/man/man8/sudo.8.gz
317
+A    /usr/share/man/man8/sudo_plugin.8.gz
318
+A    /usr/share/man/man8/sudoedit.8.gz
319
+A    /usr/share/man/man8/sudoreplay.8.gz
320
+A    /usr/share/man/man8/visudo.8.gz
321
+A    /usr/share/awk
322
+A    /usr/share/awk/assert.awk
323
+A    /usr/share/awk/bits2str.awk
324
+A    /usr/share/awk/cliff_rand.awk
325
+A    /usr/share/awk/ctime.awk
326
+A    /usr/share/awk/ftrans.awk
327
+A    /usr/share/awk/getopt.awk
328
+A    /usr/share/awk/gettime.awk
329
+A    /usr/share/awk/group.awk
330
+A    /usr/share/awk/inplace.awk
331
+A    /usr/share/awk/join.awk
332
+A    /usr/share/awk/libintl.awk
333
+A    /usr/share/awk/noassign.awk
334
+A    /usr/share/awk/ord.awk
335
+A    /usr/share/awk/passwd.awk
336
+A    /usr/share/awk/quicksort.awk
337
+A    /usr/share/awk/readable.awk
338
+A    /usr/share/awk/rewind.awk
339
+A    /usr/share/awk/round.awk
340
+A    /usr/share/awk/strtonum.awk
341
+A    /usr/share/awk/walkarray.awk
342
+A    /usr/share/awk/zerofile.awk
343
+```
344
+ 
345
+### 5.4 Listing package differences
346
+We can also look at package differences, as you expect, using the right tool for the job.
347
+```
348
+root@photon-host-def [ ~ ]# rpm-ostree db diff 2940 82bc    
349
+ostree diff commit old: 2940 (2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8)
350
+ostree diff commit new: 82bc (82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817)
351
+Added:
352
+ gawk-4.1.0-2.ph1.x86_64
353
+ sudo-1.8.11p1-4.ph1.x86_64
354
+ wget-1.15-1.ph1.x86_64
355
+```
356
+
357
+### 5.5 Rollback
358
+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.
359
+```
360
+root@photon-host-def [ ~ ]# rpm-ostree rollback
361
+Moving '2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0' to be first deployment
362
+Transaction complete; bootconfig swap: yes deployment count change: 0
363
+Removed:
364
+  gawk-4.1.0-2.ph1.x86_64
365
+  sudo-1.8.11p1-4.ph1.x86_64
366
+  wget-1.15-1.ph1.x86_64
367
+Successfully reset deployment order; run "systemctl reboot" to start a reboot
368
+```
369
+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.  
370
+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.  
371
+
372
+![grub-boot-0-1](https://cloud.githubusercontent.com/assets/13158414/9673725/3d33162a-525c-11e5-8292-5b79c48e0c6b.png)  
373
+The boot order moved back to original:
374
+```
375
+root@photon-host-def [ ~ ]# rpm-ostree status
376
+  TIMESTAMP (UTC)       VERSION             ID           OSNAME   REFSPEC                              
377
+* 2015-08-20 22:27:43   1.0_minimal     2940e10c4d   photon   photon:photon/1.0/x86_64/minimal     
378
+  2015-09-03 00:34:41   1.0_minimal.1   82bca728ea   photon   photon:photon/1.0/x86_64/minimal   
379
+```
380
+The current bootable image path moved also back to the original value:
381
+```
382
+root@photon-host-def [ ~ ]# ostree admin config-diff --print-current-dir
383
+/ostree/deploy/photon/deploy/2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0 
384
+```
385
+
386
+### 5.6 Deleting a deployed filetree
387
+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.  
388
+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).  
389
+You cannot delete the default bootable filetree, so passing 0 will result in an error.  
390
+```
391
+root@photon-host-def [ ~ ]# ostree admin undeploy -v 1
392
+OT: Using bootloader: OstreeBootloaderGrub2
393
+Transaction complete; bootconfig swap: yes deployment count change: -1
394
+Deleted deployment 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.0
395
+
396
+root@photon-host-cus1 [ ~ ]# ostree admin undeploy -v 0
397
+error: Cannot undeploy currently booted deployment 0
398
+```
399
+Now, we can see that the newer image is gone, the deployment directory for commit 82bc has been removed.  
400
+```
401
+root@photon-host-def [ ~ ]# rpm-ostree status
402
+  TIMESTAMP (UTC)        VERSION        ID            OSNAME    REFSPEC                              
403
+* 2015-08-20 22:27:43    1.0_minimal    2940e10c4d    photon    photon:photon/1.0/x86_64/minimal 
404
+root@photon-host-cus1 [ ~ ]# ls /ostree/deploy/photon/deploy/                                        
405
+2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0
406
+2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8.0.origin   
407
+```
408
+However the commit is still there in the OSTree repo.
409
+```
410
+root@photon-host-def [ ~ ]# ostree log 82bc                 
411
+commit 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817
412
+Date:  2015-09-03 00:34:41 +0000
413
+Version: 1.0_minimal.1
414
+
415
+
416
+commit 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8
417
+Date:  2015-08-20 22:27:43 +0000
418
+Version: 1.0_minimal
419
+```
420
+But there is nothing to rollback to.
421
+```
422
+root@photon-host-def [ ~ ]# rpm-ostree rollback
423
+error: Found 1 deployments, at least 2 required for rollback
424
+```
425
+If we were to upgrade again, it would bring these packages back, but let's just check the differeneces.
426
+```
427
+root@photon-host-def [ ~ ]# rpm-ostree upgrade --check-diff
428
+Updating from: photon:photon/1.0/x86_64/minimal
429
+
430
+
431
++gawk-4.1.0-2.ph1.x86_64
432
++sudo-1.8.11p1-4.ph1.x86_64
433
++wget-1.15-1.ph1.x86_64
434
+```
435
+
436
+### 5.7 Version skipping upgrade
437
+
438
+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.
439
+```
440
+root@photon-host-def [ ~ ]# rpm-ostree upgrade --check-diff
441
+Updating from: photon:photon/1.0/x86_64/minimal
442
+
443
+7 metadata, 13 content objects fetched; 1287 KiB transferred in 0 seconds
444
++bison-3.0.2-2.ph1.x86_64
445
++gawk-4.1.0-2.ph1.x86_64
446
++tar-1.27.1-1.ph1.x86_64
447
++wget-1.15-1.ph1.x86_64
448
+
449
+root@photon-host-def [ ~ ]# rpm-ostree upgrade -r          
450
+Updating from: photon:photon/1.0/x86_64/minimal
451
+
452
+107 metadata, 512 content objects fetched; 13064 KiB transferred in 1 seconds
453
+Copying /etc changes: 5 modified, 0 removed, 16 added
454
+Transaction complete; bootconfig swap: yes deployment count change: 1
455
+Freed objects: 19.3 MB
456
+```
457
+After reboot, let's check the booting filetrees, the current dir for the current filetree and look at commit differences:
458
+```
459
+root@photon-host-def [ ~ ]# rpm-ostree status 
460
+  TIMESTAMP (UTC)        VERSION          ID            OSNAME    REFSPEC                              
461
+* 2015-09-04 00:36:37    1.0_minimal.2    092e21d292    photon    photon:photon/1.0/x86_64/minimal
462
+  2015-08-20 22:27:43    1.0_minimal      2940e10c4d    photon    photon:photon/1.0/x86_64/minimal
463
+
464
+root@photon-host-cus1 [ ~ ]# ostree admin config-diff --print-current-dir
465
+/ostree/deploy/photon/deploy/092e21d2928090d507ce711d482e4402e310b5a7f46532c5e24e0789590d0373.0
466
+
467
+root@photon-host-cus1 [ ~ ]# rpm-ostree db diff  2940 092e
468
+ostree diff commit old: 2940 (2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8)
469
+ostree diff commit new: 092e (092e21d2928090d507ce711d482e4402e310b5a7f46532c5e24e0789590d0373)
470
+Added:
471
+ bison-3.0.2-2.ph1.x86_64
472
+ gawk-4.1.0-2.ph1.x86_64
473
+ tar-1.27.1-1.ph1.x86_64
474
+ wget-1.15-1.ph1.x86_64
475
+
476
+root@photon-host-cus1 [ ~ ]# rpm-ostree db diff  82bc 092e
477
+error: Refspec '82bc' not found
478
+```
479
+Interesting fact: The metadata for commit 82bc has been removed from the local repo!  
480
+
481
+### 5.8 Tracking parent commits
482
+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:
483
+```
484
+root@photon-host-def [ ~ ]# rpm-ostree db diff  092e^ 092e
485
+error: No such metadata object 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.commit
486
+error: Refspec '82cb' not found
487
+root@photon-host-def [ ~ ]# rpm-ostree db diff  092e^^ 092e
488
+error: No such metadata object 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.commit
489
+````
490
+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.
491
+
492
+### 5.9 Resetting a branch to a previous commit
493
+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).
494
+```
495
+root@photon-host-def [ ~ ]# ostree reset photon:photon/1.0/x86_64/minimal 2940
496
+```
497
+Now if wee look again at the branch commit history, the head is at version 0.  
498
+```
499
+root@photon-host-def [ ~ ]# ostree log photon/1.0/x86_64/minimal
500
+commit 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8
501
+Date:  2015-08-20 22:27:43 +0000
502
+Version: 1.0_minimal
503
+```
504
+
505
+[[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 506
\ No newline at end of file
1 507
new file mode 100644
... ...
@@ -0,0 +1,48 @@
0
+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.  
1
+
2
+The first step is to download the ISO for the desired release, if you have not done that already:  
3
+[[Photon 1.0 GA ISO file|https://bintray.com/artifact/download/vmware/photon/photon-1.0-13c08b6.iso]]  
4
+[[Photon 1.0 Rev2 ISO file|https://bintray.com/artifact/download/vmware/photon/photon-1.0-62c543d.iso]]  
5
+[[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]]  
6
+
7
+Installation steps are the same to all Photon OS versions, except that under the hood:
8
+* Photon 1.0 sets up a 'minimal' sample file tree, so it's ready to accept host pull/install requests right away.
9
+* 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.  
10
+
11
+### 6.1 Manual install of a server
12
+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.
13
+
14
+![PhotonChooseServer](https://cloud.githubusercontent.com/assets/13158414/14802949/1c5f92b8-0b0a-11e6-8d69-96e62218dfcb.png)
15
+
16
+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.  
17
+
18
+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. 
19
+
20
+![PhotonServerLogin](https://cloud.githubusercontent.com/assets/13158414/14802957/2f5ed7e8-0b0a-11e6-960d-04c6202b0c4e.png)
21
+
22
+
23
+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.  
24
+
25
+The server's IP address will be passed to the Photon RPM-OSTree hosts that want to connect to this server.  
26
+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.
27
+
28
+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]]. 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.
29
+
30
+### 6.2 Composing your first OSTree repo  
31
+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.
32
+```
33
+root [ ~ ]# cd /srv/rpm-ostree
34
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2
35
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
36
+```
37
+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]] and [[Chapter 9: Package oriented server operations|Photon-RPM-OSTree:-9-Package-oriented-server-operations]] to learn create your own customized file tree.   
38
+
39
+### 6.2 Automated install of a server via kickstart
40
+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.
41
+
42
+If not familiar with the way kickstart works, visit [[Kickstart Support in Photon OS|https://github.com/vmware/photon/blob/master/docs/kickstart.md]]. The kickstart json config for OSTree is similar to minimal or full, except for this setting:  
43
+```
44
+"type": "ostree_server"
45
+```
46
+
47
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-5-Host-updating-operations]] | [[Next page >|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository]]
0 48
\ No newline at end of file
1 49
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+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.
1
+
2
+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.
3
+
4
+### 7.1 Manual install of a custom host
5
+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]].  
6
+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".  
7
+
8
+![PhotonHostCustom](https://cloud.githubusercontent.com/assets/13158414/14804629/fe17c7d4-0b19-11e6-9cc6-7e79f768b7b1.png)
9
+
10
+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]].  
11
+
12
+![PhotonHostCustomURL](https://cloud.githubusercontent.com/assets/13158414/14804647/185f1aa2-0b1a-11e6-9e44-e2f54592da35.png)
13
+
14
+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).  
15
+
16
+![PhotonHostCustomRefspec](https://cloud.githubusercontent.com/assets/13158414/14804653/1f0d31cc-0b1a-11e6-8f56-e8cac1f72852.png)
17
+
18
+Once this is done and the installation finished, reboot and you are ready to use it.  
19
+You may verify - just like in [[Chapter 3.1|Photon-RPM-OStree:-3-Concepts-in-action#31-querying-the-deployed-filetrees]] - 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]], if the [[server|Photon-RPM-OSTree:-6-Installing-a-server]] has been installed fresh, from the same ISO.  
20
+
21
+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.
22
+
23
+### 7.2 Automated install of a custom host via kickstart
24
+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.  
25
+
26
+If not familiar with the way kickstart works, visit [[Kickstart Support in Photon OS|https://github.com/vmware/photon/blob/master/docs/kickstart.md]]. The kickstart json config for OSTree is similar to minimal or full, except for these settings that should sound familiar: 
27
+```
28
+    ...
29
+    "type": "ostree_host",
30
+    "ostree_repo_url": "http://192.168.218.249",
31
+    "ostree_repo_ref": "photon/1.0/x86_64/minimal",
32
+    ...
33
+```
34
+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**.
35
+
36
+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. 
37
+
38
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous Page|Photon-RPM-OSTree:-6-Installing-a-server]] | [[Next page >|Photon-RPM-OStree:-8-File-oriented-server-operations]]
0 39
\ No newline at end of file
1 40
new file mode 100644
... ...
@@ -0,0 +1,322 @@
0
+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]] one), 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.   
1
+The simplest way to explain is to take a look at the files installed by the Photon RPM-OSTree server during setup.  
2
+```  
3
+root [ ~ ]# cd /srv/rpm-ostree/
4
+root [ /srv/rpm-ostree ]# ls -l
5
+total 16
6
+lrwxrwxrwx 1 root root   31 Aug 28 19:06 lightwave-ostree.repo -> /etc/yum.repos.d/lightwave.repo
7
+-rw-r--r-- 1 root root 7356 Aug 28 19:06 ostree-httpd.conf
8
+-rw-r--r-- 1 root root 1085 Aug 28 19:06 photon-base.json
9
+lrwxrwxrwx 1 root root   35 Aug 28 19:06 photon-extras-ostree.repo -> /etc/yum.repos.d/photon-extras.repo
10
+lrwxrwxrwx 1 root root   32 Aug 28 19:06 photon-iso-ostree.repo -> /etc/yum.repos.d/photon-iso.repo
11
+lrwxrwxrwx 1 root root   28 Aug 28 19:06 photon-ostree.repo -> /etc/yum.repos.d/photon.repo
12
+lrwxrwxrwx 1 root root   36 Aug 28 19:06 photon-updates-ostree.repo -> /etc/yum.repos.d/photon-updates.repo
13
+drwxr-xr-x 7 root root 4096 Aug 20 22:27 repo
14
+```
15
+### 9.1 JSON configuration file
16
+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.  
17
+```
18
+root [ /srv/rpm-ostree ]# cat photon-base.json 
19
+{
20
+    "comment": "Photon Minimal OSTree",
21
+
22
+    "osname": "photon",
23
+
24
+    "ref": "photon/1.0/x86_64/minimal",
25
+
26
+    "automatic_version_prefix": "1.0_minimal",
27
+
28
+    "repos": ["photon"],
29
+
30
+    "selinux": false,
31
+
32
+    "initramfs-args": ["--no-hostonly"],
33
+
34
+    "bootstrap_packages": ["filesystem"],
35
+
36
+    "packages": ["glibc", "zlib", "binutils", "gmp", "mpfr", "libgcc", "libstdc++","libgomp",
37
+                "pkg-config", "ncurses", "bash", "bzip2", "cracklib", "cracklib-dicts", "shadow",
38
+                "procps-ng", "iana-etc", "readline", "coreutils", "bc", "libtool", "inetutils",
39
+                "findutils", "xz", "grub2", "iproute2", "util-linux", "linux",
40
+                "attr", "libcap", "kmod", "expat", "dbus", "file",
41
+                "sed", "grep", "cpio", "gzip",
42
+                "openssl", "ca-certificates", "curl",
43
+                "systemd",
44
+                "openssh", "iptables",
45
+                "photon-release",
46
+                "vim", "tdnf",
47
+                "docker","bridge-utils",
48
+                "dracut", "dracut-tools", "rpm-ostree", "nss-altfiles", "which"]
49
+}
50
+``` 
51
+There are some mandatory settings, some optional. I'm only going to explain the most important ones for our use case.  
52
+**osname** and **ref** should be familiar, they have been explained in previous sections [[OSname|Photon-RPM-OStree:-3-Concepts-in-action#34-osname]] and [[Refspec|Photon-RPM-OStree:-3-Concepts-in-action#35-refspec]]. Basicaly, we are asking `rpm-ostree` to compose a tree for photon OS and photon/1.0/x86_64/minimal branch.
53
+
54
+### 9.2 Package addition, removal, upgrade 
55
+**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. 
56
+Let's add to the list three new packages: gawk, sudo and wget using `vim photon-base.json`
57
+
58
+**!!!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.**
59
+
60
+### 9.3 RPMS repository
61
+But where are these packages located? RPM-OStree uses the same standard RPMS repositories, that yum installs from.
62
+``` 
63
+root [ /srv/rpm-ostree ]# ls /etc/yum.repos.d/
64
+lightwave.repo  photon-iso.repo  photon-updates.repo  photon.repo
65
+```
66
+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.
67
+``` 
68
+root [ /srv/rpm-ostree ]# cat /etc/yum.repos.d/photon.repo 
69
+[photon]
70
+name=VMware Photon Linux 1.0(x86_64)
71
+baseurl=https://dl.bintray.com/vmware/photon_release_1.0_x86_64
72
+gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY
73
+gpgcheck=1
74
+enabled=1
75
+skip_if_unavailable=True
76
+```
77
+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.
78
+
79
+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:
80
+* noarch - where all packages that don't depend on the architecture reside. Those may contain scripts, platform neutral source files, configuration.
81
+* x86_64 - platform dependent packages for Intel 32 and 64 bits CPUs.
82
+* 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.
83
+
84
+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.
85
+```
86
+root [ /srv/rpm-ostree ]# mount /dev/cdrom
87
+root [ /srv/rpm-ostree ]# ls /mnt/cdrom/RPMS
88
+noarch  repodata  x86_64
89
+```
90
+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. 
91
+
92
+_**Note**_: Check from time to time if the [[known issue|Photon-RPM-OSTree:-Appendix-A:-Known-issues#error-composing-when-photon-iso-repo-is-selected]] has been fixed.
93
+```
94
+root [ /srv/rpm-ostree ]# cat /etc/yum.repos.d/photon-iso.repo 
95
+[photon-iso]
96
+name=VMWare Photon Linux 1.0(x86_64)
97
+baseurl=file:///mnt/cdrom/RPMS
98
+gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY
99
+gpgcheck=1
100
+enabled=0
101
+skip_if_unavailable=True
102
+```
103
+
104
+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. 
105
+
106
+
107
+### 9.4 Composing a tree
108
+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.
109
+```
110
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
111
+Previous commit: 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8
112
+
113
+Downloading metadata [=========================================================================] 100%
114
+
115
+Transaction: 117 packages
116
+  Linux-PAM-1.1.8-2.ph1.x86_64
117
+  attr-2.4.47-1.ph1.x86_64
118
+  ...
119
+  gawk-4.1.0-2.ph1.x86_64
120
+  ...
121
+  sudo-1.8.11p1-4.ph1.x86_64
122
+  ...
123
+  wget-1.15-1.ph1.x86_64
124
+  which-2.20-1.ph1.x86_64
125
+  xz-5.0.5-2.ph1.x86_64
126
+  zlib-1.2.8-2.ph1.x86_64
127
+Installing packages [==========================================================================] 100%
128
+Writing '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/usr/share/rpm-ostree/treefile.json'
129
+Preparing kernel
130
+Creating empty machine-id
131
+Executing: /usr/bin/dracut -v --tmpdir=/tmp -f /var/tmp/initramfs.img 4.0.9 --no-hostonly
132
+...
133
+*** Including module: bash ***
134
+*** Including module: kernel-modules ***
135
+*** Including module: resume ***
136
+*** Including module: rootfs-block ***
137
+*** Including module: terminfo ***
138
+*** Including module: udev-rules ***
139
+Skipping udev rule: 91-permissions.rules
140
+Skipping udev rule: 80-drivers-modprobe.rules
141
+*** Including module: ostree ***
142
+*** Including module: systemd ***
143
+*** Including module: usrmount ***
144
+*** Including module: base ***
145
+/etc/os-release: line 1: Photon: command not found
146
+*** Including module: fs-lib ***
147
+*** Including module: shutdown ***
148
+*** Including modules done ***
149
+*** Installing kernel module dependencies and firmware ***
150
+*** Installing kernel module dependencies and firmware done ***
151
+*** Resolving executable dependencies ***
152
+*** Resolving executable dependencies done***
153
+*** Stripping files ***
154
+*** Stripping files done ***
155
+*** Store current command line parameters ***
156
+*** Creating image file ***
157
+*** Creating image file done ***
158
+Image: /var/tmp/initramfs.img: 11M
159
+========================================================================
160
+Version: dracut-041-1.ph1
161
+
162
+Arguments: -v --tmpdir '/tmp' -f --no-hostonly
163
+
164
+dracut modules:
165
+bash
166
+kernel-modules
167
+resume
168
+rootfs-block
169
+terminfo
170
+udev-rules
171
+ostree
172
+systemd
173
+usrmount
174
+base
175
+fs-lib
176
+shutdown
177
+========================================================================
178
+drwxr-xr-x  12 root     root            0 Sep  1 00:52 .
179
+crw-r--r--   1 root     root       5,   1 Sep  1 00:52 dev/console
180
+crw-r--r--   1 root     root       1,  11 Sep  1 00:52 dev/kmsg
181
+...   (long list of files removed)
182
+========================================================================
183
+Initializing rootfs
184
+Migrating /etc/passwd to /usr/lib/
185
+Migrating /etc/group to /usr/lib/
186
+Moving /usr to target
187
+Linking /usr/local -> ../var/usrlocal
188
+Moving /etc to /usr/etc
189
+Placing RPM db in /usr/share/rpm
190
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/lib/nss_db/Makefile'
191
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/cache/ldconfig/aux-cache'
192
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/btmp'
193
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/lastlog'
194
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/wtmp'
195
+Moving /boot
196
+Using boot location: both
197
+Copying toplevel compat symlinks
198
+Adding tmpfiles-ostree-integration.conf
199
+Committing '/var/tmp/rpm-ostree.TVO089/rootfs.tmp' ...
200
+photon/1.0/x86_64/minimal => c505f4bddb4381e8b5213682465f1e5bb150a18228aa207d763cea45c6a81bbe
201
+```
202
+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.  
203
+
204
+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:
205
+```
206
+root [ /srv/rpm-ostree ]# ls /var/tmp/rpm-ostree.TVO089/rootfs.tmp
207
+bin   dev   lib    media  opt     proc  run   srv  sysroot  usr
208
+boot  home  lib64  mnt    ostree  root  sbin  sys  tmp      var
209
+```
210
+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.
211
+```
212
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
213
+Previous commit: c505f4bddb4381e8b5213682465f1e5bb150a18228aa207d763cea45c6a81bbe
214
+
215
+Downloading metadata [=========================================================================] 100%
216
+
217
+
218
+No apparent changes since previous commit; use --force-nocache to override
219
+```
220
+
221
+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. 
222
+
223
+
224
+### 9.5 Automatic version prefix
225
+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.  
226
+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!  
227
+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"`.
228
+
229
+
230
+### 9.6 Installing package updates
231
+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. 
232
+```
233
+"repos": ["photon", "photon-updates"],
234
+```
235
+
236
+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.
237
+```
238
+root [ ~ ]# rpm-ostree upgrade --check-diff
239
+Updating from: photon:photon/1.0/x86_64/minimal
240
+
241
+8 metadata, 13 content objects fetched; 1002 KiB transferred in 0 seconds
242
+!bridge-utils-1.5-2.ph1.x86_64
243
+=bridge-utils-1.5-3.ph1.x86_64
244
+!bzip2-1.0.6-5.ph1.x86_64
245
+=bzip2-1.0.6-6.ph1.x86_64
246
+!curl-7.47.1-2.ph1.x86_64
247
+=curl-7.51.0-2.ph1.x86_64
248
+!docker-1.11.0-5.ph1.x86_64
249
+=docker-1.12.1-1.ph1.x86_64
250
+...
251
++libssh2-1.8.0-1.ph1.x86_64
252
+...
253
+
254
+root [ ~ ]# rpm-ostree upgrade             
255
+Updating from: photon:photon/1.0/x86_64/minimal
256
+
257
+258 metadata, 1165 content objects fetched; 76893 KiB transferred in 8 seconds
258
+Copying /etc changes: 6 modified, 0 removed, 14 added
259
+Transaction complete; bootconfig swap: yes deployment count change: 1
260
+Changed:
261
+  bridge-utils 1.5-2.ph1 -> 1.5-3.ph1
262
+  bzip2 1.0.6-5.ph1 -> 1.0.6-6.ph1
263
+  curl 7.47.1-2.ph1 -> 7.51.0-2.ph1
264
+  docker 1.11.0-5.ph1 -> 1.12.1-1.ph1
265
+  ...
266
+Added:
267
+  libssh2-1.8.0-1.ph1.x86_64
268
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot
269
+```
270
+
271
+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.
272
+
273
+```
274
+root [ ~ ]# rpm-ostree db diff 56ef 396e
275
+ostree diff commit old: 56e (56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4)
276
+ostree diff commit new: 396 (396e1116ad94692b8c105edaee4fa12447ec3d8f73c7b3ade4e955163d517497)
277
+Upgraded:
278
+ bridge-utils-1.5-3.ph1.x86_64
279
+* Mon Sep 12 2016 Alexey Makhalov <amakhalov@vmware.com> 1.5-3
280
+-	Update patch to fix-2.
281
+
282
+ bzip2-1.0.6-6.ph1.x86_64
283
+* Fri Oct 21 2016 Kumar Kaushik <kaushikk@vmware.com> 1.0.6-6
284
+-       Fixing security bug CVE-2016-3189.
285
+
286
+ curl-7.51.0-2.ph1.x86_64
287
+* Wed Nov 30 2016 Xiaolin Li <xiaolinl@vmware.com> 7.51.0-2
288
+-   Enable sftp support.
289
+
290
+* Wed Nov 02 2016 Anish Swaminathan <anishs@vmware.com> 7.51.0-1
291
+-   	Upgrade curl to 7.51.0
292
+
293
+* Thu Oct 27 2016 Anish Swaminathan <anishs@vmware.com> 7.47.1-4
294
+-   	Patch for CVE-2016-5421
295
+
296
+* Mon Sep 19 2016 Xiaolin Li <xiaolinl@vmware.com> 7.47.1-3
297
+-   	Applied CVE-2016-7167.patch.
298
+
299
+ docker-1.12.1-1.ph1.x86_64
300
+* Wed Sep 21 2016 Xiaolin Li <xiaolinl@vmware.com> 1.12.1-1
301
+-   Upgraded to version 1.12.1
302
+
303
+* Mon Aug 22 2016 Alexey Makhalov <amakhalov@vmware.com> 1.12.0-2
304
+-   Added bash completion file
305
+
306
+* Tue Aug 09 2016 Anish Swaminathan <anishs@vmware.com> 1.12.0-1
307
+-   Upgraded to version 1.12.0
308
+
309
+* Tue Jun 28 2016 Anish Swaminathan <anishs@vmware.com> 1.11.2-1
310
+-   Upgraded to version 1.11.2
311
+...
312
+Added:
313
+ libssh2-1.8.0-1.ph1.x86_64
314
+``` 
315
+
316
+### 9.7 Composing for a different branch
317
+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.  
318
+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#81-starting-a-fresh-ostree-repo]], using your own customized versioning.
319
+
320
+
321
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-8-File-oriented-server-operations]]  | [[Next page >|Photon RPM-OSTree:-10-Remotes]]
0 322
\ No newline at end of file
1 323
new file mode 100644
... ...
@@ -0,0 +1,51 @@
0
+### Photon 1.0 GA: systemd-networkd and systemd-resolved not starting in the updated image, on reboot
1
+This issue has been fixed in 1.0 Revision 2 and above.
2
+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:  
3
+At server:  
4
+  1. Execute **umask 022**.  
5
+  2. Execute **rpm-ostree compose tree --force-nocache ...** to create a new, good image.  
6
+  3. Execute **umask 027** to tighten back the server permissions as good security practice.  
7
+
8
+At every host that booted into the bad image, from console:  
9
+  1. Execute **rpm-ostree rollback**, then reboot into the older good image.  
10
+  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.  
11
+  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.
12
+ 
13
+### OSTree repo is no longer accessible via http after RPM-OSTree server has updated httpd package
14
+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:  
15
+
16
+* Replace the content of /usr/lib/systemd/system/httpd.service with:
17
+```
18
+[Unit]
19
+Description=The Apache HTTP Server
20
+After=network.target remote-fs.target nss-lookup.target
21
+
22
+[Service]
23
+Type=forking
24
+ExecStart=/usr/sbin/httpd -f /srv/rpm-ostree/ostree-httpd.conf -DFORGROUND
25
+ExecReload=/usr/sbin/httpd -f /srv/rpm-ostree/ostree-httpd.conf -k graceful
26
+KillSignal=SIGWINCH
27
+KillMode=mixed
28
+Restart=always
29
+
30
+[Install]
31
+WantedBy=multi-user.target
32
+```
33
+* systemctl daemon-reload
34
+* systemctl restart httpd
35
+
36
+### Error composing when photon-iso repo is selected
37
+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.  
38
+  
39
+### Package differences between RPM-OSTree "minimal" and minimal installation profile
40
+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.
41
+
42
+That's easy to overcome - just add the wanted package names in the photon-base.json and re-compose the tree.
43
+
44
+
45
+
46
+### Manual pages not included for installed packages
47
+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.
48
+
49
+
50
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0]]
0 51
new file mode 100644
... ...
@@ -0,0 +1,192 @@
0
+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.  
1
+
2
+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.
3
+
4
+### 12.1 Installing an RPM-OSTree server
5
+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.
6
+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]].
7
+```
8
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2
9
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json
10
+```
11
+Now if you point a browser to http://<server_IP_address>, you should see the familiar directory structure of an OSTree repo.
12
+
13
+### 12.2 Installing an RPM-OSTree host
14
+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.  
15
+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#72-automated-install-of-a-custom-host-via-kickstart]].  
16
+
17
+### 12.3 Rebasing a host from Photon 1.0 to 2.0
18
+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".   
19
+
20
+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.  
21
+The OS name is the same (Photon), so the content in /var and /etc will be transferred over.  
22
+
23
+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]]. Of course, if you already have an existing Photon OS 1.0 host that you want to move to 2.0, skip this step.
24
+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#102-switching-repositories]].  
25
+ostree should confirm that is the updated server IP for the "photon" remote.
26
+```
27
+root@ostree-host [ ~ ]# ostree remote show-url photon
28
+http://10.118.101.180
29
+```
30
+3. Rebase your host to the new 2.0 server and Refspec.
31
+```
32
+root@ostree-host [ ~ ]# rpm-ostree rebase photon/2.0/x86_64/minimal
33
+
34
+549 metadata, 2654 content objects fetched; 119853 KiB transferred in 17 seconds
35
+Copying /etc changes: 6 modified, 0 removed, 14 added
36
+Transaction complete; bootconfig swap: yes deployment count change: 1
37
+Deleting ref 'photon:photon/1.0/x86_64/minimal'
38
+Changed:
39
+  Linux-PAM 1.2.1-3.ph1 -> 1.3.0-1.ph2
40
+  attr 2.4.47-3.ph1 -> 2.4.47-4.ph2
41
+  autogen-libopts 5.18.7-2.ph1 -> 5.18.12-2.ph2
42
+  bash 4.3.30-4.ph1 -> 4.4-5.ph2
43
+  bc 1.06.95-3.ph1 -> 1.06.95-3.ph2
44
+  binutils 2.25.1-2.ph1 -> 2.29-3.ph2
45
+  bridge-utils 1.5-3.ph1 -> 1.6-1.ph2
46
+  bzip2 1.0.6-6.ph1 -> 1.0.6-8.ph2
47
+  ca-certificates 20160109-5.ph1 -> 20170406-3.ph2
48
+  coreutils 8.25-2.ph1 -> 8.27-2.ph2
49
+  cpio 2.12-2.ph1 -> 2.12-3.ph2
50
+  cracklib 2.9.6-2.ph1 -> 2.9.6-8.ph2
51
+  cracklib-dicts 2.9.6-2.ph1 -> 2.9.6-8.ph2
52
+  curl 7.51.0-2.ph1 -> 7.54.1-1.ph2
53
+  dbus 1.8.8-5.ph1 -> 1.11.12-1.ph2
54
+  device-mapper 2.02.141-5.ph1 -> 2.02.171-3.ph2
55
+  device-mapper-libs 2.02.141-5.ph1 -> 2.02.171-3.ph2
56
+  docker 1.12.1-1.ph1 -> 17.06.0-1.ph2
57
+  dracut 044-3.ph1 -> 045-4.ph2
58
+  dracut-tools 044-3.ph1 -> 045-4.ph2
59
+  elfutils-libelf 0.165-2.ph1 -> 0.169-1.ph2
60
+  expat 2.2.0-1.ph1 -> 2.2.0-2.ph2
61
+  file 5.24-2.ph1 -> 5.30-2.ph2
62
+  filesystem 1.0-8.ph1 -> 1.0-13.ph2
63
+  findutils 4.6.0-2.ph1 -> 4.6.0-3.ph2
64
+  flex 2.5.39-3.ph1 -> 2.6.4-2.ph2
65
+  glib 2.47.6-2.ph1 -> 2.52.1-2.ph2
66
+  glib-networking 2.46.1-2.ph1 -> 2.50.0-1.ph2
67
+  glibc 2.22-9.ph1 -> 2.26-1.ph2
68
+  gmp 6.0.0a-3.ph1 -> 6.1.2-2.ph2
69
+  gnutls 3.4.11-2.ph1 -> 3.5.10-1.ph2
70
+  gobject-introspection 1.46.0-2.ph1 -> 1.52.1-4.ph2
71
+  gpgme 1.6.0-2.ph1 -> 1.9.0-2.ph2
72
+  grep 2.21-2.ph1 -> 3.0-3.ph2
73
+  grub2 2.02-5.ph1 -> 2.02-9.ph2
74
+  gzip 1.6-2.ph1 -> 1.8-1.ph2
75
+  iana-etc 2.30-2.ph1 -> 2.30-2.ph2
76
+  iproute2 4.2.0-2.ph1 -> 4.10.0-3.ph2
77
+  iptables 1.6.0-5.ph1 -> 1.6.1-4.ph2
78
+  json-glib 1.0.4-2.ph1 -> 1.2.8-1.ph2
79
+  kmod 21-4.ph1 -> 24-3.ph2
80
+  krb5 1.14-4.ph1 -> 1.15.1-2.ph2
81
+  libarchive 3.1.2-7.ph1 -> 3.3.1-1.ph2
82
+  libassuan 2.4.2-2.ph1 -> 2.4.3-1.ph2
83
+  libcap 2.25-2.ph1 -> 2.25-7.ph2
84
+  libffi 3.2.1-2.ph1 -> 3.2.1-5.ph2
85
+  libgcc 5.3.0-3.ph1 -> 6.3.0-3.ph2
86
+  libgcrypt 1.6.5-2.ph1 -> 1.7.6-1.ph2
87
+  libgomp 5.3.0-3.ph1 -> 6.3.0-3.ph2
88
+  libgpg-error 1.21-2.ph1 -> 1.27-1.ph2
89
+  libgsystem 2015.1-2.ph1 -> 2015.2-1.ph2
90
+  librepo 1.7.17-2.ph1 -> 1.7.20-2.ph2
91
+  libselinux 2.5-2.ph1 -> 2.6-4.ph2
92
+  libsepol 2.5-2.ph1 -> 2.6-1.ph2
93
+  libsolv 0.6.19-2.ph1 -> 0.6.26-3.ph2
94
+  libsoup 2.53.90-2.ph1 -> 2.57.1-2.ph2
95
+  libssh2 1.8.0-1.ph1 -> 1.8.0-1.ph2
96
+  libstdc++ 5.3.0-3.ph1 -> 6.3.0-3.ph2
97
+  libtasn1 4.7-3.ph1 -> 4.10-1.ph2
98
+  libtool 2.4.6-2.ph1 -> 2.4.6-3.ph2
99
+  libxml2 2.9.4-3.ph1 -> 2.9.4-11.ph2
100
+  linux 4.4.41-1.ph1 -> 4.9.43-2.ph2
101
+  m4 1.4.17-2.ph1 -> 1.4.18-1.ph2
102
+  mkinitcpio 19-2.ph1 -> 23-3.ph2
103
+  mpfr 3.1.3-2.ph1 -> 3.1.5-1.ph2
104
+  ncurses 6.0-2.ph1 -> 6.0-10.ph2
105
+  net-tools 1.60-7.ph1 -> 1.60-10.ph2
106
+  nettle 3.2-2.ph1 -> 3.3-1.ph2
107
+  nspr 4.12-2.ph1 -> 4.15-1.ph2
108
+  nss-altfiles 2.19.1-2.ph1 -> 2.23.0-1.ph2
109
+  openssh 7.4p1-1.ph1 -> 7.5p1-4.ph2
110
+  openssl 1.0.2j-1.ph1 -> 1.0.2l-1.ph2
111
+  ostree 2015.7-5.ph1 -> 2017.5-1.ph2
112
+  pcre 8.39-1.ph1 -> 8.40-4.ph2
113
+  photon-release 1.0-6.ph1 -> 2.0-1.ph2
114
+  pkg-config 0.28-2.ph1 -> 0.29.2-1.ph2
115
+  popt 1.16-2.ph1 -> 1.16-4.ph2
116
+  procps-ng 3.3.11-3.ph1 -> 3.3.12-2.ph2
117
+  readline 6.3-4.ph1 -> 7.0-2.ph2
118
+  rpm-ostree 2015.7-2.ph1 -> 2017.5-1.ph2
119
+  sed 4.2.2-2.ph1 -> 4.4-2.ph2
120
+  shadow 4.2.1-8.ph1 -> 4.2.1-13.ph2
121
+  systemd 228-32.ph1 -> 233-7.ph2
122
+  util-linux 2.27.1-2.ph1 -> 2.29.2-3.ph2
123
+  vim 7.4-6.ph1 -> 8.0.0533-3.ph2
124
+  which 2.21-2.ph1 -> 2.21-3.ph2
125
+  xz 5.2.2-2.ph1 -> 5.2.3-2.ph2
126
+  zlib 1.2.8-3.ph1 -> 1.2.11-1.ph2
127
+Removed:
128
+  db-6.1.26-2.ph1.x86_64
129
+  e2fsprogs-1.42.13-2.ph1.x86_64
130
+  gdbm-1.11-2.ph1.x86_64
131
+  hawkey-2014.1-4.ph1.x86_64
132
+  iputils-20151218-3.ph1.x86_64
133
+  libhif-0.2.2-2.ph1.x86_64
134
+  lua-5.3.2-2.ph1.x86_64
135
+  nss-3.25-1.ph1.x86_64
136
+  python2-2.7.11-8.ph1.x86_64
137
+  python2-libs-2.7.11-8.ph1.x86_64
138
+  rpm-4.11.2-11.ph1.x86_64
139
+  sqlite-autoconf-3.11.0-2.ph1.x86_64
140
+  tcsh-6.19.00-4.ph1.x86_64
141
+Added:
142
+  bubblewrap-0.1.8-1.ph2.x86_64
143
+  bzip2-libs-1.0.6-8.ph2.x86_64
144
+  ca-certificates-pki-20170406-3.ph2.x86_64
145
+  curl-libs-7.54.1-1.ph2.x86_64
146
+  e2fsprogs-libs-1.43.4-2.ph2.x86_64
147
+  expat-libs-2.2.0-2.ph2.x86_64
148
+  fuse-2.9.7-2.ph2.x86_64
149
+  gnupg-2.1.20-2.ph2.x86_64
150
+  libdb-5.3.28-1.ph2.x86_64
151
+  libksba-1.3.5-1.ph2.x86_64
152
+  libltdl-2.4.6-3.ph2.x86_64
153
+  libseccomp-2.3.2-1.ph2.x86_64
154
+  ncurses-libs-6.0-10.ph2.x86_64
155
+  ncurses-terminfo-6.0-10.ph2.x86_64
156
+  npth-1.3-1.ph2.x86_64
157
+  nss-libs-3.31-2.ph2.x86_64
158
+  openssh-clients-7.5p1-4.ph2.x86_64
159
+  openssh-server-7.5p1-4.ph2.x86_64
160
+  pcre-libs-8.40-4.ph2.x86_64
161
+  pinentry-1.0.0-2.ph2.x86_64
162
+  rpm-libs-4.13.0.1-5.ph2.x86_64
163
+  sqlite-libs-3.19.3-1.ph2.x86_64
164
+  util-linux-libs-2.29.2-3.ph2.x86_64
165
+  xz-libs-5.2.3-2.ph2.x86_64
166
+
167
+root@ostree-host [ ~ ]# rpm-ostree status
168
+  TIMESTAMP (UTC)         VERSION           ID             OSNAME     REFSPEC                              
169
+  2017-08-31 18:19:36     2.0_minimal       f4497b1948     photon     photon:photon/2.0/x86_64/minimal
170
+* 2017-01-11 02:18:42     1.0_minimal.1     4a21972b29     photon     photon:photon/1.0/x86_64/minimal
171
+```
172
+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:
173
+```
174
+root@ph2-ostree-host [ ~ ]# rpm-ostree status
175
+State: idle
176
+Deployments:
177
+* photon:photon/2.0/x86_64/minimal
178
+             Version: 2.0_minimal (2017-08-31 18:19:36)
179
+              Commit: f4497b194826adb0db6e17a6867df04edd1dc1ebe796a73db9f19b973b5658df
180
+
181
+  photon:photon/1.0/x86_64/minimal
182
+             Version: 1.0_minimal.1 (2017-01-11 02:18:42)
183
+              Commit: 4a21972b293978d39777017ccb33dde45713dd435b3cb77ee42161e7e849e5e4
184
+```
185
+
186
+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.
187
+
188
+### 12.4 Creating a host raw image
189
+It is now possible to run at server a script that is part of RPM-OStree package, to create a host raw mage.
190
+
191
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-11-Running-container-applications-between-bootable-images]] | [[ Next page >|Photon-RPM-OSTree:-Appendix-A:-Known-issues]]
0 192
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+To my knowledge, this is the first online documentation that exposes the secrets of RPM-OSTree in a practical manner, with code examples at every step of the way.   
1
+
2
+While it started as a set of Wiki pages on this topic, it ended up in some sort of a mini online book, taking the reader from theoretical concepts to practical samples, from simple to complex, in a progressive way. I've tried as much as I can not to duplicate information that is already available at the [OSTree official site](https://wiki.gnome.org/Projects/OSTree), limiting to only how much is needed to understand the practical examples.
3
+
4
+I wrote this mini-book from my own notes, based on my own experiments with this technology and working with my counter-part developer for the feature. It was necessary to understand how RPM-OSTree works in order to prepare test cases for its Photon application, even though public documentation is very sparse and sample code was almost non-existent. We've set the ambitious goal to make it work in Photon OS Technology Preview 2, which has been unveiled at VMWorld 2015 in San Francisco, along with a suite of other products in the same family.  
5
+
6
+Many thanks to Touseef Liaqat, the main developer who wrote the Photon / RPM-OSTree integration code. Also, many thanks to the people (whom I never met) who designed this cool technology. 
7
+
8
+Except for some school project and my short stint at Amazon, I have not developed much in Linux. I've worked for Microsoft for over 13 years, where in the old days just pronouncing "Linux" or "open source" was sure to [make some people uncomfortable](http://www.theregister.co.uk/2001/06/02/ballmer_linux_is_a_cancer/). Now things have changed even over there.  
9
+
10
+I just turned two months ... of employment with VMware and I'm part of a team that puts together a Linux distribution built from scratch.  It's been awesome so far!
11
+
12
+Should you have any question, comments, suggestions, technical and language corrections (well, my first language is not English), please write to me at [dmoraru@vmware.com](mailto:dmoraru@vmware.com) or [danutm@msn.com](mailto:danutm@msn.com). 
13
+
14
+Danut Moraru - August 31th, 2015  
15
+Bellevue, WA  
16
+
17
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-a-simple-guide]] | [[ Next page >|Photon-RPM-OSTree:-1-Introduction]]
0 18
\ No newline at end of file
1 19
new file mode 100644
... ...
@@ -0,0 +1,83 @@
0
+Contents  
1
+***
2
+
3
+   [[Preface|Photon-RPM-OSTree:-Preface]]  
4
+
5
+1. [[Introduction|Photon RPM-OSTree:-1-Introduction]]  
6
+1.1 [[What is OSTree? How about RPM-OSTree?|Photon RPM-OSTree:-1-Introduction#11-what-is-ostree-how-about-rpm-ostree]]  
7
+1.2 [[Why use RPM-OSTree in Photon?|Photon RPM-OSTree:-1-Introduction#12-why-use-rpm-ostree-in-photon]]  
8
+1.3 [[Photon with RPM-OSTree installation profiles|Photon RPM-OSTree:-1-Introduction#13-photon-with-rpm-ostree-installation-profiles]]  
9
+1.4 [[Terminology|Photon RPM-OSTree:-1-Introduction#14-terminology]]  
10
+1.5 [[Sample code|Photon RPM-OSTree:-1-Introduction#15-sample-code]]  
11
+1.6 [[How to read this book|Photon-RPM-OSTree:-1-Introduction#16-how-to-read-this-book]]  
12
+1.7 [[RPM-OSTree in Photon OS 2.0|Photon-RPM-OSTree:-1-Introduction#17-rpm-ostree-in-photon-os-20]]  
13
+2. [[Installing a Photon RPM-OSTree host against default server repository|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository]]  
14
+2.1 [[Who is this for?|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository#21-who-is-this-for]]  
15
+2.2 [[Installing the ISO, step by step|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository#22-installing-the-iso-step-by-step]]
16
+3. [[Concepts in action|Photon-RPM-OStree:-3-Concepts-in-action]]  
17
+3.1 [[Querying the deployed filetrees|Photon-RPM-OStree:-3-Concepts-in-action#31-querying-the-deployed-filetrees]]  
18
+3.2 [[Bootable filetree version|Photon-RPM-OStree:-3-Concepts-in-action#32-bootable-filetree-version]]  
19
+3.3 [[Commit ID|Photon-RPM-OStree:-3-Concepts-in-action#33-commit-id]]  
20
+3.4 [[OSname|Photon-RPM-OStree:-3-Concepts-in-action#34-osname]]  
21
+3.5 [[Refspec|Photon-RPM-OStree:-3-Concepts-in-action#35-refspec]]  
22
+3.6 [[Deployments|Photon-RPM-OStree:-3-Concepts-in-action#36-deployments]]
23
+4. [[Querying for commit, file and package metadata|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata]]  
24
+4.1 [[Commit history|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata#41-commit-history]]  
25
+4.2 [[Listing file mappings|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata#42-listing-file-mappings]]  
26
+4.3 [[Listing configuration changes|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata#43-listing-configuration-changes]]  
27
+4.4 [[Listing packages|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata#44-listing-packages]]  
28
+4.5 [[Querying for package details|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata#45-querying-for-package-details]]  
29
+4.6 [[Why am I unable to install, update or delete packages?|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata#46-why-am-i-unable-to-install-update-or-delete-packages]]  
30
+5. [[Host updating operations|Photon-RPM-OSTree:-5-Host-updating-operations]]  
31
+5.1 [[Is it an update or an upgrade?|Photon-RPM-OSTree:-5-Host-updating-operations#51-is-it-an-update-or-an-upgrade]]  
32
+5.2 [[Incremental upgrade|Photon-RPM-OSTree:-5-Host-updating-operations#52-incremental-upgrade]]  
33
+5.3 [[Listing file differences|Photon-RPM-OSTree:-5-Host-updating-operations#52-listing-file-differences]]  
34
+5.4 [[Listing package differences|Photon-RPM-OSTree:-5-Host-updating-operations#52-listing-package-differences]]  
35
+5.5 [[Rollback|Photon-RPM-OSTree:-5-Host-updating-operations#55-rollback]]  
36
+5.6 [[Deleting a deployed filetree|Photon-RPM-OSTree:-5-Host-updating-operations#56-deleting-a-deployed-filetree]]  
37
+5.7 [[Version skipping upgrade|Photon-RPM-OSTree:-5-Host-updating-operations#57-version-skipping-upgrade]]  
38
+5.8 [[Tracking parent commits|Photon-RPM-OSTree:-5-Host-updating-operations#58-tracking-parent-commits]]  
39
+5.9 [[Resetting a branch to a previous commit|Photon-RPM-OSTree:-5-Host-updating-operations#59-resetting-a-branch-to-a-previous-commit]]  
40
+6. [[Installing a Photon RPM-OSTree server|Photon-RPM-OSTree:-6-Installing-a-server]]  
41
+7. [[Installing a Photon RPM-OStree host against a custom server repository|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository]]  
42
+7.1 [[Manual install of a custom host|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository#71-manual-install-of-a-custom-host]]  
43
+7.2 [[Automated install of a custom host via kickstart|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository#72-automated-install-of-a-custom-host-via-kickstart]]  
44
+8. [[File oriented server operations|Photon-RPM-OSTree:-8-File-oriented-server-operations]]  
45
+8.1 [[Starting a fresh OSTree repo|Photon-RPM-OSTree:-8-File-oriented-server-operations#81-starting-a-fresh-ostree-repo]]  
46
+8.2 [[Checking out a filetree|Photon-RPM-OSTree:-8-File-oriented-server-operations#82-checking-out-a-filetree]]  
47
+8.3 [[Committing changes to a filetree|Photon-RPM-OSTree:-8-File-oriented-server-operations#83-committing-changes-to-a-filetree]]  
48
+8.4 [[Downloading the changes at the host|Photon-RPM-OSTree:-8-File-oriented-server-operations#84-downloading-the-changes-at-the-host]]  
49
+8.5 [[Creating summary metadata|Photon-RPM-OSTree:-8-File-oriented-server-operations#85-creating-summary-metadata]]  
50
+9. [[Package oriented server operations|Photon-RPM-OSTree:-9-Package-oriented-server-operations]]  
51
+9.1 [[JSON configuration file|Photon-RPM-OSTree:-9-Package-oriented-server-operations#91-json-configuration-file]]  
52
+9.2 [[Package addition, removal, upgrade|Photon-RPM-OSTree:-9-Package-oriented-server-operations#92-package-addition-removal-upgrade]]  
53
+9.3 [[RPMS repository|Photon-RPM-OSTree:-9-Package-oriented-server-operations#93-rpms-repository]]  
54
+9.4 [[Composing a tree|Photon-RPM-OSTree:-9-Package-oriented-server-operations#94-composing-a-tree]]  
55
+9.5 [[Automatic version prefix|Photon-RPM-OSTree:-9-Package-oriented-server-operations#95-automatic-version-prefix]]  
56
+9.6 [[Installing package updates|Photon-RPM-OSTree:-9-Package-oriented-server-operations#96-installing-package-updates]]  
57
+9.7 [[Creating server metadata|Photon-RPM-OSTree:-9-Package-oriented-server-operations#97-creating-server-metadata]]  
58
+9.8 [[Starting a fresh OSTree repo|Photon-RPM-OSTree:-9-Package-oriented-server-operations#98-starting-a-fresh-ostree-repo]]  
59
+10. [[Remotes|Photon RPM-OSTree:-10-Remotes]]  
60
+10.1 [[Listing remotes|Photon-RPM-OSTree:-10-Remotes#101-listing-remotes]]  
61
+10.2 [[GPG signature verification|Photon-RPM-OSTree:-10-Remotes#102-gpg-signature-verification]]  
62
+10.3 [[Switching repositories|Photon-RPM-OSTree:-10-Remotes#103-switching-repositories]]  
63
+10.4 [[Adding and removing remotes|Photon-RPM-OSTree:-10-Remotes#104-adding-and-removing-remotes]]  
64
+10.5 [[List available branches|Photon-RPM-OSTree:-10-Remotes#105-list-available-branches]]  
65
+11. [[Running container applications between bootable images|Photon-RPM-OSTree:-11-Running-container-applications-between-bootable-images]]  
66
+11.1 [[Downloading a docker container appliance|Photon-RPM-OSTree:-11-Running-container-applications-between-bootable-images#111-downloading-a-docker-container-appliance]]  
67
+11.2 [[Rebooting into an existing image|Photon-RPM-OSTree:-11-Running-container-applications-between-bootable-images#112-rebooting-into-an-existing-image]]  
68
+11.3 [[Reboot into a newly created image|Photon-RPM-OSTree:-11-Running-container-applications-between-bootable-images#113-reboot-into-a-newly-created-image]]  
69
+12. [[Install or rebase to Photon OS 2.0|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0]]  
70
+12.1 [[Installing an RPM-OSTree server|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0#121-installing-an-rpm-ostree-server]]  
71
+12.2 [[Installing an RPM-OSTree host|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0#122-installing-an-rpm-ostree-host]]  
72
+12.3 [[Rebasing a host from Photon 1.0 to 2.0|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0#123-rebasing-a-host-from-photon-10-to-20]]  
73
+12.4 [[Creating a host raw image|Photon-RPM-OSTree:-Install-or-rebase-to-Photon-OS-2.0#124-creating-a-host-raw-image]]    
74
+
75
+[[Appendix A: Known issues|Photon-RPM-OSTree:-Appendix-A:-Known-issues]]  
76
+
77
+***
78
+
79
+About the author  
80
+[Danut Moraru](mailto:dmoraru@vmware.com) is a Senior Software Design Engineer in the Photon OS Development team.  
81
+
82
+[[Next page >|Photon-RPM-OSTree:-Preface]]
0 83
\ No newline at end of file
1 84
new file mode 100644
... ...
@@ -0,0 +1,116 @@
0
+
1
+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.  
2
+### 3.1 Querying the deployed filetrees
3
+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.
4
+``` 
5
+root@photon-host [ ~ ]# rpm-ostree status
6
+  TIMESTAMP (UTC)       VERSION       ID           OSNAME  REFSPEC               
7
+* 2016-06-07 14:06:17   1.0_minimal   56ef687f13   photon  photon:photon/1.0/x86_64/minimal
8
+```  
9
+### 3.2 Bootable filetree version
10
+**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.
11
+
12
+### 3.3 Commit ID
13
+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.
14
+```
15
+root@photon-host [ ~ ]# rpm-ostree status -p
16
+============================================================
17
+  * DEFAULT ON BOOT
18
+----------------------------------------
19
+  version    1.0_minimal
20
+  timestamp  2016-06-07 14:06:17
21
+  id         56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0
22
+  osname     photon     
23
+  refspec    photon:photon/1.0/x86_64/minimal
24
+============================================================
25
+```
26
+### 3.4 OSname
27
+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.  
28
+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.
29
+
30
+### 3.5 Refspec
31
+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).  
32
+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.  
33
+```
34
+root@photon-host [ ~ ]# cat /ostree/repo/refs/remotes/photon/photon/1.0/x86_64/minimal 
35
+56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
36
+```
37
+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.
38
+
39
+### 3.6 Deployments
40
+We've used so far `rpm-ostree`. The same information can be obtained running an `ostree` command:
41
+```
42
+root@photon-host [ ~ ]# ostree admin status
43
+* photon 56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0
44
+    Version: 1.0_minimal
45
+    origin refspec: photon:photon/1.0/x86_64/minimal
46
+```
47
+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:  
48
+```
49
+root@photon-host [ ~ ]# cat /ostree/repo/refs/heads/ostree/0/1/0 
50
+56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4
51
+```
52
+This also where this command that lists the references (local heads and remotes) takes its data from:
53
+```
54
+root@photon-host [ ~ ]# ostree refs
55
+photon:photon/1.0/x86_64/minimal
56
+ostree/0/1/0
57
+```
58
+Based on that, it could find the root of the deployment that it boots from. The actual filetree is deployed right here:
59
+```
60
+root@photon-host [ ~ ]# ls -l /ostree/deploy/photon/deploy/56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0
61
+total 36
62
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 bin -> usr/bin
63
+drwxr-xr-x  4 root root 4096 Jan  1  1970 boot
64
+drwxr-xr-x  2 root root 4096 Jan  1  1970 dev
65
+drwxr-xr-x 33 root root 4096 Jun 12 23:04 etc
66
+lrwxrwxrwx  1 root root    8 Jun  9 18:26 home -> var/home
67
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 lib -> usr/lib
68
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 lib64 -> usr/lib
69
+lrwxrwxrwx  1 root root    9 Jun  9 18:26 media -> run/media
70
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 mnt -> var/mnt
71
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 opt -> var/opt
72
+lrwxrwxrwx  1 root root   14 Jun  9 18:26 ostree -> sysroot/ostree
73
+drwxr-xr-x  2 root root 4096 Jan  1  1970 proc
74
+lrwxrwxrwx  1 root root   12 Jun  9 18:26 root -> var/roothome
75
+drwxr-xr-x  2 root root 4096 Jan  1  1970 run
76
+lrwxrwxrwx  1 root root    8 Jun  9 18:26 sbin -> usr/sbin
77
+lrwxrwxrwx  1 root root    7 Jun  9 18:26 srv -> var/srv
78
+drwxr-xr-x  2 root root 4096 Jan  1  1970 sys
79
+drwxr-xr-x  2 root root 4096 Jan  1  1970 sysroot
80
+lrwxrwxrwx  1 root root   11 Jun  9 18:26 tmp -> sysroot/tmp
81
+drwxr-xr-x 10 root root 4096 Jan  1  1970 usr
82
+drwxr-xr-x  7 root root 4096 Jun  9 18:26 var
83
+```  
84
+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:
85
+```
86
+root@photon-host [ ~ ]# cat /ostree/deploy/photon/deploy/56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4.0.origin 
87
+[origin]
88
+refspec=photon:photon/1.0/x86_64/minimal
89
+```  
90
+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.  
91
+
92
+The **photon** directory in the path is the actual OSname. Multiple deployments of same OS will share a writable /var folder.  
93
+```
94
+root@photon-host [ ~ ]# ls -l /ostree/deploy/photon/var/
95
+total 52
96
+drwxr-xr-x  4 root root 4096 Jun  9 18:26 cache
97
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 home
98
+drwxr-xr-x 13 root root 4096 Jun  9 18:26 lib
99
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 local
100
+lrwxrwxrwx  1 root root   11 Jun  9 18:26 lock -> ../run/lock
101
+drwxr-xr-x  3 root root 4096 Jun  9 18:26 log
102
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 mail
103
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 mnt
104
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 opt
105
+drwx------  2 root root 4096 Jun 12 23:06 roothome
106
+lrwxrwxrwx  1 root root    6 Jun  9 18:26 run -> ../run
107
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 spool
108
+drwxr-xr-x  2 root root 4096 Jun  9 18:26 srv
109
+drwxrwxrwt  4 root root 4096 Jun 12 23:04 tmp
110
+drwxr-xr-x 11 root root 4096 Jun  9 18:26 usrlocal
111
+```
112
+
113
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository]] | [[Next page >|Photon-RPM-OSTree:-4-Querying-for-commit,-file-and-package-metadata]] 
114
+
115
+
0 116
new file mode 100644
... ...
@@ -0,0 +1,37 @@
0
+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.  
1
+
2
+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.
3
+
4
+### 8.1 Starting a fresh OSTree repo  
5
+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.  
6
+```
7
+root [ /srv/rpm-ostree ]# rm -rf repo
8
+
9
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2
10
+
11
+root [ /srv/rpm-ostree ]# ls repo                                  
12
+config  objects  refs  state  tmp  uncompressed-objects-cache
13
+
14
+root [ /srv/rpm-ostree ]# cat repo/config
15
+[core]
16
+repo_version=1
17
+mode=archive-z2
18
+```
19
+
20
+### 8.2 Checking out a filetree
21
+[content to be added]
22
+
23
+### 8.3 Committing changes to a filetree
24
+[content to be added]
25
+
26
+### 8.4 Downloading the changes at the host
27
+[content to be added]
28
+
29
+### 8.5 Creating summary metadata
30
+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:
31
+```
32
+root [ /srv/rpm-ostree ]# ostree summary -u "This is BigData's OSTree server, it has three branches"
33
+```  
34
+We will find out later how the [[hosts query for branches list|Photon-RPM-OSTree:-10-Remotes#105-list-available-branches]]. 
35
+
36
+[[Back to main page|Photon-RPM-OSTree:-a-simple-guide]] | [[Previous page|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository]] | [[Next page >|Photon-RPM-OSTree:-9-Package-oriented-server-operations]] 
0 37
\ No newline at end of file
1 38
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,260 @@
0
+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.
1
+ 
2
+## About Photon OS?
3

                
4
+
5
+## Prerequisites
6
+
7
+Using Photon OS within AWS EC2 requires the following resources:
8
+
9
+- **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).
10
+- **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.
11
+
12
+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).
13
+This article uses an Ubuntu 14.04 workstation to generate the keys and certificates that AWS requires.
14
+
15
+## Downloading the Photon OS Image for Amazon
16
+
17
+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).
18
+
19
+Download the Photon OS AMI now and save it on your workstation. For instructions, see [Downloading Photon OS](#https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
20
+
21
+**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. 
22
+
23
+## Getting Photon OS Up and Running on EC2
24
+
25
+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. 
26
+
27
+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. 
28
+
29
+### Step 1: Create a Key Pair
30
+
31
+The first step is to generate SSH keys on, for instance, an Ubuntu workstation: 
32
+
33
+	ssh-keygen -f ~/.ssh/mykeypair
34
+
35
+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.
36
+
37
+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. 
38
+
39
+	chown 600 mykeypair.pub
40
+
41
+Change the mode bits on your private key pair file so that only you can view it:
42
+
43
+	chmod 400 mykeypair
44
+
45
+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. 
46
+
47
+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).
48
+
49
+### Step 2: Generate a Certificate
50
+
51
+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. 
52
+
53
+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. 
54
+
55
+	openssl genrsa 2048 > myprivatersakey.pem
56
+
57
+Remember where you store your private key locally; you'll need it again later. 
58
+
59
+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. 
60
+
61
+	openssl req -new -x509 -nodes -sha256 -days 365 -key myprivatersakey.pem -outform PEM -out certificate.pem
62
+
63
+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).
64
+
65
+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`.
66
+
67
+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).
68
+
69
+### Step 3: Create a Security Group
70
+
71
+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: 
72
+
73
+	aws ec2 create-security-group --group-name photon-sg --description "My Photon security group"
74
+	{
75
+	    "GroupId": "sg-d027efb4"
76
+	}
77
+	aws ec2 authorize-security-group-ingress --group-name photon-sg --protocol tcp --port 22 --cidr 0.0.0.0/0
78
+
79
+The `GroupId` is returned by EC2. Write it down; you'll need it later.
80
+
81
+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).
82
+
83
+Repeat the command to allow incoming traffic on Port 80 and on Port 443: 
84
+
85
+	aws ec2 authorize-security-group-ingress --group-name photon-sg --protocol tcp --port 80 --cidr 0.0.0.0/0
86
+
87
+	aws ec2 authorize-security-group-ingress --group-name photon-sg --protocol tcp --port 443 --cidr 0.0.0.0/0
88
+
89
+Check your work: 
90
+
91
+	aws ec2 describe-security-groups --group-names photon-sg
92
+
93
+### Step 4: Extract the Tarball 
94
+
95
+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.)    
96
+
97
+	mkdir bundled
98
+	tar -zxvf ./photon-ami.tar.gz
99
+
100
+### Step 5: Bundle the Image
101
+
102
+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. 
103
+
104
+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. 
105
+
106
+You must replace the values of the certificate path, the private key, and the user account with your own values.
107
+
108
+	$ ec2-bundle-image --cert certificate.pem --privatekey myprivatersakey.pem --user <EC2 account id>  --arch x86_64 --image photon-ami.raw --destination ./bundled/
109
+
110
+### Step 6: Put the Bundle in a Bucket
111
+
112
+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: 
113
+
114
+	$ aws s3 mb s3://<bucket-name>
115
+
116
+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. 
117
+
118
+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.
119
+
120
+	$ ec2-upload-bundle --manifest ./bundled/photon-ami.manifest.xml --bucket <bucket-name> --access-key <Account Access Key> --secret-key <Account Secret key>
121
+
122
+### Step 7: Register the Image
123
+
124
+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`.
125
+
126
+	$ ec2-register <bucket-name>/photon-ami.manifest.xml --name photon-ami --architecture x86_64 --virtualization-type hvm
127
+
128
+Once registered, you can launch as many new instances as you want.
129
+
130
+### Step 8: Run an Instance of the Image with Cloud-Init
131
+
132
+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`.  
133
+
134
+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. 
135
+
136
+Before you run the command, change directories to the directory containing the `mykeypair` file and add the path to the `user-data.txt`. 
137
+
138
+	$ ec2-run-instances <ami-ID> --instance-type m3.medium -g photon-sg --key mykeypair --user-data-file user-data.txt
139
+
140
+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.  
141
+
142
+	#cloud-config
143
+	hostname: photon-on-01
144
+	groups:
145
+	- cloud-admins
146
+	- cloud-users
147
+	users:
148
+	- default
149
+	- name: photonadmin
150
+	   gecos: photon test admin user
151
+	   primary-group: cloud-admins
152
+	   groups: cloud-users
153
+	   lock-passwd: false
154
+	   passwd: vmware
155
+	- name: photonuser
156
+	   gecos: photon test user
157
+	   primary-group: cloud-users
158
+	   groups: users
159
+	   passwd: vmware
160
+	packages:
161
+	- vim
162
+
163
+### Step 9: Get the IP Address of Your Image
164
+
165
+Now run the following command to check on the state of the instance that you launched: 
166
+
167
+	$ ec2-describe-instances
168
+
169
+Finally, you can obtain the external IP address of the instance by running the following query: 
170
+
171
+	$ aws ec2 describe-instances --instance-ids <instance-id> --query 'Reservations[*].Instances[*].PublicIpAddress' --output=text
172
+
173
+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. 
174
+
175
+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).
176
+
177
+## Deploy a Containerized Application in Photon OS
178
+
179
+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.
180
+
181
+### Step 1: Connect with SSH
182
+
183
+Connect to the instance over SSH by specifying the private key (.pem) file and the user name for the Photon machine, which is `root`:
184
+
185
+	ssh -i ~/.ssh/mykeypair root@<public-ip-address-of-instance>
186
+
187
+For complete instructions, see [Connecting to Your Linux Instance Using SSH](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html). 
188
+
189
+### Step 2: Run Docker
190
+
191
+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: 
192
+
193
+	systemctl status docker
194
+
195
+### Step 3: Start the Web Server
196
+
197
+**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. 
198
+
199
+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.
200
+
201
+To pull Nginx from its Docker Hub and start it, run the following command: 
202
+
203
+	docker run -p 80:80 vmwarecna/nginx
204
+
205
+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. 
206
+
207
+### Step 4: Test the Web Server
208
+
209
+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:
210
+
211
+![Nginx](https://cloud.githubusercontent.com/assets/11306358/9568169/a6d4b140-4f07-11e5-934d-acda0bf505e8.jpg)
212
+
213
+When you're done, halt the Docker container by typing `Ctrl+c` in the SSH console where you are connected to EC2. 
214
+
215
+You can now run other containerized applications from the Docker Hub or your own containerized application on Photon OS in the Amazon cloud. 
216
+
217
+## Launching the Web Server with Cloud-Init
218
+
219
+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`: 
220
+
221
+	#cloud-config
222
+	hostname: photon-on-01
223
+	groups:
224
+	- cloud-admins
225
+	- cloud-users
226
+	users:
227
+	- default
228
+	- name: photonadmin
229
+	   gecos: photon test admin user
230
+	   primary-group: cloud-admins
231
+	   groups: cloud-users
232
+	   lock-passwd: false
233
+	   passwd: vmware
234
+	- name: photonuser
235
+	   gecos: photon test user
236
+	   primary-group: cloud-users
237
+	   groups: users
238
+	   passwd: vmware
239
+	packages:
240
+	- vim
241
+	runcmd:
242
+	- docker run -p 80:80 vmwarecna/nginx
243
+
244
+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. 
245
+
246
+## Terminating the AMI Instance
247
+
248
+Because Amazon charges you while the instance is running, make sure to shut it down when you're done.  
249
+
250
+First, get the ID of the AMI so you can terminate it: 
251
+
252
+	$ ec2-describe-instances
253
+
254
+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. 
255
+
256
+	$ ec2-terminate-instances <instance-id>
257
+
258
+
259
+
0 260
new file mode 100644
... ...
@@ -0,0 +1,117 @@
0
+
1
+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.
2
+
3
+- [About Photon OS](#about-photon-os)
4
+- [Prerequisites for Photon OS on GCE](#prerequisites-for-photon-os-on-gce)
5
+- [Downloading Photon OS](#downloading-photon-os)
6
+- [Installing Photon OS on Google Compute Engine](#installing-photon-os-on-google-compute-engine)
7
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
8
+
9
+# About Photon OS
10
+
11
+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/).
12
+
13
+# Prerequisites for Photon OS on GCE
14
+
15
+Using Photon OS on Google Compute Engine requires the following resources:
16
+
17
+* An account on Google Compute Engine
18
+* The Google Cloud SDK
19
+* The Photon OS image for GCE
20
+
21
+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.
22
+
23
+# Downloading Photon OS
24
+
25
+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.
26
+
27
+You can download the Photon OS image for GCE from the following URL:
28
+
29
+[https://bintray.com/vmware/photon](https://bintray.com/vmware/photon)
30
+
31
+For instructions, see [Downloading Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
32
+
33
+# Installing Photon OS on Google Compute Engine
34
+
35
+After you download the Photon OS image for GCE, log into GCE and complete the following steps.
36
+
37
+## Step 1: Create a New Bucket
38
+
39
+Create a new bucket to store your Photon OS image for GCE.
40
+
41
+![gce1](https://cloud.githubusercontent.com/assets/11306358/9568167/a6a8a91a-4f07-11e5-9a65-8d3867578a3b.jpg)
42
+
43
+## Step 2: Upload the Photon OS Image
44
+
45
+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. 
46
+
47
+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.
48
+
49
+![gce2](https://cloud.githubusercontent.com/assets/11306358/9568168/a6c86732-4f07-11e5-8072-1c542d4f12e0.jpg)
50
+
51
+## Step 3: Create a New Image
52
+
53
+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. 
54
+
55
+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:
56
+ 
57
+	photon_storage/photon-gce-2.0-tar.gz
58
+
59
+*Note: The new image form will autopopulate the `gs://` file path prefix.*
60
+
61
+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. 
62
+
63
+## Step 4: Create a New Instance
64
+
65
+To create an instance, check the box next to the Photon OS image and click the `Create Instance` button. 
66
+
67
+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.` 
68
+
69
+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. 
70
+
71
+![gce4](https://cloud.githubusercontent.com/assets/11306358/9568170/a6f30492-4f07-11e5-99b5-a9c2fe72ec1d.jpg)
72
+
73
+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. 
74
+
75
+At this point, your instance is running and you are ready to start the Docker engine and run a container workload.
76
+
77
+# Deploying a Containerized Application in Photon OS
78
+
79
+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.
80
+
81
+## Step 1: Run Docker
82
+
83
+To run Docker from the command prompt, enter the command below to initialize the Docker engine:
84
+
85
+    systemctl start docker
86
+
87
+To ensure Docker daemon service runs on every subsequent VM reboot, enter:
88
+ 
89
+    systemctl enable docker
90
+
91
+## Step 2: Run the Nginx Web Server
92
+
93
+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:
94
+ 
95
+    docker run -d -p 80:80 vmwarecna/nginx
96
+
97
+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:
98
+
99
+![gce5](https://cloud.githubusercontent.com/assets/11306358/9568172/a6fe2372-4f07-11e5-82dd-12d6ebd8a7c6.jpg)
100
+
101
+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.
102
+
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](https://cloud.githubusercontent.com/assets/11306358/9568169/a6d4b140-4f07-11e5-934d-acda0bf505e8.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,244 @@
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](https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
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
+### Step 2: Create a Storage Account
58
+
59
+Create a storage account associated with this resource group.
60
+~~~~
61
+az storage account create \
62
+    --resource-group &lt;your_resource_group&gt; \
63
+    --location westus \
64
+    --name &lt;your_account_name&gt; \
65
+    --kind Storage \
66
+    --sku Standard_LRS
67
+~~~~
68
+### Step 3: List the Keys for the Storage Account
69
+
70
+Retrieve the keys associated with your newly created storage account.
71
+~~~~
72
+az storage account keys list \
73
+    --resource-group &lt;your_resource_group&gt; \
74
+    --account-name &lt;your_account_name&gt;
75
+~~~~
76
+### Step 4: Create the Storage Container
77
+
78
+Create a storage container associated with your newly created storage account.
79
+
80
+**Note:** The sample create.sh script, described below, does this for you programmatically.
81
+~~~~
82
+az storage container create \
83
+    --account-name &lt;your_account_name&gt; \
84
+    --name &lt;your_container_name&gt;
85
+~~~~
86
+### Step 5: Verify Your Setup in the Azure Portal
87
+
88
+1. Log into the Azure portal using your account credentials.
89
+2. From the left toolbar, click **Storage Accounts**. You should see your storage accounts.
90
+3. Select the storage account.
91
+4. Scroll down the storage account control bar and click **Containers** (below BLOB SERVICE). You should see the container you created.
92
+
93
+### Step 6: Upload the Photon OS Distribution to Your Storage Container
94
+
95
+The Photon OS distribution for Azure is 16GB. You can download it locally or to a mounted, shared location.
96
+~~~~
97
+az storage blob upload \
98
+    --account-name &lt;your_account_name&gt; \
99
+    --account-key &lt;your_account_key&gt; \
100
+    --container-name &lt;your_container_name&gt; \
101
+    --type page \
102
+    --file &lt;vhd_path&gt; \
103
+    --name &lt;vm_name&gt;.vhd
104
+~~~~
105
+### Example Setup Script
106
+
107
+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:
108
+
109
+- resource_group name
110
+- account_name
111
+- account_key (public or private)
112
+- container_name
113
+- public_key_file
114
+- vhd_path and and vm_name of the Photon OS VHD distribution file
115
+
116
+This script returns the complete IP address of the newly created VM.
117
+~~~~
118
+#!/bin/bash
119
+vhd_path=$1
120
+vm_name=$2
121
+export PATH=$PATH:/root/azure_new/bin/az
122
+echo PATH=$PATH
123
+resource_group=&quot;&quot;
124
+account_name=&quot;&quot;
125
+account_key=&quot;&quot;
126
+container_name=&quot;mydisks&quot;
127
+url=&quot;https://${account_name}.blob.core.windows.net/${container_name}/${vm_name}.vhd&quot;
128
+public_key_file=&quot;/root/azure_new/jenkins.pub&quot;
129
+echo &quot;########################&quot;
130
+echo &quot;#   Create container   #&quot;
131
+echo &quot;########################&quot;
132
+/root/azure_new/bin/az storage container create --account-name ${account_name} --name ${container_name}
133
+echo &quot;##################&quot;
134
+echo &quot;#   Upload vhd   #&quot;
135
+echo &quot;##################&quot;
136
+/root/azure_new/bin/az storage blob upload --account-name ${account_name} \
137
+    --account-key ${account_key} \
138
+    --container-name ${container_name} \
139
+    --type page \
140
+    --file ${vhd_path} \
141
+    --name ${vm_name}.vhd
142
+echo &quot;##################&quot;
143
+echo &quot;#   Create vm    #&quot;
144
+echo &quot;##################&quot;
145
+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;
146
+/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
147
+~~~~
148
+## Removing Photon OS from Azure
149
+
150
+You can use the following delete.sh script to programmatically (and silently) remove the VM instance, VHD file, and container.
151
+
152
+**Note:**  Consider deleting idle VMs so that you are not charged when not in use.
153
+
154
+Before you run it, specify the following settings:
155
+
156
+- resource_group name (from step 1, above)
157
+- account_name (from step 2, above)
158
+- account_key (public or private) (from step 3, above)
159
+- container_name (from step 4, above)
160
+- public_key_file
161
+- vm_name of the Photon OS VHD distribution file
162
+
163
+**delete.sh**
164
+
165
+~~~~
166
+#!/bin/bash
167
+vm_name=$1
168
+resource_group=&quot;&quot;
169
+account_name=&quot;&quot;
170
+account_key=&quot;&quot;
171
+container_name=&quot;mydisks&quot;
172
+url=&quot;https://${account_name}.blob.core.windows.net/${container_name}/${vm_name}.vhd&quot;
173
+public_key_file=&quot;/root/azure_new/jenkins.pub&quot;
174
+exit_code=0
175
+echo &quot;##################&quot;
176
+echo &quot;#   Delete vm    #&quot;
177
+echo &quot;##################&quot;
178
+echo &quot;az vm list  --resource-group ${resource_group} ... ...&quot;
179
+/root/azure_new/bin/az vm list  --resource-group ${resource_group}
180
+echo &quot;az vm delete --resource-group ${resource_group} --name ${vm_name} --yes ... ...&quot;
181
+/root/azure_new/bin/az vm delete --resource-group ${resource_group} --name ${vm_name} --yes
182
+if [$? -ne 0];then
183
+   exit_code=1
184
+fi
185
+echo &quot;az vm list  --resource-group ${resource_group} ... ...&quot;
186
+/root/azure_new/bin/az vm list  --resource-group ${resource_group}
187
+echo &quot;##############$####&quot;
188
+echo &quot;#   Delete vhd    #&quot;
189
+echo &quot;###############$###&quot;
190
+echo &quot;az storage blob list --account-name ${account_name} --container-name ${container_name} ... ...&quot;
191
+/root/azure_new/bin/az storage blob list --account-name ${account_name} --container-name ${container_name}
192
+echo &quot;az storage blob delete --account-name ${account_name} --container-name ${container_name} --name ${vm_name}.vhd ... ...&quot;
193
+/root/azure_new/bin/az storage blob delete --account-name ${account_name} --container-name ${container_name} --name ${vm_name}.vhd
194
+if [$? -ne 0];then
195
+   exit_code=1
196
+fi
197
+echo &quot;az storage blob list --account-name ${account_name} --container-name ${container_name} ... ...&quot;
198
+/root/azure_new/bin/az storage blob list --account-name ${account_name} --container-name ${container_name}
199
+echo &quot;########################&quot;
200
+echo &quot;#   Delete container   #&quot;
201
+echo &quot;########################&quot;
202
+/root/azure_new/bin/az storage container delete --account-name ${account_name} --name ${container_name}
203
+/root/azure_new/bin/az storage container delete --account-name ${account_name} --name vhds
204
+exit ${exit_code}
205
+~~~~
206
+# Deploying a Containerized Application in Photon OS
207
+
208
+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.
209
+
210
+## Step 1: Run Docker
211
+
212
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
213
+~~~~
214
+systemctl start docker
215
+~~~~
216
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
217
+~~~~
218
+systemctl enable docker
219
+~~~~
220
+## Step 2: Run the Nginx Web Server
221
+
222
+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:
223
+~~~~
224
+docker run -d -p 80:80 vmwarecna/nginx
225
+~~~~
226
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
227
+
228
+[[/images/azure-docker-run.png]]
229
+
230
+After the &quot;docker run&quot; process completes, you return to the command prompt. You now have a fully active website up and running in a container.
231
+
232
+## Step 3: Test the Web Server
233
+
234
+**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.
235
+
236
+To test that your Web Server is active:
237
+
238
+1. Run the ifconfig command to get the IP address of the Photon OS Virtual Machine.
239
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on &quot;eth0.&quot;
240
+2. Start a browser on your host machine and enter the IP address of your Photon OS Virtual Machine.
241
+3. You should see a screen confirming that the nginx web server is successfully installed and working.
242
+
243
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
0 244
\ No newline at end of file
1 245
new file mode 100644
... ...
@@ -0,0 +1,357 @@
0
+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.
1
+
2
+- [About Photon OS](#about-photon-os)
3
+- [Requirements](#requirements)
4
+- [Deciding Whether to Use OVA or ISO](#deciding-whether-to-use-ova-or-iso)
5
+- [Downloading Photon OS](#downloading-photon-os)
6
+- [Importing the OVA for Photon OS 2.0](#importing-the-ova-for-photon-os-20)
7
+- [Installing the ISO Image for Photon OS 2.0](#installing-the-iso-image-for-photon-os-20)
8
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
9
+- [Installing Photon OS 1.0](#installing-photon-os-10)
10
+
11
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](https://github.com/vmware/photon/wiki/Upgrading-to-Photon-OS-2.0). 
12
+
13
+# About Photon OS
14
+
15

                
16
+
17
+# Requirements
18
+
19
+Using Photon OS within VMware Workstation requires the following resources:
20
+
21
+| **Resource** | **Description** |
22
+| --- | --- |
23
+| VMware Workstation | VMware Workstation must be installed (Workstation 10 or higher). The latest version is recommended. |
24
+| Memory | 2GB of free RAM (recommended) |
25
+| Storage | **Minimal Photon install** : 512MB of free space (minimum); **Full Photon install** : 4GB of free space (minimum); 8GB is recommended |
26
+| Distribution File | Photon OS ISO or OVA file downloaded from bintray ([https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)).
27
+
28
+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).
29
+
30
+**Note:**  The setup instructions in this guide use VMware Workstation Professional version 12.5.7.
31
+
32
+[[/images/ws_version.png]]
33
+
34
+# Deciding Whether to Use OVA or ISO
35
+
36
+The first step is decide whether to use the the OVA or ISO distribution to set up Photon OS.
37
+
38
+- **OVA import** : Because of the nature of an OVA, you&#39;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&#39;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.
39
+- **ISO install** : The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
40
+
41
+If you&#39;re just looking for the fastest way to get up and running, start with the OVA.
42
+
43
+# Downloading Photon OS
44
+
45
+Once you&#39;ve decided which way to install, you&#39;ll need to download the correct binaries. Go to the following Bintray URL and download the latest release of Photon OS:
46
+
47
+[https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
48
+
49
+For instructions, see  [Downloading Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
50
+
51
+# Importing the OVA for Photon OS 2.0
52
+
53
+Using the OVA is the easiest way to create a Photon OS VM on VMware Workstation.
54
+
55
+## Step 1: Start the Import Process
56
+
57
+After you&#39;ve downloaded the OVA file (OVA with Hardware Version 11), do one of the following:
58
+
59
+- Double-click it to start the import process, or
60
+- Start VMware Workstation and, from the File menu, choose **Open**.
61
+
62
+[[/images/ws-ova-import.png]]
63
+
64
+## Step 2: Specify the Name and Storage Location
65
+
66
+Change the name and storage location, if you want.
67
+
68
+[[/images/ws-ova-path.png]]
69
+
70
+Choose **Import**.
71
+
72
+[[/images/ws-ova-license.png]]
73
+
74
+Review the License Agreement and choose **Accept**.
75
+
76
+## Step 3: Configure VM Settings
77
+
78
+Once the OVA is imported, Workstation displays a summary of the settings for your Photon OS VM.
79
+
80
+[[/images/ws-ova-settings.png]]
81
+
82
+Choose **Edit virtual machine settings**. Workstation displays the Virtual Machine settings. You can either accept the defaults or change settings as needed.
83
+
84
+[[/images/ws-ova-settings-edit.png]]
85
+
86
+Select the Options tab.
87
+
88
+[[/images/ws-ova-settings-options.png]]
89
+
90
+Under Guest operating system, select **Linux**.
91
+
92
+For Version, click the list and select **VMWare Photon 64-bit**.
93
+
94
+[[/images/ws-ova-os.png]]
95
+
96
+**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.
97
+
98
+[[/images/ws-ova-settings-efi.png]]
99
+
100
+Choose **OK**.
101
+
102
+## Step 4: Power on the VM
103
+
104
+From the tab, choose  **Power on this virtual machine**.
105
+
106
+[[/images/ws-ova-splash.png]]
107
+
108
+After the splash screen, Workstation will prompt you to log in.
109
+
110
+## Step 5: Update Login Credentials
111
+
112
+**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:
113
+
114
+| **Setting** | **Value** |
115
+| --- | --- |
116
+| Username | ``root`` |
117
+| Password | ``changeme`` |
118
+
119
+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.
120
+
121
+[[/images/ws-ova-password.png]]
122
+
123
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os).
124
+
125
+# Installing the ISO Image for Photon OS 2.0
126
+
127
+After you have downloaded the Photon OS ISO image into a folder of your choice, open VMware Workstation.
128
+
129
+## Step 1: Start the Installation Process
130
+
131
+From the File menu, choose **New Virtual Machine**  to create a new virtual machine.
132
+
133
+[[/images/ws-iso-new.png]]
134
+
135
+Select **Typical** or **Custom**, and then choose **Next**. These instructions refer to a Typical installation.
136
+
137
+[[/images/ws-iso-typical.png]]
138
+
139
+## Step 2: Select the ISO Image
140
+
141
+Select **Installer disc image file (iso)**, choose **Browse** and select the Photon OS ISO file.
142
+
143
+[[/images/ws-iso-selected.png]]
144
+
145
+## Step 3: Select the Operating System
146
+
147
+Choose **Next**. Select the Guest operating system.
148
+
149
+For the Guest operating system, select **Linux**.
150
+
151
+Click the Version dropdown and select **VMware Photon 64-bit**  from the list.
152
+
153
+[[/images/ws-iso-os.png]]
154
+
155
+## Step 4: Specify the VM Name and Location
156
+
157
+Choose **Next**. Specify a virtual machine name and location.
158
+
159
+[[/images/ws-iso-name.png]]
160
+
161
+## Step 5: Specify Disk Options
162
+
163
+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.
164
+
165
+[[/images/ws-iso-disk.png]]
166
+
167
+## Step 6: Configure VM Settings
168
+
169
+Choose **Next**. Workstation displays a summary of your selections.
170
+
171
+[[/images/ws-iso-summary.png]]
172
+
173
+**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**.
174
+
175
+[[/images/ws-iso-customize.png]]
176
+
177
+Consider removing the following components, which are not used by Photon OS:
178
+
179
+- Select **Sound Card**, un-tick the **Connect at power on** option. Confirm your action and choose **Close** to return to the VM Settings by .
180
+- 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**.
181
+- Select **Display** and ensure that the **Accelerate 3D Graphics** option is unchecked (it should be unchecked, by default) and then choose **Close**.
182
+- 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.
183
+- Choose  **Finish**.
184
+
185
+In Workstation, choose **Edit virtual machine settings**, select **CD/DVD (IDE)**, and verify that **Connect at power on** is selected.
186
+
187
+[[/images/ws-iso-cd.png]]
188
+
189
+## Step 7: Configure a Secure Boot (Optional)
190
+
191
+**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**.
192
+
193
+[[/images/ws-iso-efi.png]]
194
+
195
+The EFI boot ensures that the ISO content is signed by VMware and that the entire stack is secure.
196
+
197
+Choose **OK**.
198
+
199
+[[/images/ws-iso-settings.png]]
200
+
201
+## Step 8: Power On the VM
202
+
203
+Choose **Power on this virtual machine**.
204
+
205
+When you see the Photon Installer boot menu, press Enter on your keyboard to start installing.
206
+
207
+[[/images/ws-iso-installer.png]]
208
+
209
+Review the license agreement.
210
+
211
+[[/images/ws-iso-license.png]]
212
+
213
+Choose **Accept** and press Enter.
214
+
215
+## Step 9: Configure the Partition
216
+
217
+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.
218
+
219
+[[/images/ws-iso-disk-partition.png]]
220
+
221
+**Note:**  If you choose Custom, the installer displays the following screen.
222
+
223
+[[/images/ws-iso-disk-partition-custom.png]]
224
+
225
+For each custom partition, choose **Create New**  and specify the following information:
226
+
227
+[[/images/ws-iso-disk-partition-new.png]]
228
+
229
+**Size** - Preallocated size of this partition, in MB.
230
+
231
+**Type** - One of the following options:
232
+
233
+- **ext3** - ext3 file system
234
+- **ext4** - ext4 file system
235
+- **swap** - swap partition
236
+
237
+**Mountpoint** - Mount point for this partition.
238
+
239
+Choose **OK** and press the Enter key. When you are done defining custom partitions, choose **Next** and press the Enter key.
240
+
241
+The installer prompts you to confirm that you want to erase the entire disk. Choose  **Yes**  and press the Enter key.
242
+
243
+[[/images/ws-iso-disk-erase.png]]
244
+
245
+## Step 10: Select an Installation Option
246
+
247
+After partitioning the disk, the installer will prompt you to select an installation option.
248
+
249
+[[/images/ws-iso-install-option.png]]
250
+
251
+Each installation option provides a different run-time environment, depending on your requirements.
252
+
253
+| **Option** | **Description** |
254
+| --- | --- |
255
+| **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. |
256
+| **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. |
257
+| **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 &quot;Photon OSTree Host&quot; 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. |
258
+
259
+**Note:**  The option you choose determines the disk and memory resources required for your installation.
260
+
261
+Select the option you want and press the Enter key.
262
+
263
+## Step 11: Select the Linux Kernel
264
+
265
+Select a Linux kernel to install.
266
+
267
+[[/images/ws-iso-kernel.png]]
268
+
269
+- **Hypervisor optimized** means that any components that are not needed for running under a VMware hypervisor have been removed for faster boot times.
270
+- **Generic** means that all components are included.
271
+
272
+Choose **Next** and press the Enter key.
273
+
274
+## Step 12: Specify the Hostname
275
+
276
+The installer prompts you for a hostname and suggest a randomly generated, unique hostname that you can change if you want.
277
+
278
+[[/images/ws-iso-hostname.png]]
279
+
280
+Press the Enter key.
281
+
282
+## Step 13: Specify the System root Password
283
+
284
+**_Note_** _: Photon OS will not permit commonly used dictionary words to be set as a root password._
285
+
286
+The installer prompts you to enter the system root password. Type the password and press the Enter key.
287
+
288
+[[/images/ws-iso-root-password.png]]
289
+
290
+The installer prompts you to confirm the root password by typing it a second time.
291
+
292
+[[/images/ws-iso-root-password-confirm.png]]
293
+
294
+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.
295
+
296
+## Step 14: Reboot the VM and Log In
297
+
298
+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.
299
+
300
+[[/images/ws-iso-installed.png]]
301
+
302
+Press any key on the keyboard and the virtual machine will reboot into Photon OS.
303
+
304
+As the initial boot process begins, the installer displays the Photon splash screen, and then a login prompt.
305
+
306
+[[/images/ws-iso-splash.png]]
307
+
308
+At the login prompt, type **root**  as the username and provide the password chosen during the installation.
309
+
310
+[[/images/ws-iso-login.png]]
311
+
312
+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.
313
+
314
+# Deploying a Containerized Application in Photon OS
315
+
316
+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.
317
+
318
+## Step 1: Run Docker
319
+
320
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
321
+
322
+    systemctl start docker
323
+
324
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
325
+
326
+    systemctl enable docker
327
+
328
+## Step 2: Run the Nginx Web Server
329
+
330
+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:
331
+
332
+    docker run -d -p 80:80 vmwarecna/nginx
333
+
334
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
335
+
336
+[[/images/ws-docker-run.png]]
337
+
338
+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.
339
+
340
+## Step 3: Test the Web Server
341
+
342
+To test that your Web Server is active, run the **ifconfig** command to get the IP address of the Photon OS Virtual Machine.
343
+
344
+[[/images/ws-docker-ifconfig.png]]
345
+
346
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on &quot; **eth0**&quot;.
347
+
348
+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.
349
+
350
+[[/images/ws-docker-confirm.png]]
351
+
352
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
353
+
354
+# Installing Photon OS 1.0
355
+
356
+Refer to the Photon OS 1.0 installation instructions in [Running Photon OS on Fusion](https://github.com/vmware/photon/wiki/Running-Project-Photon-on-Fusion).
0 357
\ No newline at end of file
1 358
new file mode 100644
... ...
@@ -0,0 +1,501 @@
0
+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.
1
+
2
+- [About Photon OS](#about-photon-os)
3
+- [Deciding Whether to Use OVA or ISO](#deciding-whether-to-use-ova-or-iso)
4
+- [Downloading Photon OS](#downloading-photon-os)
5
+- [Importing the OVA for Photon OS 2.0](#importing-the-ova-for-photon-os-20)
6
+- [Installing the ISO Image for Photon OS 2.0](#installing-the-iso-image-for-photon-os-20)
7
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
8
+- [Installing Photon OS v1.0](#installing-photon-os-10)
9
+
10
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](https://github.com/vmware/photon/wiki/Upgrading-to-Photon-OS-2.0). 
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
+# Requirements
17
+
18
+Using Photon OS within VMware vSphere requires the following resources:
19
+
20
+| **Resources** | **Description** |
21
+| --- | --- |
22
+| 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). |
23
+| Memory | ESXi host with 2GB of free RAM (recommended) |
24
+| 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 |
25
+| Distribution File | Photon OS ISO or OVA file downloaded from Bintray |
26
+
27
+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).
28
+
29
+**Note:** The setup instructions in this guide use VMware vSphere 6 and the vSphere web client.
30
+
31
+# Deciding Whether to Use OVA or ISO
32
+
33
+The first step is decide whether to use the OVA or ISO distribution to set up Photon OS.
34
+
35
+- **OVA import** : Because of the nature of an OVA, you&#39;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&#39;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.
36
+- **ISO install** : The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
37
+
38
+If you&#39;re just looking for the fastest way to get up and running, start with the OVA.
39
+
40
+# Downloading Photon OS
41
+
42
+Once you&#39;ve decided which way to install, you&#39;ll need to download the correct binaries. Go to the following Bintray URL and download the latest release of Photon OS:
43
+
44
+[https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
45
+
46
+For instructions, see [Downloading Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
47
+
48
+**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.
49
+
50
+# Importing the OVA for Photon OS 2.0
51
+
52
+Using the OVA is a fast and easy way to create a Photon OS VM on VMware vSphere.
53
+
54
+After you&#39;ve downloaded the OVA, log in to your vSphere environment.
55
+
56
+## Step 1: Start the Import Process
57
+
58
+From the Actions pull-down menu, choose **Create/Register VM**.
59
+
60
+[[/images/vs-ova-new-vm.png]]
61
+
62
+In the Select creation type window, choose  **Deploy a virtual machine from an OVF or OVA file**.
63
+
64
+[[/images/vs-ova-new-vm-ova.png]]
65
+
66
+Choose **Next**.
67
+
68
+## Step 2: Select the OVA File
69
+
70
+Enter a name for the virtual machine, and select the OVA file.
71
+
72
+[[/images/vs-ova-name-selected.png]]
73
+
74
+Choose **Next**.
75
+
76
+## Step 3: Specify the Target Datastore
77
+
78
+From the Select storage screen, select the target datastore for your VM.
79
+
80
+[[/images/vs-ova-storage.png]]
81
+
82
+Choose  **Next**.
83
+
84
+## Step 4: Accept the License Agreement
85
+
86
+Read through the Photon OS License Agreement, and then choose **I Agree**.
87
+
88
+[[/images/vs-ova-license.png]]
89
+
90
+Choose **Next**.
91
+
92
+## Step 5: Select Deployment Options
93
+
94
+Select deployment options.
95
+
96
+[[/images/vs-ova-deployment-options.png]]
97
+
98
+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.
99
+
100
+Choose **Next**.
101
+
102
+## Step 6: Verify Deployment Settings
103
+
104
+Verify your deployment settings.
105
+
106
+[[/images/vs-ova-settings.png]]
107
+
108
+Click **Finish**. vSphere uploads and validates your OVA. Depending on bandwidth, this operation might take a while.
109
+
110
+When finished, vShield powers up a new VM based on your selections.
111
+
112
+## Step 7: Change Login Settings
113
+
114
+[[/images/vs-ova-splash.png]]
115
+
116
+After the VM is booted, open the command window. vSphere prompts you to log in.
117
+
118
+**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:
119
+
120
+| **Setting** | **Value** |
121
+| --- | --- |
122
+| Username | ``root`` |
123
+| Password | ``changeme`` |
124
+
125
+After you provide these credentials, vSphere prompts you to create a new password and type it a second time to verify it.
126
+
127
+**Note:** For security, Photon OS forbids common dictionary words for the root password.  
128
+
129
+Once logged in, you will see the shell prompt.
130
+
131
+[[/images/vs-ova-login.png]]
132
+
133
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os).
134
+
135
+## Step 9: Export the VM as a Template (Optional)
136
+
137
+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.
138
+
139
+# Installing the ISO Image for Photon OS 2.0
140
+
141
+After you have downloaded the Photon OS ISO image into a folder of your choice, complete the following steps.
142
+
143
+## Step 1: Upload the ISO Image
144
+
145
+Upload the ISO image to a datastore that is attached to the host on which you&#39;ll create the Photon OS virtual machine.
146
+
147
+## Step 2: Create a New VM
148
+
149
+Log in to your vSphere environment. In the Virtual Machines window, choose **Create/Register VM**.
150
+
151
+On the Select creation type screen, select **Create a new virtual machine**.
152
+
153
+[[/images/vs-iso-new.png]]
154
+
155
+Choose **Next**.
156
+
157
+## Step 3: Configure VM Settings
158
+
159
+Specify a VM name.
160
+
161
+[[/images/vs-iso-name.png]]
162
+
163
+Specify a guest operating system.
164
+
165
+- For Compatibility, select **ESXi 6.5**.
166
+- For Guest OS family, select **Linux**.
167
+- For Guest OS version, select **VMware Photon OS (64-bit)**.
168
+
169
+[[/images/vs-iso-os.png]]
170
+
171
+Choose  **Next**.
172
+
173
+## Step 4: Select the Target Datastore
174
+
175
+Select the datastore where you want to store the VM.
176
+
177
+[[/images/vs-iso-datastore.png]]
178
+
179
+Click **Next**.
180
+
181
+## Step 5: Customize VM Settings
182
+
183
+Customize the virtual machine settings.
184
+
185
+[[/images/vs-iso-customize.png]]
186
+
187
+For CD/DVD Drive 1, click the drop-down and select **Datastore ISO file**.
188
+
189
+In the Datastore browser, select the ISO that you want to import.
190
+
191
+Change other settings as applicable.
192
+
193
+- 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.
194
+- 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.
195
+
196
+Choose **Next**.
197
+
198
+## Step 6: Verify VM Settings
199
+
200
+The installer displays a summary of your selected settings.
201
+
202
+[[/images/vs-iso-ready.png]]
203
+
204
+Click **Finish**. vSphere creates the VM.
205
+
206
+## Step 7: Power on the VM
207
+
208
+Select the VM and power it on.
209
+
210
+[[/images/vs-iso-install.png]]
211
+
212
+When you see the Photon Installer boot menu, press Enter on your keyboard to start installing.
213
+
214
+## Step 8: Accept the License Agreement
215
+
216
+Read the License Agreement and press the Enter key to accept.
217
+
218
+[[/images/vs-iso-license.png]]
219
+
220
+## Step 9: Configure the Partition
221
+
222
+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.
223
+
224
+[[/images/vs-iso-partition.png]]
225
+
226
+**Note:**  If you choose Custom, the installer displays the following screen.
227
+
228
+[[/images/vs-iso-partition-custom.png]]
229
+
230
+For each custom partition, choose **Create New**  and specify the following information:
231
+
232
+[[/images/vs-iso-partition-new.png]]
233
+
234
+**Size** - Preallocated size of this partition, in MB.
235
+
236
+**Type** - One of the following options:
237
+
238
+- **ext3** - ext3 file system
239
+- **ext4** - ext4 file system
240
+- **swap** - swap partition
241
+
242
+**Mountpoint** - Mount point for this partition.
243
+
244
+Choose **OK** and press the Enter key. When you are done defining custom partitions, choose **Next** and press the Enter key.
245
+
246
+The installer prompts you to confirm that you want to erase the entire disk.
247
+
248
+[[/images/vs-iso-erase.png]]
249
+
250
+Choose **Yes** and press the Enter key.
251
+
252
+## Step 10: Select an Installation Option
253
+
254
+After partitioning the disk, the installer will prompt you to select an installation option.
255
+
256
+[[/images/vs-iso-install-option.png]]
257
+
258
+Each install option provides a different run-time environment, depending on your requirements.
259
+
260
+| **Option** | **Description** |
261
+| --- | --- |
262
+| **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. |
263
+| **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. |
264
+| **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 &quot;Photon OSTree Host&quot; 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. |
265
+
266
+**Note:**  The option you choose determines the disk and memory resources required for your installation.
267
+
268
+Select the option you want and press the Enter key.
269
+
270
+## Step 11: Select the Linux Kernel
271
+
272
+Select a Linux kernel to install.
273
+
274
+[[/images/vs-iso-kernel.png]]
275
+
276
+- **Hypervisor**  optimized means that any components that are not needed for running under a VMware hypervisor have been removed for faster boot times.
277
+- **Generic**  means that all components are included.
278
+
279
+Choose **Next** and press the Enter key.
280
+
281
+## Step 12: Specify the Hostname
282
+
283
+The installer prompts you for a hostname and suggest a randomly generated, unique hostname that you can change if you want.
284
+
285
+[[/images/vs-iso-hostname.png]]
286
+
287
+Press the Enter key.
288
+
289
+## Step 13: Specify the System root Password
290
+
291
+The installer prompts you to enter the system root password.
292
+
293
+_Note: Photon OS will not permit commonly used dictionary words to be set as a root password._
294
+
295
+[[/images/vs-iso-root-password.png]]
296
+
297
+Type a password and press the Enter key.
298
+
299
+The installer prompts you to confirm your root password by typing it a second time.
300
+
301
+[[/images/vs-iso-root-password-confirm.png]]
302
+
303
+**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.
304
+
305
+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.
306
+
307
+## Step 14: Reboot the VM and Log In
308
+
309
+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.
310
+
311
+[[/images/vs-iso-installed.png]]
312
+
313
+As the initial boot process begins, the installer displays the Photon splash screen, and then a login prompt.
314
+
315
+[[/images/vs-iso-splash.png]]
316
+
317
+At the login prompt, type **root**  as the username and provide the password chosen during the installation.
318
+
319
+[[/images/vs-iso-login.png]]
320
+
321
+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.
322
+
323
+# Deploying a Containerized Application in Photon OS
324
+
325
+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.
326
+
327
+## Step 1: Run Docker
328
+
329
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
330
+
331
+    systemctl start docker
332
+
333
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
334
+
335
+    systemctl enable docker
336
+
337
+## Step 2: Run the Nginx Web Server
338
+
339
+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:
340
+
341
+    docker run -d -p 80:80 vmwarecna/nginx
342
+
343
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
344
+
345
+[[/images/vs-docker-run.png]]
346
+
347
+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!
348
+
349
+## Step 3: Test the Web Server
350
+
351
+To test that your Web Server is active, run the ifconfig command to get the IP address of the Photon OS Virtual Machine.
352
+
353
+[[/images/vs-docker-ifconfig.png]]
354
+
355
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on **eth0**.
356
+
357
+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.
358
+
359
+[[/images/vs-docker-confirm.png]]
360
+
361
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
362
+
363
+# Installing Photon OS v1.0
364
+
365
+This section provides installation instructions for Photon OS v1.0.
366
+
367
+## Photon OS 1.0 Prerequisites
368
+
369
+In order to install and start using Photon OS with VMware vSphere, the following pre-requisites must be satisfied: 
370
+
371
+* VMware vSphere 5.5 or VMware vSphere 6.0 installed 
372
+* ESXi host with recommended 2GB of free RAM
373
+* ESXi host with recommended 8GB of free disk space
374
+* The Photon OS ISO downloaded from Bintray
375
+
376
+This document uses VMware vSphere 6. VMware recommends that you use the latest version, though vSphere 5.5 or later should work as well. 
377
+
378
+## Importing the Photon OS 1.0 OVA
379
+
380
+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. 
381
+
382
+![vsphere1](https://cloud.githubusercontent.com/assets/11306358/9568101/1fc05610-4f06-11e5-912c-0009be3ef065.jpg)
383
+
384
+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. 
385
+
386
+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.
387
+
388
+Click `Finish`
389
+
390
+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. 
391
+
392
+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.
393
+ 
394
+## Installing the Photon OS 1.0 ISO Image
395
+
396
+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.
397
+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.
398
+
399
+![vsphere2](https://cloud.githubusercontent.com/assets/11306358/9568103/200be058-4f06-11e5-876c-8d3645abb638.jpg)
400
+
401
+When prompted for the `Guest OS Family,` choose `Linux` and, for Guest OS Version, choose `Other 3.x Linux (64-bit)`. 
402
+
403
+![vsphere3](https://cloud.githubusercontent.com/assets/11306358/9568111/21ae2920-4f06-11e5-97e6-3be30cea894b.jpg)
404
+
405
+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.`
406
+
407
+![vsphere4](https://cloud.githubusercontent.com/assets/11306358/9568107/2089147e-4f06-11e5-9549-908b8ab21a86.jpg)
408
+
409
+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).
410
+
411
+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.
412
+
413
+![vsphere5](https://cloud.githubusercontent.com/assets/11306358/9568105/20589cd6-4f06-11e5-8b6c-88974382317d.jpg)
414
+
415
+Once connected to the remote console, select `Install` to proceed.
416
+
417
+![vsphere6](https://cloud.githubusercontent.com/assets/11306358/16130444/b781bcac-33ce-11e6-8cbf-2dea3c0e3e40.png)
418
+
419
+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.
420
+
421
+![vsphere7](https://cloud.githubusercontent.com/assets/11306358/9568104/2043ea16-4f06-11e5-9b8f-48f6037501da.jpg)
422
+
423
+You will now be presented with several installation options:
424
+
425
+![vsphere8](https://cloud.githubusercontent.com/assets/11306358/16130445/b787f3e2-33ce-11e6-874b-ebdf97b568b5.png)
426
+
427
+Each install option provides a different runtime environment:
428
+
429
+* 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. 
430
+
431
+* 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. 
432
+
433
+* 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. 
434
+
435
+* 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.  
436
+
437
+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.
438
+
439
+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:
440
+
441
+![vsphere9](https://cloud.githubusercontent.com/assets/11306358/9568108/20a8348a-4f06-11e5-9826-fcf992fb6635.jpg)
442
+
443
+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.
444
+
445
+*Note: Photon OS will not permit commonly used dictionary words to be set as a root password.*
446
+
447
+After confirming the password, the installation process should begin.
448
+
449
+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.
450
+
451
+As the initial boot process begins, you will see the Photon splash screen before you are taken to a login prompt.
452
+
453
+At the login prompt, enter `root` as the username and provide the password chosen during the installation. 
454
+
455
+You have now successfully setup Photon OS and are ready to use your container runtime environment.
456
+ 
457
+## Installing a Containerized Application in Photon OS 1.0
458
+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.
459
+
460
+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.
461
+
462
+To run Docker from the command prompt, enter the command below to initialize the docker engine:
463
+
464
+`systemctl start docker`
465
+
466
+To ensure the docker daemon service runs on every subsequent VM reboot, enter:
467
+
468
+`systemctl enable docker`
469
+
470
+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:
471
+
472
+`docker run -d -p 80:80 vmwarecna/nginx`
473
+
474
+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: 
475
+
476
+![vsphere12](https://cloud.githubusercontent.com/assets/11306358/9568112/21aeeedc-4f06-11e5-9feb-280e4a8f2d5b.jpg)
477
+
478
+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.
479
+
480
+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: 
481
+
482
+	ifconfig
483
+
484
+This will now display a list of adapters connected to the virtual machine.  Typically, the web server daemon will be bound to `eth0.`  
485
+
486
+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:
487
+
488
+![vsphere13](https://cloud.githubusercontent.com/assets/11306358/9568113/21b1990c-4f06-11e5-9136-afe1e45bd105.jpg)
489
+
490
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
491
+
492
+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:
493
+
494
+`iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT`
495
+
496
+In addition, you might have to modify /etc/httpd/httpd.conf to listen on Port 80 by adding the following line:  
497
+
498
+`Listen 0.0.0.0:80`
499
+
500
+**We hope you enjoy using Photon OS as much as we enjoy creating it.**
0 501
new file mode 100644
... ...
@@ -0,0 +1,514 @@
0
+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.
1
+
2
+- [About Photon OS](#about-photon-os)
3
+- [Requirements](#requirements)
4
+- [Deciding Whether to Use an OVA or ISO](#deciding-whether-to-use-an-ova-or-iso)
5
+- [Downloading Photon OS](#downloading-photon-os)
6
+- [Importing the OVA for Photon OS 2.0](#importing-the-ova-for-photon-os-20)
7
+- [Installing the ISO Image for Photon OS 2.0](#installing-the-iso-image-for-photon-os-20)
8
+- [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os)
9
+- [Installing Photon OS 1.0](#installing-photon-os-10)
10
+
11
+**Note**: If you want to upgrade an existing Photon 1.0 VM, refer to the instructions in [Upgrading to Photon OS 2.0](https://github.com/vmware/photon/wiki/Upgrading-to-Photon-OS-2.0). 
12
+
13
+# About Photon OS
14
+
15
+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/).
16
+
17
+# Requirements
18
+
19
+Using Photon OS within VMware Fusion requires the following resources:
20
+
21
+| **Resource** | **Description** |
22
+| --- | --- |
23
+| VMware Fusion | VMware Fusion (v7.0 or higher) must be installed. The latest version is recommended. |
24
+| Memory | 2GB of free RAM (recommended) |
25
+| Storage | **Minimal Photon install** : 512MB of free space (minimum); **Full Photon install** : 4GB of free space (minimum); 8GB recommended. |
26
+| Distribution File | Photon OS ISO or OVA file downloaded from bintray ( [https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)). |
27
+
28
+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).
29
+
30
+**Note:** The setup instructions in this guide use VMware Fusion Professional version 8.5.8, as per the following screenshot.
31
+
32
+[[/images/fs-version.png]]
33
+
34
+# Deciding Whether to Use an OVA or ISO
35
+
36
+The first step is decide whether to use the OVA or ISO distribution to set up Photon OS.
37
+
38
+- **OVA import**: Because of the nature of an OVA, you&#39;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&#39;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**.
39
+- **ISO install**: The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
40
+
41
+If you&#39;re just looking for the fastest way to get up and running, start with the OVA.
42
+
43
+# Downloading Photon OS
44
+
45
+Once you&#39;ve decided which way to install, you&#39;ll need to download the correct binaries. Go to the following Bintray URL and download the latest release of Photon OS:
46
+
47
+[https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
48
+
49
+For instructions, see  [Downloading Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS).
50
+
51
+# Importing the OVA for Photon OS 2.0
52
+
53
+Importing the OVA image is the easiest way to create a Photon OS VM.
54
+
55
+## Step 1: Start the Import Process
56
+
57
+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.
58
+
59
+[[/images/fs-ova-import.png]]
60
+
61
+Choose the **Choose File …**  button to locate and select the Photon OS OVA, then choose **Contionue**.
62
+
63
+[[/images/fs-ova-selected.png]]
64
+
65
+## Step 2: Specify the Name and Storage Location
66
+
67
+Provide the name and storage location for your Photon OS VM, then choose **Save**.
68
+
69
+[[/images/fs-ova-name.png]]
70
+
71
+Review the Photon OS License Agreement, then choose **Accept** to start the import process.
72
+
73
+[[/images/fs-ova-license.png]]
74
+
75
+## Step 3: Configure VM Settings
76
+
77
+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).
78
+
79
+[[/images/fs-ova-finish.png]]
80
+
81
+**Important:** Choose **Customize Settings**  to change the operating system (as recognized by the hypervisor) for the newly imported VM.
82
+
83
+[[/images/fs-ova-settings.png]]
84
+
85
+Choose **General**.
86
+
87
+Click the selection box next to **OS**, select **Linux** , and then select **VMware Photon 64-bit**.
88
+
89
+[[/images/fs-ova-os.png]]
90
+
91
+Close the settings window. Fusion prompts you to verify that you want to change the operating system.
92
+
93
+[[/images/fs-ova-os-confirm.png]]
94
+
95
+Click **Change**. Your Photon OS VM is ready to power on.
96
+
97
+## Step 4: Power on the VM
98
+
99
+Power on the Photon OS VM. Fusion may ask you whether you want to upgrade this VM.
100
+
101
+[[/images/fs-ova-upgrade.png]]
102
+
103
+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&#39;t upgrade if you want to be compatible with older tools that are supported in hardware version 11.
104
+
105
+## Step 5: Update Login Credentials
106
+
107
+[[/images/fs-ova-splash.png]]
108
+
109
+After the VM is booted, Fusion prompts you to log in.
110
+
111
+**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:
112
+
113
+| **Setting** | **Value** |
114
+| --- | --- |
115
+| Username | ``root`` |
116
+| Password | ``changeme`` |
117
+
118
+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.
119
+
120
+[[/images/fs-ova-login.png]]
121
+
122
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](#deploying-a-containerized-application-in-photon-os).
123
+
124
+# Installing the ISO Image for Photon OS 2.0
125
+
126
+After you have downloaded the latest Photon OS ISO image into a folder of your choice, open VMware Fusion.
127
+
128
+## Step 1: Start the Installation Process
129
+
130
+From the File menu, choose  **New**.
131
+
132
+[[/images/fs-iso-new.png]]
133
+
134
+From the Select the Installation Method dialog, select **Install from disc or image**, and then choose **Continue**.
135
+
136
+[[/images/fs-iso-new-prompt.png]]
137
+
138
+## Step 2: Select the ISO Image
139
+
140
+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**.
141
+
142
+[[/images/fs-iso-new-selected.png]]
143
+
144
+## Step 3: Select the Operating System
145
+
146
+On the Choose Operating System dialog, select **Linux**  in the left-hand column and **VMware Photon 64-bit**  in the right-hand column.
147
+
148
+[[/images/fs-iso-os.png]]
149
+
150
+Choose **Continue**.
151
+
152
+## Step 4: Select the Virtual Disk (Optional)
153
+
154
+If you are using a Fusion version that is older than Fusion 8, you might see the following dialog.
155
+
156
+[[/images/fs-iso-virtual-disk.png]]
157
+
158
+If you see this dialog, unless you&#39;re installing into an existing machine, choose **Create a new virtual disk**  from the Choose a Virtual Disk dialog, and then choose **Continue**.
159
+
160
+**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).
161
+
162
+## Step 5: Configure VM Settings
163
+
164
+**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.
165
+
166
+[[/images/fs-iso-finish.png]]
167
+
168
+To remove unnecessary devices, choose **Customize Settings**.
169
+
170
+First, choose a name for your Virtual Machine, along with the folder into which you create the Virtual Machine (or accept the default folder).
171
+
172
+[[/images/fs-iso-name.png]]
173
+
174
+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.
175
+
176
+[[/images/fs-iso-settings.png]]
177
+
178
+You can remove (recommended) the following components that are not used by Photon OS:
179
+
180
+- 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.
181
+- 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.
182
+- 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.
183
+- Select **USB &amp; Bluetooth** and uncheck the **Share Bluetooth devices with Linux** setting. Select **Show All** to return to the VM Settings.
184
+- 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.
185
+- 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.
186
+- 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.
187
+
188
+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.
189
+
190
+## Step 6: Configure a Secure Boot (Optional)
191
+
192
+**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:
193
+
194
+**firmware = &quot;efi&quot;**
195
+
196
+The EFI boot ensures that the ISO content is signed by VMware and that the entire stack is secure.
197
+
198
+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.
199
+
200
+## Step 7: Power On the VM
201
+
202
+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).
203
+
204
+Fusion powers on the host and starts the installation. Within a few seconds, Fusion displays the Photon OS installer boot menu.
205
+
206
+[[/images/fs-iso-install.png]]
207
+
208
+Press the Enter key on your keyboard to start installing.
209
+
210
+[[/images/fs-iso-license.png]]
211
+
212
+Read the License Agreement and press the Enter key to accept.
213
+
214
+## Step 8: Configure the Partition
215
+
216
+The Installer will detect one disk, which should be the 8GB volume configured as part of the virtual machine creation.
217
+
218
+[[/images/fs-iso-partition.png]]
219
+
220
+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.
221
+
222
+**Note:** If you choose **Custom**, the installer displays the following screen.
223
+
224
+[[/images/fs-iso-partition-custom.png]]
225
+
226
+For each custom partition, choose **Create New**  and specify the following information:
227
+
228
+[[/images/fs-iso-partition-new.png]]
229
+
230
+**Size** - Preallocated size of this partition, in MB.
231
+
232
+**Type** - One of the following options:
233
+
234
+- **ext3** - ext3 file system
235
+- **ext4** - ext4 file system
236
+- **swap** - swap partition
237
+
238
+**Mountpoint** - Mount point for this partition.
239
+
240
+Choose **OK** and press the Enter key. When you are done defining custom partitions, choose **Next**  and press the Enter key.
241
+
242
+The installer prompts you to confirm that you want to erase the entire disk.
243
+
244
+[[/images/fs-iso-disk-erase.png]]
245
+
246
+Choose **Yes** and press the Enter key to accept and proceed with the installation.
247
+
248
+## Step 9: Select an Installation Option
249
+
250
+After partitioning, the installer prompts you to select one of three installation options:
251
+
252
+[[/images/fs-iso-install-option.png]]
253
+
254
+Each install option provides a different run-time environment. Select the option that best meets your requirements.
255
+
256
+| **Option** | **Description** |
257
+| --- | --- |
258
+| **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. |
259
+| **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. |
260
+| **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 &quot;Photon OSTree Host&quot; 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. |
261
+
262
+**Note:** The option you choose determines the disk and memory resources required for your installation.
263
+
264
+Select the option you want and press the Enter key.
265
+
266
+## Step 10: Select the Linux Kernel
267
+
268
+The installer prompts you to select the Linux kernel to install:
269
+
270
+[[/images/fs-iso-kernel.png]]
271
+
272
+- **Hypervisor optimized** means that any components that are not needed for running under a VMware hypervisor have been removed for faster boot times.
273
+- **Generic** means that all components are included.
274
+
275
+## Step 11: Specify the Hostname
276
+
277
+The installer prompts you for a hostname and suggest a randomly generated, unique hostname that you can change if you want.
278
+
279
+[[/images/fs-iso-hostname.png]]
280
+
281
+Press the Enter key.
282
+
283
+## Step 12: Specify the System root Password
284
+
285
+_Note: Photon OS will not permit commonly used dictionary words to be set as a root password._
286
+
287
+The installer prompts you to enter the system root password. Type the password, and then press the Enter key.
288
+
289
+[[/images/fs-iso-root-password.png]]
290
+
291
+Confirm the root password by typing it a second time.
292
+
293
+[[/images/fs-iso-root-password-confirm.png]]
294
+
295
+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.
296
+
297
+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.
298
+
299
+[[/images/fs-iso-installed.png]]
300
+
301
+## Step 13: Reboot the VM and Log In
302
+
303
+Press any key on the keyboard and the virtual machine will reboot into Photon OS.
304
+
305
+[[/images/fs-iso-splash.png]]
306
+
307
+As the initial boot process begins, the installer displays the Photon splash screen, and then a login prompt.
308
+
309
+At the login prompt, enter **root**  as the username and provide the password chosen during the installation.
310
+
311
+[[/images/fs-iso-login.png]]
312
+
313
+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.
314
+
315
+# Deploying a Containerized Application in Photon OS
316
+
317
+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.
318
+
319
+## Step 1: Run Docker
320
+
321
+To run Docker from the command prompt, enter the following command, which initializes the docker engine:
322
+
323
+    systemctl start docker
324
+
325
+To ensure Docker daemon service runs on every subsequent VM reboot, enter the following command:
326
+
327
+    systemctl enable docker
328
+
329
+## Step 2: Run the Nginx Web Server
330
+
331
+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:
332
+
333
+    docker run -d -p 80:80 vmwarecna/nginx
334
+
335
+This pulls the Nginx Web Server files and appropriate dependent container filesystem layers required for this containerized application to run.
336
+
337
+[[/images/fs-docker-run.png]]
338
+
339
+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.
340
+
341
+## Step 3: Test the Web Server
342
+
343
+To test that your Web Server is active, run the ifconfig command to get the IP address of the Photon OS Virtual Machine.
344
+
345
+[[/images/fs-docker-ifconfig.png]]
346
+
347
+The output displays a list of adapters that are connected to the virtual machine. Typically, the web server daemon will be bound on &quot;eth0.&quot;
348
+
349
+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.
350
+
351
+[[/images/fs-docker-confirm.png]]
352
+
353
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
354
+
355
+# Installing Photon OS 1.0
356
+
357
+This section provides setup instructions for Photon OS 1.0.
358
+
359
+## Photon OS 1.0 Prerequisites
360
+In order to install and start using Photon OS with VMware Fusion the following pre-requisites must be satisfied:
361
+* VMware Fusion or VMware Workstation must be installed
362
+* Recommended 2GB of free RAM
363
+* Recommended at least 300MB of free disk space
364
+* Photon OS ISO or OVA
365
+
366
+## Importing the Photon OS 1.0 OVA 
367
+
368
+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.
369
+Note: The “Import” operation is specific to Fusion. For Workstation users, simply double-clicking on the OVA will start the import. 
370
+
371
+![](https://cloud.githubusercontent.com/assets/11306358/16094763/4ac80e12-3307-11e6-8e7b-10ea353ddbfc.png)
372
+
373
+Click “Continue” and provide the name and storage location for your Photon OS VM. Then, click "Save."
374
+
375
+![](https://cloud.githubusercontent.com/assets/11306358/16094759/4ac50000-3307-11e6-8a34-538f36b95f64.png)
376
+
377
+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. 
378
+
379
+![](https://cloud.githubusercontent.com/assets/11306358/16094758/4ac50668-3307-11e6-86ce-943afa12946f.png)
380
+
381
+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.
382
+
383
+![](https://cloud.githubusercontent.com/assets/11306358/16095187/24abc4f6-3309-11e6-9faa-c4e7b15ba63a.png) 
384
+
385
+Close the settings window and your Photon OS VM is ready to power on.
386
+
387
+![](https://cloud.githubusercontent.com/assets/11306358/16094764/4acf69dc-3307-11e6-9d62-7dd37546a233.png)
388
+
389
+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:
390
+
391
+`Username: root`
392
+`Password: changeme`
393
+
394
+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.
395
+
396
+![](https://cloud.githubusercontent.com/assets/11306358/16094765/4ad06ce2-3307-11e6-827f-e61107185f42.png)
397
+ 
398
+## Installing Photon OS 1.0 on VMware Fusion from an ISO Image	
399
+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: 
400
+
401
+![](https://cloud.githubusercontent.com/assets/11306358/14651747/df593c52-0636-11e6-9cbe-bfd0db9bfa89.png)
402
+
403
+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. 
404
+
405
+![fusion7](https://cloud.githubusercontent.com/assets/11306358/14651749/df6fbd74-0636-11e6-8070-a584bddf39f5.png)
406
+
407
+Unless you're installing into an existing machine, select, "Create a new virtual disk" from the "Choose a Virtual Disk dialog, then click "Continue."
408
+
409
+![fusion7b](https://cloud.githubusercontent.com/assets/11306358/14651751/df7428a0-0636-11e6-85b2-64e2dff9be84.png)
410
+
411
+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.  
412
+
413
+![fusion9](https://cloud.githubusercontent.com/assets/11306358/14651750/df7385f8-0636-11e6-9310-0d7f375dd7b5.png) 
414
+
415
+To remove unnecessary devices, from the screen shown below, select “Customize Settings."
416
+
417
+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”.  
418
+
419
+![](https://cloud.githubusercontent.com/assets/11306358/16105478/724ea650-3350-11e6-8e69-272f6a1f6097.png)
420
+
421
+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. 
422
+
423
+![fusion11](https://cloud.githubusercontent.com/assets/11306358/14653053/cd434ffc-063c-11e6-9861-924489b26d75.png)
424
+
425
+It is our recommendation that the following components are removed, since they’re not used by Photon OS:
426
+* 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.”
427
+* 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.
428
+* 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.
429
+* Select “USB & Bluetooth” and uncheck the “Share Bluetooth devices with Linux” setting and then select “Show All”
430
+* 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.”
431
+* 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.
432
+
433
+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. 
434
+
435
+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.
436
+
437
+![](https://cloud.githubusercontent.com/assets/11306358/16105475/72391e0c-3350-11e6-94a2-64587a06e838.png)
438
+
439
+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.
440
+Within a few seconds the Photon OS Installer Boot Menu will appear.
441
+
442
+![](https://cloud.githubusercontent.com/assets/11306358/16105477/724e902a-3350-11e6-8482-7544d2a6c3fb.png)
443
+
444
+Select – “Install” to proceed. 
445
+
446
+![](https://cloud.githubusercontent.com/assets/11306358/16105480/7251abca-3350-11e6-8f8e-d26244fd75ff.png)
447
+
448
+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.
449
+You will now be presented with four installation options:
450
+
451
+![fusion15](https://cloud.githubusercontent.com/assets/11306358/14651982/d464f31c-0637-11e6-938d-5d6132ccd63f.png)
452
+
453
+Each install option provides a different runtime environment, depending on your requirements:
454
+
455
+* 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. 
456
+
457
+* 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. 
458
+
459
+* 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. 
460
+
461
+* 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.  
462
+
463
+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.
464
+
465
+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.
466
+
467
+*Note: Photon OS will not permit commonly used dictionary words to be set as a root password.*
468
+
469
+After confirming the password, the installation process should begin.
470
+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.
471
+
472
+![](https://cloud.githubusercontent.com/assets/11306358/16105476/724e70c2-3350-11e6-84af-0c487266108d.png)
473
+
474
+As the initial boot process begins, you will see the Photon splash screen before you are taken to a login prompt.
475
+
476
+![](https://cloud.githubusercontent.com/assets/11306358/16094764/4acf69dc-3307-11e6-9d62-7dd37546a233.png)
477
+
478
+At the login prompt, enter “root” as the username and provide the password chosen during the installation. 
479
+
480
+You have now successfully setup Photon OS and are ready to use your container runtime environment.
481
+
482
+## Installing a Containerized Application on Photon OS 1.0
483
+
484
+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.
485
+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.
486
+
487
+To run Docker from the command prompt, enter the command below to initialize the docker engine:
488
+
489
+`systemctl start docker`
490
+
491
+To ensure Docker daemon service runs on every subsequent VM reboot, enter:
492
+
493
+`systemctl enable docker`
494
+
495
+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:
496
+
497
+`docker run -d -p 80:80 vmwarecna/nginx`
498
+
499
+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:
500
+
501
+![fusion19](https://cloud.githubusercontent.com/assets/11306358/9568066/b3950dd8-4f04-11e5-9333-ac0551a22ace.jpg)
502
+
503
+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!
504
+
505
+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.”  
506
+ 
507
+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: -
508
+
509
+![fusion20](https://cloud.githubusercontent.com/assets/11306358/9568067/b3b6e278-4f04-11e5-93f6-de8383530518.jpg)
510
+
511
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
512
+
513
+**We hope you enjoy using Photon OS as much as we enjoy creating it!**
0 514
\ No newline at end of file
1 515
new file mode 100644
... ...
@@ -0,0 +1,66 @@
0
+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
1
+
2
+# What is Photon OS?
3
+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.
4
+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.
5
+
6
+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.  
7
+
8
+# Introduction
9
+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. 
10
+
11
+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!
12
+
13
+# Photon OS on vCloud Air Prerequisites
14
+The following items are required for preparing and launching Photon OS on Google Compute Engine:
15
+
16
+* An account on vCloud Air
17
+
18
+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. 
19
+
20
+# Creating a Photon OS Instance
21
+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. 
22
+
23
+![](https://cloud.githubusercontent.com/assets/11306358/9573923/4fdf11f4-4f76-11e5-9706-ed10437dad4d.png)
24
+ 
25
+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. 
26
+
27
+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. 
28
+
29
+![](https://cloud.githubusercontent.com/assets/11306358/9573922/4fcfa37c-4f76-11e5-9e6c-f96cdf9a9b91.png)
30
+ 
31
+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.
32
+
33
+![](https://cloud.githubusercontent.com/assets/11306358/9573917/4fce6430-4f76-11e5-9a76-6cb99f5badfb.png)
34
+ 
35
+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.
36
+ 
37
+# Installing a Containerized Application to Help Demonstrate Capability
38
+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.
39
+
40
+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.
41
+
42
+To run Docker from the command prompt, enter the command below to initialize the Docker engine:
43
+
44
+`systemctl start docker`
45
+
46
+To ensure Docker daemon service runs on every subsequent VM reboot, enter:
47
+
48
+`systemctl enable docker`
49
+
50
+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:
51
+
52
+`docker run -d -p 80:80 vmwarecna/nginx`
53
+
54
+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:
55
+ 
56
+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.
57
+
58
+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."
59
+ 
60
+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:
61
+ 
62
+You can now run any other containerized application from Docker Hub or your own containerized application within Photon OS.
63
+
64
+We hope you enjoy using Photon OS as much as we enjoy creating it!
65
+
0 66
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+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 1
\ No newline at end of file
1 2
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+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](https://github.com/vmware/photon/wiki/What-is-New-in-Photon-OS-2.0).
1
+
2
+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.
3
+
4
+**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.
5
+
6
+For each Photon OS 1.0 VM that you want to upgrade, complete the following steps:
7
+
8
+1. Back up all existing settings and data for the Photon OS 1.0 VM.
9
+
10
+2. Stop any services (for example, docker) that are currently running in the VM.
11
+
12
+3. Download the upgrade package. From the Photon OS 1.0 command line, run the following command:
13
+~~~~
14
+    # tdnf install photon-upgrade
15
+~~~~    
16
+4. Run the upgrade script (photon-upgrade.sh), which upgrades packages and dependencies. Answer Y to any questions.
17
+~~~~
18
+    # photon-upgrade.sh
19
+~~~~
20
+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.
21
+
22
+After upgrading but before you deploy into production, test all previous functionality to ensure that everything works as expected.
0 23
\ No newline at end of file
1 24
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,31 @@
0
+-   [Home](/vmware/photon/wiki)
1
+-   [Download Photon OS](https://github.com/vmware/photon/wiki/Downloading-Photon-OS)
2
+-   [FAQ](https://github.com/vmware/photon/wiki/Frequently-Asked-Questions)
3
+-   Getting Started Guides
4
+    -   [Quick Start](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#quick-start)
5
+    -   [Running Photon OS on vSphere](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-vSphere)
6
+    -   [Running Photon OS on Fusion](https://github.com/vmware/photon/wiki/Running-Project-Photon-on-Fusion)
7
+    -   [Running Photon OS on Workstation](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Workstation)
8
+    -   [Running Photon OS on AWS EC2](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute)
9
+    -   [Running Photon OS on Microsoft Azure](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Microsoft-Azure)
10
+    -   [Running Photon OS on Google Compute Engine](https://github.com/vmware/photon/wiki/Running-Photon-OS-on-Google-Compute-Engine)
11
+-   Guides
12
+    -   [Installation and Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md)
13
+    -   [Troubleshooting Guide](https://github.com/vmware/photon/blob/master/docs/photon-os-troubleshooting-guide.md)
14
+    -   [Photon RPM OSTree](https://github.com/vmware/photon/wiki/Photon-RPM-OSTree:-a-simple-guide)
15
+-   How-To Articles
16
+    -   [Setting Up a Swarm Cluster with DNS](https://github.com/vmware/photon/wiki/Install-and-Configure-a-Swarm-Cluster-with-DNS-Service-on-PhotonOS)
17
+    -   [Setting Up a Mesos Cluster](https://github.com/vmware/photon/wiki/Install-and-Configure-a-Production-Ready-Mesos-Cluster-on-Photon-OS)
18
+    -   [Setting Up Marathon for a Mesos Cluster](https://github.com/vmware/photon/wiki/Install-and-Configure-Marathon-for-Mesos-Cluster-on-PhotonOS)
19
+    -   [Setting Up DCOS CLI for Mesos](https://github.com/vmware/photon/wiki/Install-and-Configure-DCOS-CLI-for-Mesos)
20
+    -   [Setting Up Mesos DNS on a Mesos Cluster](https://github.com/vmware/photon/wiki/Install-and-Configure-Mesos-DNS-on-a-Mesos-Cluster)
21
+    -   [Setting Up a Network PXE Boot Server](https://github.com/vmware/photon/blob/master/docs/PXE-boot.md)
22
+    -   [Working with Kickstart](https://github.com/vmware/photon/blob/master/docs/kickstart.md)
23
+    -   [Running Kubernetes](https://github.com/vmware/photon/blob/master/docs/kubernetes.md)
24
+    -   [Mounting Remote File Systems](https://github.com/vmware/photon/blob/master/docs/nfs-utils.md)
25
+    -   [Building Photon OS from the Source Code](https://github.com/vmware/photon/blob/master/docs/build-photon.md) 
26
+    -   [Installing and Using Lightwave on Photon OS](https://github.com/vmware/photon/wiki/Installing-and-Using-Lightwave-on-Photon-OS)
27
+-   Security
28
+    -   [Security Advisories](https://github.com/vmware/photon/wiki/Security-Advisories)
29
+-   Related
30
+    -   [Lightwave](https://github.com/vmware/lightwave)