Change-Id: I704c1a57ae4ac0b1e58a52fcd5960d32db6ea1e3
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/8046
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Ankit Jain <ankitja@vmware.com>
| ... | ... |
@@ -123,7 +123,79 @@ |
| 123 | 123 |
- [Security Policy](photon_admin/default-security-policy-of-photon-os.md) |
| 124 | 124 |
- [Default Firewall Settings](photon_admin/default-firewall-settings.md) |
| 125 | 125 |
- [Default Permissions and umask](photon_admin/default-permissions-and-umask.md) |
| 126 |
- - [Disabling TLS 1.0 to Improve Transport Layer Security](photon_admin/disabling-tls-1.0.md) |
|
| 126 |
+ - [Disabling TLS 1.0 to Improve Transport Layer Security](photon_admin/disabling-tls-1.0.md) |
|
| 127 |
+ - [Photon RPM OSTree](photon_admin/Photon-RPM-OSTree-a-simple-guide.md) |
|
| 128 |
+ - [Introduction](photon_admin/Photon-RPM-OSTree-1-Introduction.md) |
|
| 129 |
+ - [RPM-OSTree Overview](photon_admin/Photon-RPM-OSTree-1-Introduction.md#rpm-ostree-overview) |
|
| 130 |
+ - [Why use RPM-OSTree in Photon?](photon_admin/Photon-RPM-OSTree-1-Introduction.md#why-use-rpm-ostree-in-photon) |
|
| 131 |
+ - [Photon with RPM-OSTree installation profiles](photon_admin/Photon-RPM-OSTree-1-Introduction.md#photon-with-rpm-ostree-installation-profiles) |
|
| 132 |
+ - [Terminology](photon_admin/Photon-RPM-OSTree-1-Introduction.md#terminology) |
|
| 133 |
+ - [Sample code](photon_admin/Photon-RPM-OSTree-1-Introduction.md#sample-code) |
|
| 134 |
+ - [How to read this book](photon_admin/Photon-RPM-OSTree-1-Introduction.md#how-to-read-this-book) |
|
| 135 |
+ - [RPM-OSTree in Photon OS 3.0](photon_admin/Photon-RPM-OSTree-1-Introduction.md#rpm-ostree-in-photon-os-30) |
|
| 136 |
+ - [Installing a Photon RPM-OSTree host against default server repository](photon_admin/Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md) |
|
| 137 |
+ - [Who is this for?](photon_admin/Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#who-is-this-for) |
|
| 138 |
+ - [Installing the ISO, step by step](photon_admin/Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#installing-the-iso) |
|
| 139 |
+ - [Concepts in action](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md) |
|
| 140 |
+ - [Querying the deployed filetrees](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md#querying-the-deployed-filetrees) |
|
| 141 |
+ - [Bootable filetree version](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md#bootable-filetree-version) |
|
| 142 |
+ - [Commit ID](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md#commit-id) |
|
| 143 |
+ - [OSname](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md#osname) |
|
| 144 |
+ - [Refspec](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md#refspec) |
|
| 145 |
+ - [Deployments](photon_admin/Photon-RPM-OStree-3-Concepts-in-action.md#deployments) |
|
| 146 |
+ - [Querying for commit, file and package metadata](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md) |
|
| 147 |
+ - [Commit history](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#commit-history) |
|
| 148 |
+ - [Listing file mappings](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-file-mappings) |
|
| 149 |
+ - [Listing configuration changes](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-configuration-changes) |
|
| 150 |
+ - [Listing packages](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-packages) |
|
| 151 |
+ - [Querying for package details](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#querying-for-package-details) |
|
| 152 |
+ - [Why am I unable to install, update or delete packages?](photon_admin/Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#why-am-i-unable-to-install-update-or-delete-packages) |
|
| 153 |
+ - [Host updating operations](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md) |
|
| 154 |
+ - [Upgrade overview](photon_admin/photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#upgrade-overview) |
|
| 155 |
+ - [Incremental upgrade](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#incremental-upgrade) |
|
| 156 |
+ - [Listing file differences](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#listing-file-differences) |
|
| 157 |
+ - [Listing package differences](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#listing-package-differences) |
|
| 158 |
+ - [Rollback](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#rollback) |
|
| 159 |
+ - [Installing Packages](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#installing-packages) |
|
| 160 |
+ - [Uninstalling Packages](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#uninstalling-packages) |
|
| 161 |
+ - [Deleting a deployed filetree](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#deleting-a-deployed-filetree) |
|
| 162 |
+ - [Version skipping upgrade](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#version-skipping-upgrade) |
|
| 163 |
+ - [Tracking parent commits](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#tracking-parent-commits) |
|
| 164 |
+ - [Resetting a branch to a previous commit](photon_admin/Photon-RPM-OSTree-5-Host-updating-operations.md#resetting-a-branch-to-a-previous-commit) |
|
| 165 |
+ - [Installing a Photon RPM-OSTree Package](photon_admin/Photon-RPM-OSTree-6-Installing-a-server.md) |
|
| 166 |
+ - [Composing your first OSTree repo](photon_admin/Photon-RPM-OSTree-6-Installing-a-server.md#composing-your-first-OSTree-repo) |
|
| 167 |
+ - [Installing a Photon RPM-OStree host against a custom server repository](photon_admin/Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md) |
|
| 168 |
+ - [Manual install of a custom host](photon_admin/Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#manual-install-of-a-custom-host) |
|
| 169 |
+ - [Automated install of a custom host via kickstart](photon_admin/Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#automated-install-of-a-custom-host-via-kickstart) |
|
| 170 |
+ - [Automatic Updates](photon_admin/RPM-OSTree-AutoUpdate.md) |
|
| 171 |
+ - [Enable Automatic Updates](photon_admin/RPM-OSTree-AutoUpdate.md#enable-automatic-updates) |
|
| 172 |
+ - [File oriented server operations](photon_admin/Photon-RPM-OStree-8-File-oriented-server-operations.md) |
|
| 173 |
+ - [Starting a fresh OSTree repo](photon_admin/Photon-RPM-OStree-8-File-oriented-server-operations.md#starting-a-fresh-ostree-repo) |
|
| 174 |
+ - [Creating summary metadata](photon_admin/Photon-RPM-OStree-8-File-oriented-server-operations.md#creating-summary-metadata) |
|
| 175 |
+ - [Package oriented server operations](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md) |
|
| 176 |
+ - [JSON configuration file](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.mdjson-configuration-file) |
|
| 177 |
+ - [Package addition, removal, upgrade](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#package-addition-removal-upgrade) |
|
| 178 |
+ - [RPMS repository](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#rpms-repository) |
|
| 179 |
+ - [Composing a tree](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#composing-a-tree) |
|
| 180 |
+ - [Automatic version prefix](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#automatic-version-prefix) |
|
| 181 |
+ - [Installing package updates](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#installing-package-updates) |
|
| 182 |
+ - [Creating server metadata](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#creating-server-metadata) |
|
| 183 |
+ - [Starting a fresh OSTree repo](photon_admin/Photon-RPM-OSTree-9-Package-oriented-server-operations.md#starting-a-fresh-ostree-repo) |
|
| 184 |
+ - [Remotes](photon_admin/Photon-RPM-OSTree-10-Remotes.md) |
|
| 185 |
+ - [Listing remotes](photon_admin/Photon-RPM-OSTree-10-Remotes.md#listing-remotes) |
|
| 186 |
+ - [GPG signature verification](photon_admin/Photon-RPM-OSTree-10-Remotes.md#gpg-signature-verification) |
|
| 187 |
+ - [Switching repositories](photon_admin/Photon-RPM-OSTree-10-Remotes.md#switching-repositories) |
|
| 188 |
+ - [Adding and removing remotes](photon_admin/Photon-RPM-OSTree-10-Remotes.md#adding-and-removing-remotes) |
|
| 189 |
+ - [List available branches](photon_admin/Photon-RPM-OSTree-10-Remotes.md#list-available-branches) |
|
| 190 |
+ - [Running container applications between bootable images](photon_admin/Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md) |
|
| 191 |
+ - [Downloading a docker container appliance](photon_admin/Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#downloading-a-docker-container-appliance) |
|
| 192 |
+ - [Rebooting into an existing image](photon_admin/Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#rebooting-into-an-existing-image) |
|
| 193 |
+ - [Reboot into a newly created image](photon_admin/Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#reboot-into-a-newly-created-image) |
|
| 194 |
+ - [Install or rebase to Photon OS 3.0](photon_admin/Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md) |
|
| 195 |
+ - [Composing your own RPM-OSTree Server](photon_admin/Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#composing-your-own-rpm-ostree-server) |
|
| 196 |
+ - [Installing an RPM-OSTree host](photon_admin/Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#installing-an-rpm-ostree-host) |
|
| 197 |
+ - [Rebasing a host from Photon 1.0 to 3.0](photon_admin/Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#rebasing-a-host-from-photon-10-to-20) |
|
| 198 |
+ - [Creating a host raw image](photon_admin/Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#creating-a-host-raw-image) |
|
| 127 | 199 |
- [User Guide](photon_user/README.md) |
| 128 | 200 |
- [Setting Up a Network PXE Boot Server](photon_user/PXE-boot.md) |
| 129 | 201 |
- [Working with Kickstart](photon_user/kickstart.md) |
| 144 | 216 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,68 @@ |
| 0 |
+# Introduction |
|
| 1 |
+ |
|
| 2 |
+## RPM-OSTree Overview |
|
| 3 |
+ |
|
| 4 |
+OSTree is a tool to manage bootable, immutable, versioned filesystem trees. Unlike traditional package managers like rpm or dpkg that know how to install, uninstall, configure packages, OSTree has no knowledge of the relationship between files. But when you add rpm capabilities on top of OSTree, it becomes RPM-OSTree, meaning a filetree replication system that is also package-aware. |
|
| 5 |
+ |
|
| 6 |
+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. |
|
| 7 |
+ |
|
| 8 |
+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. |
|
| 9 |
+You may read more about OSTree [here](https://wiki.gnome.org/Projects/OSTree). |
|
| 10 |
+ |
|
| 11 |
+## Why use RPM-OSTree in Photon? |
|
| 12 |
+ |
|
| 13 |
+There are several important benefits: |
|
| 14 |
+* 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. |
|
| 15 |
+* 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. |
|
| 16 |
+* Manageable: You are provided simple tools to figure out exactly what packages have been installed, to compare files, configuration and package changes between versions. |
|
| 17 |
+* 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. |
|
| 18 |
+ |
|
| 19 |
+As drawbacks, I would mention: |
|
| 20 |
+* Some applications configured by user on host may have compatibility issues if they save configuration or download into read only directories like /usr. |
|
| 21 |
+* 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. |
|
| 22 |
+* Administrators need to be aware about the directories re-mapping specific to OSTree and plan accordingly. |
|
| 23 |
+ |
|
| 24 |
+## Photon with RPM-OSTree installation profiles |
|
| 25 |
+Photon takes advantage of RPM-OSTree and offers several installation choices: |
|
| 26 |
+* Photon RPM-OSTree server - used to compose customized Photon OS installations and to prepare updates. I will call it for short 'server'. |
|
| 27 |
+* 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'. |
|
| 28 |
+* 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'. |
|
| 29 |
+ |
|
| 30 |
+## Terminology |
|
| 31 |
+ |
|
| 32 |
+In this section, the term *OSTree* refers to the general use of this technology, the format of the repository or replication protocol. |
|
| 33 |
+ |
|
| 34 |
+The term *RPM-OSTree* emphasizes 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 does not matter in that context. |
|
| 35 |
+ |
|
| 36 |
+When `ostree` and `rpm-ostree` are encountered, they refer to the usage of the specific Unix commands. |
|
| 37 |
+ |
|
| 38 |
+Finally, *Photon RPM-OSTree* is the application or implementation of the 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. |
|
| 39 |
+ |
|
| 40 |
+## Sample code |
|
| 41 |
+ |
|
| 42 |
+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 connect via ssh, so cut & paste sample code from outside sources or copy files via scp will work. See the Photon Administration guide to learn [how to enable ssh](..\photon_troubleshoot\permitting-root-login-with-ssh.md). |
|
| 43 |
+The samples assume that the following VMs have been installed - see the steps in the next chapters: |
|
| 44 |
+* A default host VM named **photon-host-def**. |
|
| 45 |
+* Two server VMs named **photon-srv1** and **photon-srv2**. |
|
| 46 |
+* Two custom host VMs named **photon-host-cus1** and **photon-host-cus2**, connected each to the corresponding server during install. |
|
| 47 |
+ |
|
| 48 |
+## How to read this book |
|
| 49 |
+ |
|
| 50 |
+The RPM OSTree guide is structured to be used both as a sequential read and as a reference documentation. |
|
| 51 |
+If you are just interested in deploying a host system and keeping it up to date, then read [Installing a Photon RPM-OSTree host against default server repository](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md) and [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md). |
|
| 52 |
+ |
|
| 53 |
+If you want to install your own server and experiment with customizing packages for your Photon hosts, then read [Installing a Photon RPM-OSTree server](Photon-RPM-OSTree-6-Installing-a-server.md) onwards. There are references to the concepts discussed throughout the book, if you need to understand them better. |
|
| 54 |
+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. |
|
| 55 |
+ |
|
| 56 |
+## RPM OSTree in Photon OS 3.0 |
|
| 57 |
+ |
|
| 58 |
+This book is relevant to RPM OSTree in Photon OS 3.0. |
|
| 59 |
+ |
|
| 60 |
+Version 3.0 supports the following features: |
|
| 61 |
+ |
|
| 62 |
+- Upgrade |
|
| 63 |
+- Rollback |
|
| 64 |
+- Remote, compose, and rebase server |
|
| 65 |
+- Installation and uninstallation of packages with URL |
|
| 66 |
+- Installation and uninstallation of packages from default repos |
|
| 67 |
+- Automatic updates |
| 0 | 68 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,97 @@ |
| 0 |
+# Remotes |
|
| 1 |
+ |
|
| 2 |
+In Chapter 3 we talked about the Refspec that contains a **photon:** prefix, that is the name of a remote. When a Photon host is installed, a remote is added - which contains the URL for an OSTree repository that is the origin of the commits we are going to pull from and deploy filetrees, in our case the Photon RPM-OSTree server we installed the host from. This remote is named **photon**, which may be confusing, because it's also the OS name and part of the Refspec (branch) path. |
|
| 3 |
+ |
|
| 4 |
+## Listing remotes |
|
| 5 |
+ |
|
| 6 |
+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. |
|
| 7 |
+ |
|
| 8 |
+``` |
|
| 9 |
+root@photon-host-def [ ~ ]# ostree remote list |
|
| 10 |
+photon |
|
| 11 |
+photon-1 |
|
| 12 |
+``` |
|
| 13 |
+We can inquiry about the URL for that remote name, which for the default host is the expected Photon OS online OSTree repo. |
|
| 14 |
+``` |
|
| 15 |
+root@photon-host-def [ ~ ]# ostree remote show-url photon |
|
| 16 |
+https://<host-name>:8080/repo |
|
| 17 |
+``` |
|
| 18 |
+But where is this information stored? The repo's config file has it. |
|
| 19 |
+``` |
|
| 20 |
+root@photon-host-def [ ~ ]# cat /ostree/repo/config |
|
| 21 |
+[core] |
|
| 22 |
+repo_version=1 |
|
| 23 |
+mode=bare |
|
| 24 |
+ |
|
| 25 |
+[remote "photon"] |
|
| 26 |
+url=http:<Server-IP-Address:port>/repo |
|
| 27 |
+gpg-verify=false |
|
| 28 |
+``` |
|
| 29 |
+ |
|
| 30 |
+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. |
|
| 31 |
+``` |
|
| 32 |
+root@photon-host-cus [ ~ ]# ostree remote show-url photon |
|
| 33 |
+http://10.197.103.175:8000/repo |
|
| 34 |
+``` |
|
| 35 |
+ |
|
| 36 |
+## GPG signature verification |
|
| 37 |
+ |
|
| 38 |
+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. |
|
| 39 |
+ |
|
| 40 |
+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. |
|
| 41 |
+ |
|
| 42 |
+ |
|
| 43 |
+## Switching repositories |
|
| 44 |
+ |
|
| 45 |
+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. |
|
| 46 |
+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 3.0_minimal version will be preserved, but any new package change (addition, removal, upgrade) added after that (in 3.0_minimal.1, 3.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. |
|
| 47 |
+ |
|
| 48 |
+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. |
|
| 49 |
+A better solution would be to add a new remote that will identify where the commits come from. |
|
| 50 |
+ |
|
| 51 |
+## Adding and removing remotes |
|
| 52 |
+ |
|
| 53 |
+A cleaner way to switch repositories is to add remotes that point to different servers. Let us add another server that we will refer to as **photon2**, along with (optional) the refspecs for branches that it provides (we will see later that in the newer OSTree versions, we don't need to know the branch names, they could be [queried at run-time](Photon-RPM-OSTree-10-Remotes.md#listing-available-branches)). |
|
| 54 |
+ |
|
| 55 |
+``` |
|
| 56 |
+root@photon-host-cus [ ~ ]# ostree remote add --repo=/ostree/repo -v --no-gpg-verify photon2 http://10.197.103.204:8080 photon/3.0/x86_64/minimal photon/3.0/x86_64/full |
|
| 57 |
+root@photon-host-cus [ ~ ]# ostree remote list |
|
| 58 |
+photon |
|
| 59 |
+photon2 |
|
| 60 |
+root@photon-host-cus [ ~ ]# ostree remote show-url photon2 |
|
| 61 |
+http://10.118.101.86 |
|
| 62 |
+``` |
|
| 63 |
+Where is this information stored? There is an extra config file created per each remote: |
|
| 64 |
+``` |
|
| 65 |
+root@photon-host-cus [ ~ ]# cat /etc/ostree/remotes.d/photon2.conf |
|
| 66 |
+[remote "photon2"] |
|
| 67 |
+url=http://10.118.101.86 |
|
| 68 |
+branches=photon/3.0/x86_64/minimal;photon/2.0/x86_64/full; |
|
| 69 |
+gpg-verify=false |
|
| 70 |
+``` |
|
| 71 |
+You may have guessed what is the effect of ```--no-gpg-verify option```. |
|
| 72 |
+Obviously, remotes could also be deleted. |
|
| 73 |
+``` |
|
| 74 |
+root@photon-host-cus [ ~ ]# ostree remote delete photon2 |
|
| 75 |
+root@photon-host-cus [ ~ ]# ostree remote list |
|
| 76 |
+photon |
|
| 77 |
+``` |
|
| 78 |
+ |
|
| 79 |
+## List available branches |
|
| 80 |
+ |
|
| 81 |
+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). |
|
| 82 |
+ |
|
| 83 |
+Fortunately, in Photon OS 3.0 and higher, the hosts are able to query the server, if summary metadata has been generated, as we've seen in [Creating summary metadata](Photon-RPM-OSTree-8-File-oriented-server-operations.md#creating-summary-metadata). This command lists all branches available for remote **photon2**. |
|
| 84 |
+ |
|
| 85 |
+``` |
|
| 86 |
+root@photon-host-cus [ ~ ]# ostree remote refs photon2 |
|
| 87 |
+photon2:photon/3.0/x86_64/base |
|
| 88 |
+photon2:photon/3.0/x86_64/full |
|
| 89 |
+photon2:photon/3.0/x86_64/minimal |
|
| 90 |
+``` |
|
| 91 |
+ |
|
| 92 |
+## Switching branches (rebasing) |
|
| 93 |
+ |
|
| 94 |
+If you have an installed Photon 1.0 or 1.0 Rev2 that you want to carry to 3.0, you need to rebase it. |
|
| 95 |
+ |
|
| 96 |
+See [Rebasing a host from Photon 1.0 to 3.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#rebasing-a-host-from-photon-10-to-20). |
| 0 | 97 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,268 @@ |
| 0 |
+# Running container applications between bootable images |
|
| 1 |
+ |
|
| 2 |
+In this chapter, we want to test a docker application and make sure that all the settings and downloads done in one bootable filetree are going to be saved into writable folders and be available in the other image, in other words after reboot from the other image, everything is available exactly the same way. |
|
| 3 |
+We are going to do this twice: first, to verify an existing bootable image installed in parallel and then create a new one. |
|
| 4 |
+ |
|
| 5 |
+## Downloading a docker container appliance |
|
| 6 |
+ |
|
| 7 |
+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). |
|
| 8 |
+``` |
|
| 9 |
+root@sample-host-def [ ~ ]# systemctl status docker |
|
| 10 |
+* docker.service - Docker Daemon |
|
| 11 |
+ Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) |
|
| 12 |
+ Active: inactive (dead) |
|
| 13 |
+ |
|
| 14 |
+root@sample-host-def [ ~ ]# cat /usr/lib/systemd/system/docker.service |
|
| 15 |
+[Unit] |
|
| 16 |
+Description=Docker Application Container Engine |
|
| 17 |
+Documentation=https://docs.docker.com |
|
| 18 |
+After=network-online.target |
|
| 19 |
+Wants=network-online.target |
|
| 20 |
+ |
|
| 21 |
+[Service] |
|
| 22 |
+Type=notify |
|
| 23 |
+# the default is not to use systemd for cgroups because the delegate issues still |
|
| 24 |
+# exists and systemd currently does not support the cgroup feature set required |
|
| 25 |
+# for containers run by docker |
|
| 26 |
+ExecStart=/usr/bin/dockerd |
|
| 27 |
+ExecReload=/bin/kill -s HUP $MAINPID |
|
| 28 |
+# Having non-zero Limit*s causes performance problems due to accounting overhead |
|
| 29 |
+# in the kernel. We recommend using cgroups to do container-local accounting. |
|
| 30 |
+LimitNOFILE=infinity |
|
| 31 |
+LimitNPROC=infinity |
|
| 32 |
+LimitCORE=infinity |
|
| 33 |
+# Uncomment TasksMax if your systemd version supports it. |
|
| 34 |
+# Only systemd 226 and above support this version. |
|
| 35 |
+#TasksMax=infinity |
|
| 36 |
+TimeoutStartSec=0 |
|
| 37 |
+# set delegate yes so that systemd does not reset the cgroups of docker containers |
|
| 38 |
+Delegate=yes |
|
| 39 |
+# kill only the docker process, not all processes in the cgroup |
|
| 40 |
+KillMode=process |
|
| 41 |
+# restart the docker process if it exits prematurely |
|
| 42 |
+Restart=on-failure |
|
| 43 |
+StartLimitBurst=3 |
|
| 44 |
+StartLimitInterval=60s |
|
| 45 |
+ |
|
| 46 |
+[Install] |
|
| 47 |
+WantedBy=multi-user.target |
|
| 48 |
+``` |
|
| 49 |
+ |
|
| 50 |
+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. |
|
| 51 |
+ |
|
| 52 |
+``` |
|
| 53 |
+root@sample-host-def [ ~ ]# systemctl enable docker |
|
| 54 |
+Created symlink /etc/systemd/system/multi-user.target.wants/docker.service -> /lib/systemd/system/docker.service. |
|
| 55 |
+ |
|
| 56 |
+root@sample-host-def [ ~ ]# ls -l /etc/systemd/system/multi-user.target.wants |
|
| 57 |
+total 0 |
|
| 58 |
+lrwxrwxrwx 1 root root 34 Sep 10 10:48 docker.service -> /lib/systemd/system/docker.service |
|
| 59 |
+lrwxrwxrwx 1 root root 36 Sep 4 04:59 iptables.service -> /lib/systemd/system/iptables.service |
|
| 60 |
+lrwxrwxrwx 1 root root 35 Sep 4 04:59 machines.target -> /lib/systemd/system/machines.target |
|
| 61 |
+lrwxrwxrwx 1 root root 36 Sep 4 04:59 remote-fs.target -> /lib/systemd/system/remote-fs.target |
|
| 62 |
+lrwxrwxrwx 1 root root 39 Sep 4 04:59 sshd-keygen.service -> /lib/systemd/system/sshd-keygen.service |
|
| 63 |
+lrwxrwxrwx 1 root root 32 Sep 4 04:59 sshd.service -> /lib/systemd/system/sshd.service |
|
| 64 |
+lrwxrwxrwx 1 root root 44 Sep 4 04:59 systemd-networkd.service -> /lib/systemd/system/systemd-networkd.service |
|
| 65 |
+lrwxrwxrwx 1 root root 44 Sep 4 04:59 systemd-resolved.service -> /lib/systemd/system/systemd-resolved.service |
|
| 66 |
+``` |
|
| 67 |
+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". |
|
| 68 |
+ |
|
| 69 |
+Finally, let's start the daemon, check again that is active. |
|
| 70 |
+ |
|
| 71 |
+``` |
|
| 72 |
+root@sample-host-def [ ~ ]# systemctl start docker |
|
| 73 |
+ |
|
| 74 |
+root@sample-host-def [ ~ ]# systemctl status -l docker |
|
| 75 |
+* docker.service - Docker Application Container Engine |
|
| 76 |
+ Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: disabled) |
|
| 77 |
+ Active: active (running) since Tue 2019-09-10 10:54:32 UTC; 14s ago |
|
| 78 |
+ Docs: https://docs.docker.com |
|
| 79 |
+ Main PID: 2553 (dockerd) |
|
| 80 |
+ Tasks: 35 (limit: 4711) |
|
| 81 |
+ Memory: 148.2M |
|
| 82 |
+ CGroup: /system.slice/docker.service |
|
| 83 |
+ |-2553 /usr/bin/dockerd |
|
| 84 |
+ `-2566 docker-containerd --config /var/run/docker/containerd/containerd.toml |
|
| 85 |
+ |
|
| 86 |
+Sep 10 10:54:31 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:31.421759662Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420312f90, CONNECTING" module=grpc |
|
| 87 |
+Sep 10 10:54:31 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:31.421935355Z" level=info msg="pickfirstBalancer: HandleSubConnStateChange: 0xc420312f90, READY" module=grpc |
|
| 88 |
+Sep 10 10:54:31 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:31.421980614Z" level=info msg="Loading containers: start." |
|
| 89 |
+Sep 10 10:54:31 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:31.886520281Z" level=info msg="Default bridge |
|
| 90 |
+(docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" |
|
| 91 |
+Sep 10 10:54:32 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:32.027763113Z" level=info msg="Loading containers: done." |
|
| 92 |
+Sep 10 10:54:32 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:32.468277184Z" level=info msg="Docker daemon" |
|
| 93 |
+commit=6d37f41 graphdriver(s)=overlay2 version=18.06.2-ce |
|
| 94 |
+Sep 10 10:54:32 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:32.468441587Z" level=info msg="Daemon has completed initialization" |
|
| 95 |
+Sep 10 10:54:32 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:32.684925824Z" level=warning msg="Could not register builder git source: failed to find git binary: exec: \"git\": executable file not found in $PATH" |
|
| 96 |
+Sep 10 10:54:32 photon-76718dd2fa33 dockerd[2553]: time="2019-09-10T10:54:32.691070166Z" level=info msg="API listen on /var/run/docker.sock" |
|
| 97 |
+Sep 10 10:54:32 photon-76718dd2fa33 systemd[1]: Started Docker Application Container Engine. |
|
| 98 |
+``` |
|
| 99 |
+ |
|
| 100 |
+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/. |
|
| 101 |
+ |
|
| 102 |
+``` |
|
| 103 |
+root@sample-host-def [ ~ ]# docker ps -a |
|
| 104 |
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 105 |
+ |
|
| 106 |
+root@sample-host-def [ ~ ]# docker run -it ubuntu |
|
| 107 |
+Unable to find image 'ubuntu:latest' locally |
|
| 108 |
+latest: Pulling from library/ubuntu |
|
| 109 |
+35c102085707: Pull complete |
|
| 110 |
+251f5509d51d: Pull complete |
|
| 111 |
+8e829fe70a46: Pull complete |
|
| 112 |
+6001e1789921: Pull complete |
|
| 113 |
+Digest: sha256:d1d454df0f579c6be4d8161d227462d69e163a8ff9d20a847533989cf0c94d90 |
|
| 114 |
+Status: Downloaded newer image for ubuntu:latest |
|
| 115 |
+``` |
|
| 116 |
+ |
|
| 117 |
+When downloading is complete, it comes to Ubuntu root prompt with assigned host name 7029a64e7aa3, that is actually the Container ID. Let's verify it's indeed the expected OS. |
|
| 118 |
+ |
|
| 119 |
+``` |
|
| 120 |
+root@sample-host-def [ ~ ]# docker run -it ubuntu |
|
| 121 |
+Unable to find image 'ubuntu:latest' locally |
|
| 122 |
+latest: Pulling from library/ubuntu |
|
| 123 |
+d3a1f33e8a5a: Pull complete |
|
| 124 |
+c22013c84729: Pull complete |
|
| 125 |
+d74508fb6632: Pull complete |
|
| 126 |
+91e54dfb1179: Already exists |
|
| 127 |
+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. |
|
| 128 |
+Digest: sha256:fde8a8814702c18bb1f39b3bd91a2f82a8e428b1b4e39d1963c5d14418da8fba |
|
| 129 |
+Status: Downloaded newer image for ubuntu:latest |
|
| 130 |
+ |
|
| 131 |
+root@7029a64e7aa3:/# cat /etc/os-release |
|
| 132 |
+NAME="Ubuntu" |
|
| 133 |
+VERSION="18.04.3 LTS (Bionic Beaver)" |
|
| 134 |
+ID=ubuntu |
|
| 135 |
+ID_LIKE=debian |
|
| 136 |
+PRETTY_NAME="Ubuntu 18.04.3 LTS" |
|
| 137 |
+VERSION_ID="18.04" |
|
| 138 |
+HOME_URL="https://www.ubuntu.com/" |
|
| 139 |
+SUPPORT_URL="https://help.ubuntu.com/" |
|
| 140 |
+BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" |
|
| 141 |
+PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" |
|
| 142 |
+VERSION_CODENAME=bionic |
|
| 143 |
+UBUNTU_CODENAME=bionic |
|
| 144 |
+root@7029a64e7aa3:/# |
|
| 145 |
+``` |
|
| 146 |
+Now let's write a file into Ubuntu home directory |
|
| 147 |
+ |
|
| 148 |
+``` |
|
| 149 |
+echo "Ubuntu file" >> /home/myfile |
|
| 150 |
+root@7029a64e7aa3:/home# cat /home/myfile |
|
| 151 |
+Ubuntu file |
|
| 152 |
+``` |
|
| 153 |
+ |
|
| 154 |
+We'll exit back to the Photon prompt and if it's stopped, we will re-start it. |
|
| 155 |
+ |
|
| 156 |
+``` |
|
| 157 |
+root@7029a64e7aa3:/# exit |
|
| 158 |
+exit |
|
| 159 |
+ |
|
| 160 |
+root@sample-host-def [ ~ ]# docker ps -a |
|
| 161 |
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 162 |
+7029a64e7aa3 ubuntu "/bin/bash" 6 minutes ago Exited (0) 11 seconds ago gifted_dijkstra |
|
| 163 |
+ |
|
| 164 |
+root@photon-host-cus1 [ ~ ]# docker start 7029a64e7aa3 |
|
| 165 |
+7029a64e7aa3 |
|
| 166 |
+ |
|
| 167 |
+root@photon-host-cus1 [ ~ ]# docker ps -a |
|
| 168 |
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 169 |
+7029a64e7aa3 ubuntu "/bin/bash" 7 minutes ago Up 21 seconds gifted_dijkstra |
|
| 170 |
+``` |
|
| 171 |
+ |
|
| 172 |
+## Rebooting into an existing image |
|
| 173 |
+ |
|
| 174 |
+Now let's reboot the machine and select the other image. First, we'll verify that the docker daemon is automaically started. |
|
| 175 |
+ |
|
| 176 |
+``` |
|
| 177 |
+root@photon-host-cus1 [ ~ ]# systemctl status docker |
|
| 178 |
+* docker.service - Docker Application Container Engine |
|
| 179 |
+ Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: disabled) |
|
| 180 |
+ Active: active (running) since Tue 2019-09-10 10:54:32 UTC; 13min ago |
|
| 181 |
+ Docs: https://docs.docker.com |
|
| 182 |
+ Main PID: 2553 (dockerd) |
|
| 183 |
+ Tasks: 55 (limit: 4711) |
|
| 184 |
+ Memory: 261.3M |
|
| 185 |
+ CGroup: /system.slice/docker.service |
|
| 186 |
+ |-2553 /usr/bin/dockerd |
|
| 187 |
+ ... |
|
| 188 |
+``` |
|
| 189 |
+ |
|
| 190 |
+Next, is the Ubuntu OS container still there? |
|
| 191 |
+ |
|
| 192 |
+``` |
|
| 193 |
+root@photon-host-cus1 [ ~ ]# docker ps -a |
|
| 194 |
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 195 |
+7029a64e7aa3 ubuntu "/bin/bash" 9 minutes ago Up 2 minutes gifted_dijkstra |
|
| 196 |
+``` |
|
| 197 |
+ |
|
| 198 |
+It is, so let's start it, attach and verify that our file is persisted, then add another line to it and save, exit. |
|
| 199 |
+ |
|
| 200 |
+``` |
|
| 201 |
+root@photon-host-cus1 [ ~ ]# docker start -i 7029a64e7aa3 |
|
| 202 |
+root@7029a64e7aa3:/# cat /home/myfile |
|
| 203 |
+Ubuntu file |
|
| 204 |
+root@7029a64e7aa3:/# echo "booted into existing image" >> /home/myfile |
|
| 205 |
+root@7029a64e7aa3:/# exit |
|
| 206 |
+exit |
|
| 207 |
+``` |
|
| 208 |
+ |
|
| 209 |
+## Reboot into a newly created image |
|
| 210 |
+ |
|
| 211 |
+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). |
|
| 212 |
+ |
|
| 213 |
+``` |
|
| 214 |
+root@photon-host-cus1 [ ~ ]# rpm-ostree status |
|
| 215 |
+ TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC |
|
| 216 |
+* 2015-09-04 00:36:37 1.0_tp2_minimal.2 092e21d292 photon photon:photon/tp2/x86_64/minimal |
|
| 217 |
+ 2015-08-20 22:27:43 1.0_tp2_minimal 2940e10c4d photon photon:photon/tp2/x86_64/minimal |
|
| 218 |
+ |
|
| 219 |
+root@photon-host-cus1 [ ~ ]# rpm-ostree upgrade |
|
| 220 |
+Updating from: photon:photon/tp2/x86_64/minimal |
|
| 221 |
+ |
|
| 222 |
+43 metadata, 209 content objects fetched; 19992 KiB transferred in 0 seconds |
|
| 223 |
+Copying /etc changes: 5 modified, 0 removed, 19 added |
|
| 224 |
+Transaction complete; bootconfig swap: yes deployment count change: 0 |
|
| 225 |
+Freed objects: 16.2 MB |
|
| 226 |
+Added: |
|
| 227 |
+ git-2.1.2-1.ph3tp2.x86_64 |
|
| 228 |
+ perl-YAML-1.14-1.ph3tp2.noarch |
|
| 229 |
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot |
|
| 230 |
+ |
|
| 231 |
+root@photon-host-cus1 [ ~ ]# rpm-ostree status |
|
| 232 |
+ TIMESTAMP (UTC) VERSION ID OSNAME REFSPEC |
|
| 233 |
+ 2015-09-06 18:12:08 1.0_tp2_minimal.3 d16aebd803 photon photon:photon/tp2/x86_64/minimal |
|
| 234 |
+* 2015-09-04 00:36:37 1.0_tp2_minimal.2 092e21d292 photon photon:photon/tp2/x86_64/minimal |
|
| 235 |
+``` |
|
| 236 |
+ |
|
| 237 |
+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. |
|
| 238 |
+ |
|
| 239 |
+``` |
|
| 240 |
+root@photon-host-cus1 [ ~ ]# ls -l /etc/systemd/system/multi-user.target.wants/docker.service |
|
| 241 |
+lrwxrwxrwx 1 root root 38 Sep 6 12:50 /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service |
|
| 242 |
+ |
|
| 243 |
+root@photon-host-cus1 [ ~ ]# systemctl status docker |
|
| 244 |
+* docker.service - Docker Daemon |
|
| 245 |
+ Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled) |
|
| 246 |
+ Active: active (running) since Sun 2015-09-06 12:56:33 UTC; 1min 27s ago |
|
| 247 |
+ Main PID: 292 (docker) |
|
| 248 |
+ CGroup: /system.slice/docker.service |
|
| 249 |
+ `-292 /bin/docker -d -s overlay |
|
| 250 |
+ ... |
|
| 251 |
+``` |
|
| 252 |
+ |
|
| 253 |
+Let's revisit the Ubuntu container. Is the container still there? is myfile persisted? |
|
| 254 |
+ |
|
| 255 |
+``` |
|
| 256 |
+root@photon-host-cus1 [ ~ ]# docker ps -a |
|
| 257 |
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 258 |
+7029a64e7aa3 ubuntu "/bin/bash" 5 days ago Exited (0) 5 days ago gifted_dijkstra |
|
| 259 |
+55825c961f95 ubuntu "/bin/bash" 5 days ago Exited (127) 5 days ago distracted_shannon |
|
| 260 |
+ |
|
| 261 |
+root@photon-host-cus1 [ ~ ]# docker start 57dcac5d0490 |
|
| 262 |
+ |
|
| 263 |
+root@57dcac5d0490:/# cat /home/myfile |
|
| 264 |
+Ubuntu file |
|
| 265 |
+booted into existing image |
|
| 266 |
+root@57dcac5d0490:/# echo "booted into new image" >> /home/myfile |
|
| 267 |
+``` |
| 0 | 268 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,40 @@ |
| 0 |
+# Installing a host against default server repository |
|
| 1 |
+ |
|
| 2 |
+RPM-OSTree Host default server repo installation option in Photon 3.0 will setup a profile similar to Photon Minimal, with the added benefit of being able to self-upgrade. |
|
| 3 |
+ |
|
| 4 |
+## Who is this for? |
|
| 5 |
+ |
|
| 6 |
+The RPM-OSTree 'default host' is the easiest way to deploy a Photon RPM-OSTree host from ISO/cdrom, without the need to deploy and maintain an RPM-OSTree server. It is targeted at the user who relies on VMware Photon OS team to keep his or her system up-to-date, configured to get its updates from the official Photon 3.0 OSTree repository. |
|
| 7 |
+ |
|
| 8 |
+This is also the fastest way to install a host, as we've included in the ISO/cdrom an identical copy of the Photon 3.0 "starter" RPM-OSTree repository that is published online by VMware Photon OS team. So rather than pulling from the online repository, the installer pulls the repo from cdrom, which saves bandwidth and also reduces to zero the chances of failing due to a networking problem. After successful installation, any updates are going to be pulled from the official online repository, when Photon OS team will make them available. |
|
| 9 |
+ |
|
| 10 |
+**Note**: It is also possible to install an RPM-OSTree host against the official online repo via PXE boot, without the benefit of fast, local pull from cdrom. This will be covered in the PXE boot/kickstart chapter, as it requires additional configuration. |
|
| 11 |
+ |
|
| 12 |
+## Installing the ISO |
|
| 13 |
+ |
|
| 14 |
+User will first download [Photon 3.0 ISO file](https://bintray.com/artifact/download/vmware/photon/photon-1.0-13c08b6.iso) that contains the installer, which is able to deploy any of the supported Photon installation profiles. |
|
| 15 |
+ |
|
| 16 |
+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. |
|
| 17 |
+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: |
|
| 18 |
+ |
|
| 19 |
+[Running Project Photon on Fusion](Running-Project-Photon-on-Fusion.md). |
|
| 20 |
+ |
|
| 21 |
+Select the **Photon OSTree Host** option. |
|
| 22 |
+ |
|
| 23 |
+ |
|
| 24 |
+ |
|
| 25 |
+Continue with setting up a host name like **photon1-def** and a root password, re-confirm. |
|
| 26 |
+Then, select "Default OSTree Server" and continue. |
|
| 27 |
+ |
|
| 28 |
+ |
|
| 29 |
+ |
|
| 30 |
+ |
|
| 31 |
+ |
|
| 32 |
+When installation is over, the VM will reboot and will show in grub VMWare Photon/Linux 3.0_minimal (ostree), which will reassure that it's booting from an OSTree image! |
|
| 33 |
+ |
|
| 34 |
+ |
|
| 35 |
+ |
|
| 36 |
+Boot, login and you are ready to use it. |
|
| 37 |
+ |
|
| 38 |
+To upgrade your host, see [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md). |
|
| 39 |
+ |
| 0 | 40 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,345 @@ |
| 0 |
+# Querying For Commit File and Package Metadata |
|
| 1 |
+ |
|
| 2 |
+There are several ostree and rpm-ostree commands that list file or package data based on either the Commit ID, or Refspec. If Refspec is passed as a parameter, it's the same as passing the most recent commit ID (head) for that branch. |
|
| 3 |
+ |
|
| 4 |
+## Commit history |
|
| 5 |
+ |
|
| 6 |
+For a host that is freshly installed, there is only one commit in the history for the only branch. |
|
| 7 |
+ |
|
| 8 |
+``` |
|
| 9 |
+root@photon-host [ ~ ]# ostree log photon/3.0/x86_64/minimal |
|
| 10 |
+commit a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 11 |
+ContentChecksum: e91261daf8d60074f334a7ebf81d3b930c3fc88c765f994f79ab2445296f03c5 |
|
| 12 |
+Date: 2019-08-29 11:20:19 +0000 |
|
| 13 |
+Version: 3.0_minimal |
|
| 14 |
+``` |
|
| 15 |
+ |
|
| 16 |
+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. |
|
| 17 |
+ |
|
| 18 |
+``` |
|
| 19 |
+root@photon-host [ ~ ]# ostree log a31a |
|
| 20 |
+commit a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 21 |
+ContentChecksum: e91261daf8d60074f334a7ebf81d3b930c3fc88c765f994f79ab2445296f03c5 |
|
| 22 |
+Date: 2019-08-29 11:20:19 +0000 |
|
| 23 |
+Version: 3.0_minimal |
|
| 24 |
+``` |
|
| 25 |
+ |
|
| 26 |
+``` |
|
| 27 |
+root@photon-host [ ~ ]# ostree log a31a --raw |
|
| 28 |
+commit a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 29 |
+({'rpmostree.inputhash': <'a3e8f3f6ef6e93c2ed6ce9edd1e9e80c93a36ecda0fed0d78f607e6ec3179d04'>, 'rpmostree.rpmmd-repos': <[{'id': <'photon'>, 'timestamp': <uint64 1567077533>}]>, 'version': <'3.0_minimal'>, 'rpmostree.rpmdb.pkglist': <[('Linux-PAM', '0', '1.3.0', '1.ph3', 'x86_64'), ('attr', '0', '2.4.48', '1.ph3', 'x86_64'), ('autogen-libopts', '0', '5.18.16', '1.ph3', 'x86_64'), ('bash', '0', '4.4.18', '1.ph3', 'x86_64'), ('bc', '0', '1.07.1', '1.ph3', 'x86_64'), ('binutils', '0', '2.31.1', '6.ph3', 'x86_64'), ('bridge-utils', '0', '1.6', '1.ph3', 'x86_64'), ('bubblewrap', '0', '0.3.0', '2.ph3', 'x86_64'), ('bzip2', '0', '1.0.6', '10.ph3', 'x86_64'), ('bzip2-libs', '0', '1.0.6', '10.ph3', 'x86_64'), ('ca-certificates', '0', '20190521', '1.ph3', 'x86_64'), ('ca-certificates-pki', '0', '20190521', '1.ph3', 'x86_64'), ('coreutils', '0', '8.30', '1.ph3', 'x86_64'), ('cpio', '0', '2.12', '4.ph3', 'x86_64'), ('cracklib', '0', '2.9.6', '8.ph3', 'x86_64'), ('cracklib-dicts', '0', '2.9.6', '8.ph3', 'x86_64'), ('curl', '0', '7.61.1', '4.ph3', 'x86_64'), ('curl-libs', '0', '7.61.1', '4.ph3', 'x86_64'), ('dbus', '0', '1.13.6', '1.ph3', 'x86_64'), ('device-mapper', '0', '2.02.181', '1.ph3', 'x86_64'), ('device-mapper-libs', '0', '2.02.181', '1.ph3', 'x86_64'), ('docker', '0', '18.06.2', '3.ph3', 'x86_64'), ('dracut', '0', '048', '1.ph3', 'x86_64'), ('dracut-tools', '0', '048', '1.ph3', 'x86_64'), ('e2fsprogs-libs', '0', '1.44.3', '2.ph3', 'x86_64'), ('elfutils', '0', '0.176', '1.ph3', 'x86_64'), ('elfutils-libelf', '0', '0.176', '1.ph3', 'x86_64'), ('expat', '0', '2.2.6', '2.ph3', 'x86_64'), ('expat-libs', '0', '2.2.6', '2.ph3', 'x86_64'), ('file', '0', '5.34', '1.ph3', 'x86_64'), ('file-libs', '0', '5.34', '1.ph3', 'x86_64'), ('filesystem', '0', '1.1', '4.ph3', 'x86_64'), ('findutils', '0', '4.6.0', '5.ph3', 'x86_64'), ('flex', '0', '2.6.4', '2.ph3', 'x86_64'), ('fuse', '0', '2.9.7', '5.ph3', 'x86_64'), ('gc', '0', '8.0.0', '1.ph3', 'x86_64'), ('glib', '0', '2.58.0', '4.ph3', 'x86_64'), ('glib-networking', '0', '2.59.1', '2.ph3', 'x86_64'), ('glibc', '0', '2.28', '4.ph3', 'x86_64'), ('glibc-iconv', '0', '2.28', '4.ph3', 'x86_64'), ('gmp', '0', '6.1.2', '2.ph3', 'x86_64'), ('gnupg', '0', '2.2.17', '1.ph3', 'x86_64'), ('gnutls', '0', '3.6.3', '3.ph3', 'x86_64'), ('gobject-introspection', '0', '1.58.0', '2.ph3', 'x86_64'), ('gpgme', '0', '1.11.1', '2.ph3', 'x86_64'), ('grep', '0', '3.1', '1.ph3', 'x86_64'), ('grub2', '0', '2.02', '13.ph3', 'x86_64'), ('grub2-efi', '0', '2.02', '13.ph3', 'x86_64'), ('grub2-pc', '0', '2.02', '13.ph3', 'x86_64'), ('guile', '0', '2.0.13', '2.ph3', 'x86_64'), ('gzip', '0', '1.9', '1.ph3', 'x86_64'), ('iana-etc', '0', '2.30', '2.ph3', 'noarch'), ('icu', '0', '61.1', '1.ph3', 'x86_64'), ('iproute2', '0', '4.18.0', '2.ph3', 'x86_64'), ('iptables', '0', '1.8.3', '1.ph3', 'x86_64'), ('js', '0', '1.8.5', '2.ph3', 'x86_64'), ('json-c', '0', '0.13.1', '1.ph3', 'x86_64'), ('json-glib', '0', '1.4.4', '1.ph3', 'x86_64'), ('kmod', '0', '25', '1.ph3', 'x86_64'), ('krb5', '0', '1.17', '1.ph3', 'x86_64'), ('libapparmor', '0', '2.13', '7.ph3', 'x86_64'), ('libarchive', '0', '3.3.3', '3.ph3', 'x86_64'), ('libassuan', '0', '2.5.1', '1.ph3', 'x86_64'), ('libcap', '0', '2.25', '8.ph3', 'x86_64'), ('libdb', '0', '5.3.28', '2.ph3', 'x86_64'), ('libffi', '0', '3.2.1', '6.ph3', 'x86_64'), ('libgcc', '0', '7.3.0', '4.ph3', 'x86_64'), ('libgcrypt', '0', '1.8.3', '2.ph3', 'x86_64'), ('libgomp', '0', '7.3.0', '4.ph3', 'x86_64'), ('libgpg-error', '0', '1.32', '1.ph3', 'x86_64'), ('libgsystem', '0', '2015.2', '2.ph3', 'x86_64'), ('libksba', '0', '1.3.5', '1.ph3', 'x86_64'), ('libltdl', '0', '2.4.6', '3.ph3', 'x86_64'), ('libmodulemd', '0', '2.4.0', '1.ph3', 'x86_64'), ('libpsl', '0', '0.20.2', '1.ph3', 'x86_64'), ('librepo', '0', '1.10.2', '1.ph3', 'x86_64'), ('libseccomp', '0', '2.4.0', '1.ph3', 'x86_64'), ('libselinux', '0', '2.8', '1.ph3', 'x86_64'), ('libsepol', '0', '2.8', '1.ph3', 'x86_64'), ('libsolv', '0', '0.6.35', '1.ph3', 'x86_64'), ('libsoup', '0', '2.64.0', '2.ph3', 'x86_64'), ('libssh2', '0', '1.9.0', '1.ph3', 'x86_64'), ('libstdc++', '0', '7.3.0', '4.ph3', 'x86_64'), ('libtasn1', '0', '4.13', '1.ph3', 'x86_64'), ('libtool', '0', '2.4.6', '3.ph3', 'x86_64'), ('libunistring', '0', '0.9.10', '1.ph3', 'x86_64'), ('libxml2', '0', '2.9.9', '1.ph3', 'x86_64'), ('libyaml', '0', '0.2.1', '2.ph3', 'x86_64'), ('linux', '0', '4.19.65', '3.ph3', 'x86_64'), ('m4', '0', '1.4.18', '2.ph3', 'x86_64'), ('mpfr', '0', '4.0.1', '1.ph3', 'x86_64'), ('ncurses', '0', '6.1', '1.ph3', 'x86_64'), ('ncurses-libs', '0', '6.1', '1.ph3', 'x86_64'), ('ncurses-terminfo', '0', '6.1', '1.ph3', 'x86_64'), ('net-tools', '0', '1.60', '11.ph3', 'x86_64'), ('nettle', '0', '3.4', '1.ph3', 'x86_64'), ('npth', '0', '1.6', '1.ph3', 'x86_64'), ('nspr', '0', '4.21', '1.ph3', 'x86_64'), ('nss-altfiles', '0', '2.23.0', '1.ph3', 'x86_64'), ('nss-libs', '0', '3.44', '2.ph3', 'x86_64'), ('openssh', '0', '7.8p1', '5.ph3', 'x86_64'), ('openssh-clients', '0', '7.8p1', '5.ph3', 'x86_64'), ('openssh-server', '0', '7.8p1', '5.ph3', 'x86_64'), ('openssl', '0', '1.0.2s', '1.ph3', 'x86_64'), ('ostree', '0', '2019.2', '1.ph3', 'x86_64'), ('ostree-grub2', '0', '2019.2', '1.ph3', 'x86_64'), ('ostree-libs', '0', '2019.2', '1.ph3', 'x86_64'), ('pcre', '0', '8.42', '1.ph3', 'x86_64'), ('pcre-libs', '0', '8.42', '1.ph3', 'x86_64'), ('photon-release', '0', '3.0', '3.ph3', 'noarch'), ('photon-repos', '0', '3.0', '3.ph3', 'noarch'), ('pinentry', '0', '1.1.0', '1.ph3', 'x86_64'), ('pkg-config', '0', '0.29.2', '2.ph3', 'x86_64'), ('polkit', '0', '0.113', '5.ph3', 'x86_64'), ('popt', '0', '1.16', '5.ph3', 'x86_64'), ('procps-ng', '0', '3.3.15', '1.ph3', 'x86_64'), ('python3', '0', '3.7.3', '2.ph3', 'x86_64'), ('python3-libs', '0', '3.7.3', '2.ph3', 'x86_64'), ('readline', '0', '7.0', '2.ph3', 'x86_64'), ('rpm-libs', '0', '4.14.2', '4.ph3', 'x86_64'), ('rpm-ostree', '0', '2019.3', '1.ph3', 'x86_64'), ('sed', '0', '4.5', '1.ph3', 'x86_64'), ('shadow', '0', '4.6', '3.ph3', 'x86_64'), ('shadow-tools', '0', '4.6', '3.ph3', 'x86_64'), ('sqlite-libs', '0', '3.27.2', '3.ph3', 'x86_64'), ('systemd', '0', '239', '13.ph3', 'x86_64'), ('util-linux', '0', '2.32', '1.ph3', 'x86_64'), ('util-linux-libs', '0', '2.32', '1.ph3', 'x86_64'), ('vim', '0', '8.1.0388', '4.ph3', 'x86_64'), ('which', '0', '2.21', '5.ph3', 'x86_64'), ('xz', '0', '5.2.4', '1.ph3', 'x86_64'), ('xz-libs', '0', '5.2.4', '1.ph3', 'x86_64'), ('zchunk', '0', '1.1.1', '1.ph3', 'x86_64'), ('zchunk-libs', '0', '1.1.1', '1.ph3', 'x86_64'), ('zlib', '0', '1.2.11', '1.ph3', 'x86_64')]>}, @ay [], @a(say) [], '', '', uint64 1567077619, [byte 0x1e, 0x0a, 0x85, 0x20, 0xa8, 0xe0, 0x18, 0x6a, 0x88, 0x15, 0xc0, 0xd9, 0xb0, 0xab, 0xc9, 0x98, 0x94, 0xa1, 0xfb, 0x0a, 0x48, 0xdf, 0xa0, 0x73, 0x32, 0x02, 0x9a, 0xdf, 0x49, 0xed, 0x13, 0x8d], [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])
|
|
| 30 |
+``` |
|
| 31 |
+ |
|
| 32 |
+## Listing file mappings |
|
| 33 |
+ |
|
| 34 |
+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. |
|
| 35 |
+``` |
|
| 36 |
+root@photon-host [ ~ ]# ostree ls photon/3.0/x86_64/minimal |
|
| 37 |
+d00755 0 0 0 / |
|
| 38 |
+l00777 0 0 0 /bin -> usr/bin |
|
| 39 |
+l00777 0 0 0 /home -> var/home |
|
| 40 |
+l00777 0 0 0 /lib -> usr/lib |
|
| 41 |
+l00777 0 0 0 /lib64 -> usr/lib |
|
| 42 |
+l00777 0 0 0 /media -> run/media |
|
| 43 |
+l00777 0 0 0 /mnt -> var/mnt |
|
| 44 |
+l00777 0 0 0 /opt -> var/opt |
|
| 45 |
+l00777 0 0 0 /ostree -> sysroot/ostree |
|
| 46 |
+l00777 0 0 0 /root -> var/roothome |
|
| 47 |
+l00777 0 0 0 /sbin -> usr/sbin |
|
| 48 |
+l00777 0 0 0 /srv -> var/srv |
|
| 49 |
+l00777 0 0 0 /tmp -> sysroot/tmp |
|
| 50 |
+d00755 0 0 0 /boot |
|
| 51 |
+d00755 0 0 0 /dev |
|
| 52 |
+d00755 0 0 0 /proc |
|
| 53 |
+d00755 0 0 0 /run |
|
| 54 |
+d00755 0 0 0 /sys |
|
| 55 |
+d00755 0 0 0 /sysroot |
|
| 56 |
+d00755 0 0 0 /usr |
|
| 57 |
+d00755 0 0 0 /var |
|
| 58 |
+``` |
|
| 59 |
+ |
|
| 60 |
+Extra columns can be added like checksum (-C) and extended attributes (-X). |
|
| 61 |
+ |
|
| 62 |
+``` |
|
| 63 |
+root@photon-host [ /usr/share/man/man1 ]# ostree ls photon/3.0/x86_64/minimal -C |
|
| 64 |
+d00755 0 0 0 1e0a8520a8e0186a8815c0d9b0abc99894a1fb0a48dfa07332029adf49ed138d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 / |
|
| 65 |
+l00777 0 0 0 389846c2702216e1367c8dfb68326a6b93ccf5703c89c93979052a9bf359608e /bin -> usr/bin |
|
| 66 |
+l00777 0 0 0 4344c10bf4931483f918496534f12ed9b50dc6a2cead35e3cd9dd898d6ac9414 /home -> var/home |
|
| 67 |
+l00777 0 0 0 f11902ca9d69a80df33918534a3e443251fd0aa7f94b76301e1f55e52aed29dd /lib -> usr/lib |
|
| 68 |
+l00777 0 0 0 f11902ca9d69a80df33918534a3e443251fd0aa7f94b76301e1f55e52aed29dd /lib64 -> usr/lib |
|
| 69 |
+l00777 0 0 0 75317a3df11447c470ffdd63dde045450ca97dfb2a97a0f3f6a21a5da66f737c /media -> run/media |
|
| 70 |
+l00777 0 0 0 97c55dbe24e8f3aecfd3f3e5b3f44646fccbb39799807d37a217e9c871da108b /mnt -> var/mnt |
|
| 71 |
+l00777 0 0 0 46b1abbd27a846a9257a8d8c9fc4b384ac0888bdb8ac0d6a2d5de72715bd5092 /opt -> var/opt |
|
| 72 |
+l00777 0 0 0 d37269e3f46023fd0275212473e07011894cdf4148cbf3fb5758a7e9471dad8e /ostree -> sysroot/ostree |
|
| 73 |
+l00777 0 0 0 6f800e74eed172661278d1e1f09e389a6504dcd3358618e1c1618f91f9d33601 /root -> var/roothome |
|
| 74 |
+l00777 0 0 0 e0bead7be9323b06bea05cb9b66eb151839989e3a4e5d1a93e09a36919e91818 /sbin -> usr/sbin |
|
| 75 |
+l00777 0 0 0 5d4250bba1ed300f793fa9769474351ee5cebd71e8339078af7ebfbe6256d9b5 /srv -> var/srv |
|
| 76 |
+l00777 0 0 0 364fbd62f91ca1e06eb7dbd50c93de8976f2cea633658e2dbe803ce6f7490c09 /tmp -> sysroot/tmp |
|
| 77 |
+d00755 0 0 0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /boot |
|
| 78 |
+d00755 0 0 0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /dev |
|
| 79 |
+d00755 0 0 0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /proc |
|
| 80 |
+d00755 0 0 0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /run |
|
| 81 |
+d00755 0 0 0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /sys |
|
| 82 |
+d00755 0 0 0 6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /sysroot |
|
| 83 |
+d00755 0 0 0 ef1c0980e0d77f64e7f250a3e48f0b24e9285fc0716b80520dac6f98c148324a 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /usr |
|
| 84 |
+d00755 0 0 0 a3a987e053ea5a116f1e75a31cd7557fc6e57a3ae09e64171d7fea17ef71ec3e 446a0ef11b7cc167f3b603e585c7eeeeb675faa412d5ec73f62988eb0b6c5488 /var |
|
| 85 |
+``` |
|
| 86 |
+ |
|
| 87 |
+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. |
|
| 88 |
+ |
|
| 89 |
+``` |
|
| 90 |
+root@photon-host [ /usr/share/rpm-ostree ]# ostree ls photon/3.0/x86_64/minimal -R | grep -e '[Rr]pm-\?[Oo]stree' |
|
| 91 |
+-00755 0 0 749000 /usr/bin/rpm-ostree |
|
| 92 |
+d00755 0 0 0 /usr/bin/rpm-ostree-host |
|
| 93 |
+-00644 0 0 1069 /usr/bin/rpm-ostree-host/function.inc |
|
| 94 |
+-00755 0 0 10507 /usr/bin/rpm-ostree-host/mk-ostree-host.sh |
|
| 95 |
+-00644 0 0 209 /usr/etc/rpm-ostreed.conf |
|
| 96 |
+-00644 0 0 1530 /usr/etc/dbus-1/system.d/org.projectatomic.rpmostree1.conf |
|
| 97 |
+l00777 0 0 0 /usr/lib/librpmostree-1.so.1 -> librpmostree-1.so.1.0.0 |
|
| 98 |
+-00755 0 0 5278496 /usr/lib/librpmostree-1.so.1.0.0 |
|
| 99 |
+-00644 0 0 2312 /usr/lib/girepository-1.0/RpmOstree-1.0.typelib |
|
| 100 |
+-00755 0 0 22 /usr/lib/kernel/install.d/00-rpmostree-skip.install |
|
| 101 |
+d00755 0 0 0 /usr/lib/rpm-ostree |
|
| 102 |
+-00755 0 0 1640704 /usr/lib/rpm-ostree/libdnf.so.2 |
|
| 103 |
+-00644 0 0 622 /usr/lib/rpm-ostree/rpm-ostree-0-integration.conf |
|
| 104 |
+d00755 0 0 0 /usr/lib/sysimage/rpm-ostree-base-db |
|
| 105 |
+-00644 0 0 544768 /usr/lib/sysimage/rpm-ostree-base-db/Basenames |
|
| 106 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Conflictname |
|
| 107 |
+-00644 0 0 110592 /usr/lib/sysimage/rpm-ostree-base-db/Dirnames |
|
| 108 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Enhancename |
|
| 109 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Filetriggername |
|
| 110 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Group |
|
| 111 |
+-00644 0 0 12288 /usr/lib/sysimage/rpm-ostree-base-db/Installtid |
|
| 112 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Name |
|
| 113 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Obsoletename |
|
| 114 |
+-00644 0 0 2625536 /usr/lib/sysimage/rpm-ostree-base-db/Packages |
|
| 115 |
+-00644 0 0 86016 /usr/lib/sysimage/rpm-ostree-base-db/Providename |
|
| 116 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Recommendname |
|
| 117 |
+-00644 0 0 69632 /usr/lib/sysimage/rpm-ostree-base-db/Requirename |
|
| 118 |
+-00644 0 0 20480 /usr/lib/sysimage/rpm-ostree-base-db/Sha1header |
|
| 119 |
+-00644 0 0 16384 /usr/lib/sysimage/rpm-ostree-base-db/Sigmd5 |
|
| 120 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Suggestname |
|
| 121 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Supplementname |
|
| 122 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Transfiletriggername |
|
| 123 |
+-00644 0 0 8192 /usr/lib/sysimage/rpm-ostree-base-db/Triggername |
|
| 124 |
+-00644 0 0 263 /usr/lib/systemd/system/rpm-ostree-bootstatus.service |
|
| 125 |
+-00644 0 0 257 /usr/lib/systemd/system/rpm-ostreed-automatic.service |
|
| 126 |
+-00644 0 0 227 /usr/lib/systemd/system/rpm-ostreed-automatic.timer |
|
| 127 |
+-00644 0 0 272 /usr/lib/systemd/system/rpm-ostreed.service |
|
| 128 |
+-00644 0 0 102 /usr/lib/systemd/system-preset/40-rpm-ostree-auto.preset |
|
| 129 |
+-00644 0 0 622 /usr/lib/tmpfiles.d/rpm-ostree-0-integration.conf |
|
| 130 |
+-00644 0 0 1082 /usr/lib/tmpfiles.d/rpm-ostree-1-autovar.conf |
|
| 131 |
+-00755 0 0 53 /usr/libexec/rpm-ostreed |
|
| 132 |
+-00644 0 0 3049 /usr/share/bash-completion/completions/rpm-ostree |
|
| 133 |
+-00644 0 0 15997 /usr/share/dbus-1/interfaces/org.projectatomic.rpmostree1.xml |
|
| 134 |
+-00644 0 0 133 /usr/share/dbus-1/system-services/org.projectatomic.rpmostree1.service |
|
| 135 |
+-00644 0 0 6160 /usr/share/polkit-1/actions/org.projectatomic.rpmostree1.policy |
|
| 136 |
+d00755 0 0 0 /usr/share/rpm-ostree |
|
| 137 |
+-00644 0 0 1169 /usr/share/rpm-ostree/treefile.json |
|
| 138 |
+``` |
|
| 139 |
+ |
|
| 140 |
+**atomic** is really an alias for rpm-ostree command. The last file **treefile.json** is not installed by the rpm-ostree package, it is actually downloaded from the server, as we will see in the next chapter. For now, let us notice **"osname" : "photon", "ref" : "photon/1.0/x86_64/minimal", "automatic_version_prefix" : "1.0_minimal"**, that matches what we have 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. |
|
| 141 |
+ |
|
| 142 |
+``` |
|
| 143 |
+root@photon-host [ /usr/share/rpm-ostree ]# ls -l /usr/share/man/man1 |
|
| 144 |
+total 0 |
|
| 145 |
+``` |
|
| 146 |
+ |
|
| 147 |
+## Listing configuration changes |
|
| 148 |
+ |
|
| 149 |
+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: |
|
| 150 |
+``` |
|
| 151 |
+root@photon-host [ ~ ]# ostree admin config-diff |
|
| 152 |
+M ssh/sshd_config |
|
| 153 |
+M machine-id |
|
| 154 |
+M fstab |
|
| 155 |
+M hosts |
|
| 156 |
+M mtab |
|
| 157 |
+M shadow |
|
| 158 |
+A ssh/ssh_host_rsa_key |
|
| 159 |
+A ssh/ssh_host_rsa_key.pub |
|
| 160 |
+A ssh/ssh_host_dsa_key |
|
| 161 |
+A ssh/ssh_host_dsa_key.pub |
|
| 162 |
+A ssh/ssh_host_ecdsa_key |
|
| 163 |
+A ssh/ssh_host_ecdsa_key.pub |
|
| 164 |
+A ssh/ssh_host_ed25519_key |
|
| 165 |
+A ssh/ssh_host_ed25519_key.pub |
|
| 166 |
+A udev/hwdb.bin |
|
| 167 |
+A resolv.conf |
|
| 168 |
+A hostname |
|
| 169 |
+A localtime |
|
| 170 |
+A .pwd.lock |
|
| 171 |
+A .updated |
|
| 172 |
+``` |
|
| 173 |
+ |
|
| 174 |
+## Listing packages |
|
| 175 |
+ |
|
| 176 |
+The following is the rpm-ostree command that lists all the packages for that branch, extracted from RPM database. |
|
| 177 |
+``` |
|
| 178 |
+root@photon-host [ ~ ]# rpm-ostree db list photon/3.0/x86_64/minimal |
|
| 179 |
+ostree commit: photon/3.0/x86_64/minimal (a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650) |
|
| 180 |
+ Linux-PAM-1.3.0-1.ph3.x86_64 |
|
| 181 |
+ attr-2.4.48-1.ph3.x86_64 |
|
| 182 |
+ autogen-libopts-5.18.16-1.ph3.x86_64 |
|
| 183 |
+ bash-4.4.18-1.ph3.x86_64 |
|
| 184 |
+ bc-1.07.1-1.ph3.x86_64 |
|
| 185 |
+ binutils-2.31.1-6.ph3.x86_64 |
|
| 186 |
+ bridge-utils-1.6-1.ph3.x86_64 |
|
| 187 |
+ bubblewrap-0.3.0-2.ph3.x86_64 |
|
| 188 |
+ bzip2-1.0.6-10.ph3.x86_64 |
|
| 189 |
+ bzip2-libs-1.0.6-10.ph3.x86_64 |
|
| 190 |
+ ca-certificates-20190521-1.ph3.x86_64 |
|
| 191 |
+ ca-certificates-pki-20190521-1.ph3.x86_64 |
|
| 192 |
+ coreutils-8.30-1.ph3.x86_64 |
|
| 193 |
+ cpio-2.12-4.ph3.x86_64 |
|
| 194 |
+ cracklib-2.9.6-8.ph3.x86_64 |
|
| 195 |
+ cracklib-dicts-2.9.6-8.ph3.x86_64 |
|
| 196 |
+ curl-7.61.1-4.ph3.x86_64 |
|
| 197 |
+ curl-libs-7.61.1-4.ph3.x86_64 |
|
| 198 |
+ dbus-1.13.6-1.ph3.x86_64 |
|
| 199 |
+ device-mapper-2.02.181-1.ph3.x86_64 |
|
| 200 |
+ device-mapper-libs-2.02.181-1.ph3.x86_64 |
|
| 201 |
+ docker-18.06.2-3.ph3.x86_64 |
|
| 202 |
+ dracut-048-1.ph3.x86_64 |
|
| 203 |
+ dracut-tools-048-1.ph3.x86_64 |
|
| 204 |
+ e2fsprogs-libs-1.44.3-2.ph3.x86_64 |
|
| 205 |
+ elfutils-0.176-1.ph3.x86_64 |
|
| 206 |
+ elfutils-libelf-0.176-1.ph3.x86_64 |
|
| 207 |
+ expat-2.2.6-2.ph3.x86_64 |
|
| 208 |
+ expat-libs-2.2.6-2.ph3.x86_64 |
|
| 209 |
+ file-5.34-1.ph3.x86_64 |
|
| 210 |
+ file-libs-5.34-1.ph3.x86_64 |
|
| 211 |
+ filesystem-1.1-4.ph3.x86_64 |
|
| 212 |
+ findutils-4.6.0-5.ph3.x86_64 |
|
| 213 |
+ flex-2.6.4-2.ph3.x86_64 |
|
| 214 |
+ fuse-2.9.7-5.ph3.x86_64 |
|
| 215 |
+ gc-8.0.0-1.ph3.x86_64 |
|
| 216 |
+ glib-2.58.0-4.ph3.x86_64 |
|
| 217 |
+ glib-networking-2.59.1-2.ph3.x86_64 |
|
| 218 |
+ glibc-2.28-4.ph3.x86_64 |
|
| 219 |
+ glibc-iconv-2.28-4.ph3.x86_64 |
|
| 220 |
+ gmp-6.1.2-2.ph3.x86_64 |
|
| 221 |
+ gnupg-2.2.17-1.ph3.x86_64 |
|
| 222 |
+ gnutls-3.6.3-3.ph3.x86_64 |
|
| 223 |
+ gobject-introspection-1.58.0-2.ph3.x86_64 |
|
| 224 |
+ gpgme-1.11.1-2.ph3.x86_64 |
|
| 225 |
+ grep-3.1-1.ph3.x86_64 |
|
| 226 |
+ grub2-2.02-13.ph3.x86_64 |
|
| 227 |
+ grub2-efi-2.02-13.ph3.x86_64 |
|
| 228 |
+ grub2-pc-2.02-13.ph3.x86_64 |
|
| 229 |
+ guile-2.0.13-2.ph3.x86_64 |
|
| 230 |
+ gzip-1.9-1.ph3.x86_64 |
|
| 231 |
+ iana-etc-2.30-2.ph3.noarch |
|
| 232 |
+ icu-61.1-1.ph3.x86_64 |
|
| 233 |
+ iproute2-4.18.0-2.ph3.x86_64 |
|
| 234 |
+ iptables-1.8.3-1.ph3.x86_64 |
|
| 235 |
+ js-1.8.5-2.ph3.x86_64 |
|
| 236 |
+ json-c-0.13.1-1.ph3.x86_64 |
|
| 237 |
+ json-glib-1.4.4-1.ph3.x86_64 |
|
| 238 |
+ kmod-25-1.ph3.x86_64 |
|
| 239 |
+ krb5-1.17-1.ph3.x86_64 |
|
| 240 |
+ libapparmor-2.13-7.ph3.x86_64 |
|
| 241 |
+ libarchive-3.3.3-3.ph3.x86_64 |
|
| 242 |
+ libassuan-2.5.1-1.ph3.x86_64 |
|
| 243 |
+ libcap-2.25-8.ph3.x86_64 |
|
| 244 |
+ libdb-5.3.28-2.ph3.x86_64 |
|
| 245 |
+ libffi-3.2.1-6.ph3.x86_64 |
|
| 246 |
+ libgcc-7.3.0-4.ph3.x86_64 |
|
| 247 |
+ libgcrypt-1.8.3-2.ph3.x86_64 |
|
| 248 |
+ libgomp-7.3.0-4.ph3.x86_64 |
|
| 249 |
+ libgpg-error-1.32-1.ph3.x86_64 |
|
| 250 |
+ libgsystem-2015.2-2.ph3.x86_64 |
|
| 251 |
+ libksba-1.3.5-1.ph3.x86_64 |
|
| 252 |
+ libltdl-2.4.6-3.ph3.x86_64 |
|
| 253 |
+ libmodulemd-2.4.0-1.ph3.x86_64 |
|
| 254 |
+ libpsl-0.20.2-1.ph3.x86_64 |
|
| 255 |
+ librepo-1.10.2-1.ph3.x86_64 |
|
| 256 |
+ libseccomp-2.4.0-1.ph3.x86_64 |
|
| 257 |
+ libselinux-2.8-1.ph3.x86_64 |
|
| 258 |
+ libsepol-2.8-1.ph3.x86_64 |
|
| 259 |
+ libsolv-0.6.35-1.ph3.x86_64 |
|
| 260 |
+ libsoup-2.64.0-2.ph3.x86_64 |
|
| 261 |
+ libssh2-1.9.0-1.ph3.x86_64 |
|
| 262 |
+ libstdc++-7.3.0-4.ph3.x86_64 |
|
| 263 |
+ libtasn1-4.13-1.ph3.x86_64 |
|
| 264 |
+ libtool-2.4.6-3.ph3.x86_64 |
|
| 265 |
+ libunistring-0.9.10-1.ph3.x86_64 |
|
| 266 |
+ libxml2-2.9.9-1.ph3.x86_64 |
|
| 267 |
+ libyaml-0.2.1-2.ph3.x86_64 |
|
| 268 |
+ linux-4.19.65-3.ph3.x86_64 |
|
| 269 |
+ m4-1.4.18-2.ph3.x86_64 |
|
| 270 |
+ mpfr-4.0.1-1.ph3.x86_64 |
|
| 271 |
+ ncurses-6.1-1.ph3.x86_64 |
|
| 272 |
+ ncurses-libs-6.1-1.ph3.x86_64 |
|
| 273 |
+ ncurses-terminfo-6.1-1.ph3.x86_64 |
|
| 274 |
+ net-tools-1.60-11.ph3.x86_64 |
|
| 275 |
+ nettle-3.4-1.ph3.x86_64 |
|
| 276 |
+ npth-1.6-1.ph3.x86_64 |
|
| 277 |
+ nspr-4.21-1.ph3.x86_64 |
|
| 278 |
+ nss-altfiles-2.23.0-1.ph3.x86_64 |
|
| 279 |
+ nss-libs-3.44-2.ph3.x86_64 |
|
| 280 |
+ openssh-7.8p1-5.ph3.x86_64 |
|
| 281 |
+ openssh-clients-7.8p1-5.ph3.x86_64 |
|
| 282 |
+ openssh-server-7.8p1-5.ph3.x86_64 |
|
| 283 |
+ openssl-1.0.2s-1.ph3.x86_64 |
|
| 284 |
+ ostree-2019.2-1.ph3.x86_64 |
|
| 285 |
+ ostree-grub2-2019.2-1.ph3.x86_64 |
|
| 286 |
+ ostree-libs-2019.2-1.ph3.x86_64 |
|
| 287 |
+ pcre-8.42-1.ph3.x86_64 |
|
| 288 |
+ pcre-libs-8.42-1.ph3.x86_64 |
|
| 289 |
+ photon-release-3.0-3.ph3.noarch |
|
| 290 |
+ photon-repos-3.0-3.ph3.noarch |
|
| 291 |
+ pinentry-1.1.0-1.ph3.x86_64 |
|
| 292 |
+ pkg-config-0.29.2-2.ph3.x86_64 |
|
| 293 |
+ polkit-0.113-5.ph3.x86_64 |
|
| 294 |
+ popt-1.16-5.ph3.x86_64 |
|
| 295 |
+ procps-ng-3.3.15-1.ph3.x86_64 |
|
| 296 |
+ python3-3.7.3-2.ph3.x86_64 |
|
| 297 |
+ python3-libs-3.7.3-2.ph3.x86_64 |
|
| 298 |
+ readline-7.0-2.ph3.x86_64 |
|
| 299 |
+ rpm-libs-4.14.2-4.ph3.x86_64 |
|
| 300 |
+ rpm-ostree-2019.3-1.ph3.x86_64 |
|
| 301 |
+ sed-4.5-1.ph3.x86_64 |
|
| 302 |
+ shadow-4.6-3.ph3.x86_64 |
|
| 303 |
+ shadow-tools-4.6-3.ph3.x86_64 |
|
| 304 |
+ sqlite-libs-3.27.2-3.ph3.x86_64 |
|
| 305 |
+ systemd-239-13.ph3.x86_64 |
|
| 306 |
+ util-linux-2.32-1.ph3.x86_64 |
|
| 307 |
+ util-linux-libs-2.32-1.ph3.x86_64 |
|
| 308 |
+ vim-8.1.0388-4.ph3.x86_64 |
|
| 309 |
+ which-2.21-5.ph3.x86_64 |
|
| 310 |
+ xz-5.2.4-1.ph3.x86_64 |
|
| 311 |
+ xz-libs-5.2.4-1.ph3.x86_64 |
|
| 312 |
+ zchunk-1.1.1-1.ph3.x86_64 |
|
| 313 |
+ zchunk-libs-1.1.1-1.ph3.x86_64 |
|
| 314 |
+ zlib-1.2.11-1.ph3.x86_64 |
|
| 315 |
+``` |
|
| 316 |
+ |
|
| 317 |
+## Querying for package details |
|
| 318 |
+ |
|
| 319 |
+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. |
|
| 320 |
+ |
|
| 321 |
+``` |
|
| 322 |
+root@photon-host [ /usr/share/man/man1 ]# rpm -ql rpm-ostree |
|
| 323 |
+/usr/bin/atomic |
|
| 324 |
+/usr/bin/rpm-ostree |
|
| 325 |
+/usr/lib/girepository-1.0/RpmOstree-1.0.typelib |
|
| 326 |
+/usr/lib/librpmostree-1.so.1 |
|
| 327 |
+/usr/lib/librpmostree-1.so.1.0.0 |
|
| 328 |
+/usr/lib/rpm-ostree |
|
| 329 |
+/usr/lib/rpm-ostree/tmpfiles-ostree-integration.conf |
|
| 330 |
+/usr/share/man/man1/atomic.1.gz |
|
| 331 |
+/usr/share/man/man1/rpm-ostree.1.gz |
|
| 332 |
+``` |
|
| 333 |
+ |
|
| 334 |
+## Why am I unable to install, upgrade or uninstall packages? |
|
| 335 |
+ |
|
| 336 |
+The OSTree host installer needs the server URL or the server repository. |
|
| 337 |
+ |
|
| 338 |
+When you perform the installation using the repo, the install packages are located under the layer package. When you install with the URL, the packages are located under the local packages. |
|
| 339 |
+ |
|
| 340 |
+You can use the `rpm-ostree uninstall` command to uninstall only the layered and local packages but not the base packages. To modify the base packages, you can use the `rpm-ostree override` command. |
|
| 341 |
+ |
|
| 342 |
+When you run `rpm-ostree upgrade`, the command will only upgrade packages based on the commit available in the server. |
|
| 343 |
+ |
|
| 344 |
+ |
| 0 | 345 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,492 @@ |
| 0 |
+# Host Updating Operations |
|
| 1 |
+ |
|
| 2 |
+- [Upgrade Overview](#upgrade-overview) |
|
| 3 |
+- [Incremental upgrade](#incremental-upgrade) |
|
| 4 |
+- [Listing file differences](#listing-file-differences) |
|
| 5 |
+- [Listing package differences](#listing-package-differences) |
|
| 6 |
+- [Rollback](#rollback) |
|
| 7 |
+- [Installing Packages](#installing-packages) |
|
| 8 |
+- [Uninstalling Packages](#uninstalling-packages) |
|
| 9 |
+- [Deleting a deployed filetree](#deleting-a-deployed-filetree) |
|
| 10 |
+- [Version skipping upgrade](#version-skipping-upgrade) |
|
| 11 |
+- [Tracking parent commits](#tracking-parent-commits) |
|
| 12 |
+- [Resetting a branch to a previous commit](#resetting-a-branch-to-a-previous-commit) |
|
| 13 |
+ |
|
| 14 |
+## Upgrade overview |
|
| 15 |
+ |
|
| 16 |
+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". |
|
| 17 |
+ |
|
| 18 |
+OSTree and RPM-OSTree don't distinguish 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. |
|
| 19 |
+ |
|
| 20 |
+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. |
|
| 21 |
+ |
|
| 22 |
+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. |
|
| 23 |
+ |
|
| 24 |
+As we'll see in a future chapter, a jump to a different Refspec (branch) is also supported and it's named "rebase". |
|
| 25 |
+ |
|
| 26 |
+## Incremental upgrade |
|
| 27 |
+ |
|
| 28 |
+To check if there are any updates available, one would execute: |
|
| 29 |
+``` |
|
| 30 |
+root@photon-host-def [ ~ ]# rpm-ostree upgrade |
|
| 31 |
+Updating from: photon:photon/3.0/x86_64/minimal |
|
| 32 |
+ |
|
| 33 |
+ |
|
| 34 |
+No upgrade available. |
|
| 35 |
+``` |
|
| 36 |
+It is good idea to check periodically for updates. |
|
| 37 |
+ |
|
| 38 |
+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. |
|
| 39 |
+``` |
|
| 40 |
+root@photon-host [ ~ ]# rpm-ostree upgrade --check-diff |
|
| 41 |
+Updating from: photon:photon/3.0/x86_64/minimal |
|
| 42 |
+ |
|
| 43 |
+8 metadata, 13 content objects fetched; 1026 KiB transferred in 0 seconds |
|
| 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 |
+``` |
|
| 48 |
+ |
|
| 49 |
+We like what we see and now let's upgrade for real. This command will deploy a new bootable filetree. |
|
| 50 |
+``` |
|
| 51 |
+root@photon-host [ ~ ]# rpm-ostree upgrade |
|
| 52 |
+Receiving metadata objects: 134/(estimating) 14.1 MB/s 14.1 MB... done |
|
| 53 |
+Checking out tree c8f2b11... done |
|
| 54 |
+Enabled rpm-md repositories: repo photon-updates photon photon-extras |
|
| 55 |
+rpm-md repo 'repo' (cached); generated: 2019-09-18T05:26:00Z |
|
| 56 |
+rpm-md repo 'photon-updates' (cached); generated: 2019-09-11T00:02:44Z |
|
| 57 |
+rpm-md repo 'photon' (cached); generated: 2019-02-06T08:56:24Z |
|
| 58 |
+rpm-md repo 'photon-extras' (cached); generated: 2018-11-02T18:09:56Z |
|
| 59 |
+Importing rpm-md... done |
|
| 60 |
+Resolving dependencies... done |
|
| 61 |
+Checking out packages... done |
|
| 62 |
+Running pre scripts... done |
|
| 63 |
+Running post scripts... done |
|
| 64 |
+Writing rpmdb... done |
|
| 65 |
+Writing OSTree commit... done |
|
| 66 |
+Staging deployment... done |
|
| 67 |
+Freed: 20.7 MB (pkgcache branches: 0) |
|
| 68 |
+ zlib 1.2.11-1.ph3 -> 1.2.11-2.ph3 |
|
| 69 |
+Downgraded: |
|
| 70 |
+ ostree 2019.2-15.ph3 -> 2019.2-2.ph3 |
|
| 71 |
+ ostree-grub2 2019.2-15.ph3 -> 2019.2-2.ph3 |
|
| 72 |
+ ostree-libs 2019.2-15.ph3 -> 2019.2-2.ph3 |
|
| 73 |
+Removed: |
|
| 74 |
+ chkconfig-1.9-1.ph3.x86_64 |
|
| 75 |
+ elasticsearch-6.7.0-2.ph3.x86_64 |
|
| 76 |
+ kibana-6.7.0-2.ph3.x86_64 |
|
| 77 |
+ logstash-6.7.0-2.ph3.x86_64 |
|
| 78 |
+ newt-0.52.20-1.ph3.x86_64 |
|
| 79 |
+ nodejs-10.15.2-1.ph3.x86_64 |
|
| 80 |
+ openjdk8-1.8.0.212-2.ph3.x86_64 |
|
| 81 |
+ openjre8-1.8.0.212-2.ph3.x86_64 |
|
| 82 |
+ ruby-2.5.3-2.ph3.x86_64 |
|
| 83 |
+ slang-2.3.2-1.ph3.x86_64 |
|
| 84 |
+Added: |
|
| 85 |
+ nss-3.44-2.ph3.x86_64 |
|
| 86 |
+ xmlsec1-1.2.26-2.ph3.x86_64 |
|
| 87 |
+Run "systemctl reboot" to start a reboot |
|
| 88 |
+``` |
|
| 89 |
+By looking at the commit history, notice that the new commit has the original commit as parent. |
|
| 90 |
+ |
|
| 91 |
+``` |
|
| 92 |
+root@photon-host [ ~ ]# ostree log photon/3.0/x86_64/minimal |
|
| 93 |
+commit c8f2b116b067d7695f9033bf2a99505198269354e157c0f2d5b78266cb874239 |
|
| 94 |
+ContentChecksum: 9bc2079ad70df6dc9373752b254711f3413ae8a07628016c7de7f7d3fa505a6f |
|
| 95 |
+Date: 2019-09-18 08:22:15 +0000 |
|
| 96 |
+Version: 3.0_minimal.2 |
|
| 97 |
+(no subject) |
|
| 98 |
+ |
|
| 99 |
+commit 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 100 |
+ContentChecksum: c3650c76e2bb0e9b6b063cda2dd55939c965c54fd0b0f5ce2cfb7e801403e610 |
|
| 101 |
+Date: 2019-09-16 09:51:33 +0000 |
|
| 102 |
+Version: 3.0_minimal.1 |
|
| 103 |
+``` |
|
| 104 |
+ |
|
| 105 |
+Notice that now we have a new reference, that corresponds to the newly deployed image. |
|
| 106 |
+ |
|
| 107 |
+``` |
|
| 108 |
+root@photon-host [ ~ ]# ostree refs |
|
| 109 |
+rpmostree/pkg/createrepo__c/0.11.1-2.ph3.x86__64 |
|
| 110 |
+rpmostree/pkg/wget/1.20.3-1.ph3.x86__64 |
|
| 111 |
+photon-1:photon/3.0/x86_64/minimal |
|
| 112 |
+rpmostree/base/0 |
|
| 113 |
+rpmostree/base/1 |
|
| 114 |
+ostree/0/0/0 |
|
| 115 |
+ostree/0/0/1 |
|
| 116 |
+ostree/0/0/2 |
|
| 117 |
+rpmostree/pkg/rpm/4.14.2-4.ph3.x86__64 |
|
| 118 |
+``` |
|
| 119 |
+ |
|
| 120 |
+Let us 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. |
|
| 121 |
+ |
|
| 122 |
+``` |
|
| 123 |
+root@photon-host [ ~ ]# rpm-ostree status |
|
| 124 |
+State: idle |
|
| 125 |
+AutomaticUpdates: disabled |
|
| 126 |
+Deployments: |
|
| 127 |
+ ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 128 |
+ Version: 3.0_minimal.2 (2019-09-18T08:22:15Z) |
|
| 129 |
+ BaseCommit: c8f2b116b067d7695f9033bf2a99505198269354e157c0f2d5b78266cb874239 |
|
| 130 |
+ Diff: 1 upgraded, 3 downgraded, 10 removed, 2 added |
|
| 131 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 132 |
+ |
|
| 133 |
+* ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 134 |
+ Version: 3.0_minimal.1 (2019-09-16T09:51:33Z) |
|
| 135 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 136 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 137 |
+ |
|
| 138 |
+ ostree://photon:photon/3.0/x86_64/minimal |
|
| 139 |
+ Version: 3.0_minimal.1 (2019-09-16T09:51:33Z) |
|
| 140 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 141 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 142 |
+``` |
|
| 143 |
+ |
|
| 144 |
+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. |
|
| 145 |
+ |
|
| 146 |
+ |
|
| 147 |
+ |
|
| 148 |
+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. |
|
| 149 |
+``` |
|
| 150 |
+root@photon-host [ ~ ]# rpm-ostree status |
|
| 151 |
+State: idle |
|
| 152 |
+AutomaticUpdates: disabled |
|
| 153 |
+Deployments: |
|
| 154 |
+* ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 155 |
+ Version: 3.0_minimal.2 (2019-09-18T08:22:15Z) |
|
| 156 |
+ BaseCommit: c8f2b116b067d7695f9033bf2a99505198269354e157c0f2d5b78266cb874239 |
|
| 157 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 158 |
+ |
|
| 159 |
+ ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 160 |
+ Version: 3.0_minimal.1 (2019-09-16T09:51:33Z) |
|
| 161 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 162 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 163 |
+``` |
|
| 164 |
+ |
|
| 165 |
+Also, the current deployment directory is based on the new commit: |
|
| 166 |
+ |
|
| 167 |
+``` |
|
| 168 |
+root@photon-host-def [ ~ ]# ostree admin config-diff --print-current-dir |
|
| 169 |
+/ostree/deploy/photon/deploy/63fd7a46dac6c169ee997039c229dd1d626f9b13eaf47b7a183f7a449eb4076f.0 |
|
| 170 |
+``` |
|
| 171 |
+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. |
|
| 172 |
+ |
|
| 173 |
+## Listing file differences |
|
| 174 |
+ |
|
| 175 |
+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. |
|
| 176 |
+``` |
|
| 177 |
+root@photon-host-def [ ~ ]# ostree diff 63fd 37e2 |
|
| 178 |
+M /usr/etc/ld.so.cache |
|
| 179 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Basenames |
|
| 180 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Conflictname |
|
| 181 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Dirnames |
|
| 182 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Enhancename |
|
| 183 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Filetriggername |
|
| 184 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Group |
|
| 185 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Installtid |
|
| 186 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Name |
|
| 187 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Obsoletename |
|
| 188 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Packages |
|
| 189 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Providename |
|
| 190 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Recommendname |
|
| 191 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Requirename |
|
| 192 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Sha1header |
|
| 193 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Sigmd5 |
|
| 194 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Suggestname |
|
| 195 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Supplementname |
|
| 196 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Transfiletriggername |
|
| 197 |
+M /usr/lib/sysimage/rpm-ostree-base-db/Triggername |
|
| 198 |
+M /usr/share/rpm/Basenames |
|
| 199 |
+M /usr/share/rpm/Conflictname |
|
| 200 |
+M /usr/share/rpm/Dirnames |
|
| 201 |
+M /usr/share/rpm/Enhancename |
|
| 202 |
+M /usr/share/rpm/Filetriggername |
|
| 203 |
+M /usr/share/rpm/Group |
|
| 204 |
+M /usr/share/rpm/Installtid |
|
| 205 |
+M /usr/share/rpm/Name |
|
| 206 |
+M /usr/share/rpm/Obsoletename |
|
| 207 |
+M /usr/share/rpm/Packages |
|
| 208 |
+M /usr/share/rpm/Providename |
|
| 209 |
+M /usr/share/rpm/Recommendname |
|
| 210 |
+M /usr/share/rpm/Requirename |
|
| 211 |
+M /usr/share/rpm/Sha1header |
|
| 212 |
+M /usr/share/rpm/Sigmd5 |
|
| 213 |
+M /usr/share/rpm/Suggestname |
|
| 214 |
+M /usr/share/rpm/Supplementname |
|
| 215 |
+M /usr/share/rpm/Transfiletriggername |
|
| 216 |
+M /usr/share/rpm/Triggername |
|
| 217 |
+M /usr/share/rpm-ostree/treefile.json |
|
| 218 |
+D /usr/bin/certutil |
|
| 219 |
+D /usr/bin/nss-config |
|
| 220 |
+D /usr/bin/pk12util |
|
| 221 |
+D /usr/bin/xmlsec1 |
|
| 222 |
+D /usr/lib/libfreebl3.chk |
|
| 223 |
+D /usr/lib/libfreebl3.so |
|
| 224 |
+D /usr/lib/libfreeblpriv3.chk |
|
| 225 |
+D /usr/lib/libgtest1.so |
|
| 226 |
+D /usr/lib/libgtestutil.so |
|
| 227 |
+D /usr/lib/libnssckbi.so |
|
| 228 |
+D /usr/lib/libnssdbm3.chk |
|
| 229 |
+D /usr/lib/libnssdbm3.so |
|
| 230 |
+D /usr/lib/libnsssysinit.so |
|
| 231 |
+D /usr/lib/libsmime3.so |
|
| 232 |
+D /usr/lib/libsoftokn3.chk |
|
| 233 |
+D /usr/lib/libssl3.so |
|
| 234 |
+D /usr/lib/libxmlsec1-nss.so |
|
| 235 |
+D /usr/lib/libxmlsec1-nss.so.1 |
|
| 236 |
+D /usr/lib/libxmlsec1-nss.so.1.2.26 |
|
| 237 |
+D /usr/lib/libxmlsec1-openssl.so |
|
| 238 |
+D /usr/lib/libxmlsec1-openssl.so.1 |
|
| 239 |
+D /usr/lib/libxmlsec1-openssl.so.1.2.26 |
|
| 240 |
+D /usr/lib/libxmlsec1.so |
|
| 241 |
+D /usr/lib/libxmlsec1.so.1 |
|
| 242 |
+D /usr/lib/libxmlsec1.so.1.2.26 |
|
| 243 |
+``` |
|
| 244 |
+ |
|
| 245 |
+## Listing package differences |
|
| 246 |
+ |
|
| 247 |
+We can also look at package differences, as you expect, using the right tool for the job. |
|
| 248 |
+``` |
|
| 249 |
+root@photon-host-def [ ~ ]# rpm-ostree db diff 63fd 37e2 |
|
| 250 |
+ostree diff commit old: rollback deployment (63fd7a46dac6c169ee997039c229dd1d626f9b13eaf47b7a183f7a449eb4076f) |
|
| 251 |
+ostree diff commit new: booted deployment (37e2ecfa34eb808962fdfed28623bbc457184bcd6bb788b79143d33e3569084f) |
|
| 252 |
+Removed: |
|
| 253 |
+ nss-3.44-2.ph3.x86_64 |
|
| 254 |
+ xmlsec1-1.2.26-2.ph3.x86_64 |
|
| 255 |
+``` |
|
| 256 |
+ |
|
| 257 |
+## Rollback |
|
| 258 |
+ |
|
| 259 |
+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. |
|
| 260 |
+``` |
|
| 261 |
+root@photon-host-def [ ~ ]# rpm-ostree rollback |
|
| 262 |
+Moving 'e663b2872efa01d80e4c34c823431472beb653373af32de83c7d2480316b8a6a.0' to be first deployment |
|
| 263 |
+Transaction complete; bootconfig swap: yes; deployment count change: 0 |
|
| 264 |
+Upgraded: |
|
| 265 |
+ ostree 2019.2-2.ph3 -> 2019.2-15.ph3 |
|
| 266 |
+ ostree-grub2 2019.2-2.ph3 -> 2019.2-15.ph3 |
|
| 267 |
+ ostree-libs 2019.2-2.ph3 -> 2019.2-15.ph3 |
|
| 268 |
+ zlib 1.2.11-2.ph3 -> 1.2.11-1.ph3 |
|
| 269 |
+Removed: |
|
| 270 |
+ nss-3.44-2.ph3.x86_64 |
|
| 271 |
+ xmlsec1-1.2.26-2.ph3.x86_64 |
|
| 272 |
+Added: |
|
| 273 |
+ chkconfig-1.9-1.ph3.x86_64 |
|
| 274 |
+ elasticsearch-6.7.0-2.ph3.x86_64 |
|
| 275 |
+ kibana-6.7.0-2.ph3.x86_64 |
|
| 276 |
+ logstash-6.7.0-2.ph3.x86_64 |
|
| 277 |
+ newt-0.52.20-1.ph3.x86_64 |
|
| 278 |
+ nodejs-10.15.2-1.ph3.x86_64 |
|
| 279 |
+ openjdk8-1.8.0.212-2.ph3.x86_64 |
|
| 280 |
+ openjre8-1.8.0.212-2.ph3.x86_64 |
|
| 281 |
+ ruby-2.5.3-2.ph3.x86_64 |
|
| 282 |
+ slang-2.3.2-1.ph3.x86_64 |
|
| 283 |
+Run "systemctl reboot" to start a reboot |
|
| 284 |
+``` |
|
| 285 |
+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. |
|
| 286 |
+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. |
|
| 287 |
+ |
|
| 288 |
+The boot order moved back to original: |
|
| 289 |
+ |
|
| 290 |
+``` |
|
| 291 |
+root@photon-host-def [ ~ ]# rpm-ostree status |
|
| 292 |
+State: idle |
|
| 293 |
+AutomaticUpdates: disabled |
|
| 294 |
+Deployments: |
|
| 295 |
+* ostree://photon-2:photon/3.0/x86_64/minimal |
|
| 296 |
+ Version: 3.0_minimal.3 (2019-09-18T12:48:03Z) |
|
| 297 |
+ Commit: cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b |
|
| 298 |
+ |
|
| 299 |
+ ostree://photon:photon/3.0/x86_64/minimal |
|
| 300 |
+ Version: 3.0_minimal (2019-08-29T11:20:19Z) |
|
| 301 |
+ Commit: a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 302 |
+ |
|
| 303 |
+``` |
|
| 304 |
+The current bootable image path moved also back to the original value: |
|
| 305 |
+``` |
|
| 306 |
+root@photon-host-def [ ~ ]# ostree admin config-diff --print-current-dir |
|
| 307 |
+/ostree/deploy/photon/deploy/47899767bdd4276266383fce13c4a26a51ca0304ae754609283d75f7d8aad36e.0 |
|
| 308 |
+``` |
|
| 309 |
+ |
|
| 310 |
+## Installing Packages |
|
| 311 |
+ |
|
| 312 |
+You can add more packages onto the system that are not part of the commit composed on the server. |
|
| 313 |
+ |
|
| 314 |
+``` |
|
| 315 |
+rpm-ostree install <packages> |
|
| 316 |
+``` |
|
| 317 |
+ |
|
| 318 |
+**Example**: |
|
| 319 |
+ |
|
| 320 |
+``` |
|
| 321 |
+rpm-ostree install https://kojipkgs.fedoraproject.org//packages/wget/1.19.5/5.fc29/x86_64/wget-1.19.5-5.fc29.x86_64.rpm |
|
| 322 |
+ |
|
| 323 |
+``` |
|
| 324 |
+ |
|
| 325 |
+## Uninstalling Packages |
|
| 326 |
+ |
|
| 327 |
+To remove layered packages installed from a repository, use |
|
| 328 |
+ |
|
| 329 |
+``` |
|
| 330 |
+rpm-ostree uninstall <pkg> |
|
| 331 |
+``` |
|
| 332 |
+ |
|
| 333 |
+To remove layered packages installed from a local package, you must specify the full NEVRA of the package. |
|
| 334 |
+ |
|
| 335 |
+For example: |
|
| 336 |
+ |
|
| 337 |
+``` |
|
| 338 |
+rpm-ostree uninstall ltrace-0.7.91-16.fc22.x86_64 |
|
| 339 |
+``` |
|
| 340 |
+ |
|
| 341 |
+To uninstall a package that is a part of the base layer, use |
|
| 342 |
+ |
|
| 343 |
+``` |
|
| 344 |
+rpm-ostree override remove <pkg> |
|
| 345 |
+``` |
|
| 346 |
+ |
|
| 347 |
+For example: |
|
| 348 |
+ |
|
| 349 |
+``` |
|
| 350 |
+rpm-ostree override remove firefox |
|
| 351 |
+``` |
|
| 352 |
+ |
|
| 353 |
+## Deleting a deployed filetree |
|
| 354 |
+ |
|
| 355 |
+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. |
|
| 356 |
+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). |
|
| 357 |
+You cannot delete the default bootable filetree, so passing 0 will result in an error. |
|
| 358 |
+``` |
|
| 359 |
+root@photon-host-def [ ~ ]# ostree admin undeploy -v 1 |
|
| 360 |
+OT: Using bootloader: OstreeBootloaderGrub2 |
|
| 361 |
+Transaction complete; bootconfig swap: yes deployment count change: -1 |
|
| 362 |
+Deleted deployment a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 363 |
+ |
|
| 364 |
+root@photon-host-cus1 [ ~ ]# ostree admin undeploy -v 0 |
|
| 365 |
+OT: Deployment cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b.0 unlocked=0 |
|
| 366 |
+error: Cannot undeploy currently booted deployment 0 |
|
| 367 |
+``` |
|
| 368 |
+Now, we can see that the newer image is gone, the deployment directory for commit a31a has been removed. |
|
| 369 |
+``` |
|
| 370 |
+root@photon-host-def [ ~ ]# rpm-ostree status |
|
| 371 |
+State: idle |
|
| 372 |
+AutomaticUpdates: disabled |
|
| 373 |
+Deployments: |
|
| 374 |
+* ostree://photon-2:photon/3.0/x86_64/minimal |
|
| 375 |
+ Version: 3.0_minimal.3 (2019-09-18T12:48:03Z) |
|
| 376 |
+ Commit: cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b |
|
| 377 |
+ |
|
| 378 |
+root@photon-host-cus1 [ ~ ]# ls /ostree/deploy/photon/deploy/ |
|
| 379 |
+cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b.0 |
|
| 380 |
+cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b.0.origin |
|
| 381 |
+``` |
|
| 382 |
+ |
|
| 383 |
+However the commit is still there in the OSTree repo. |
|
| 384 |
+ |
|
| 385 |
+``` |
|
| 386 |
+root@photon-host-def [ ~ ]# ostree log cf35 |
|
| 387 |
+commit cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b |
|
| 388 |
+ContentChecksum: c24d108c7b7451374b474456a47f512e648833040bfbd4f43d862456bd6d5a18 |
|
| 389 |
+Date: 2019-09-18 12:48:03 +0000 |
|
| 390 |
+Version: 3.0_minimal.3 |
|
| 391 |
+``` |
|
| 392 |
+But there is nothing to rollback to. |
|
| 393 |
+``` |
|
| 394 |
+root@photon-host-def [ ~ ]# rpm-ostree rollback |
|
| 395 |
+error: Found 1 deployments, at least 2 required for rollback |
|
| 396 |
+``` |
|
| 397 |
+If we were to upgrade again, it would bring these packages back, but let's just check the differeneces. |
|
| 398 |
+``` |
|
| 399 |
+root@photon-host-def [ ~ ]# rpm-ostree upgrade --check-diff |
|
| 400 |
+Updating from: photon:photon/3.0/x86_64/minimal |
|
| 401 |
+ |
|
| 402 |
+ |
|
| 403 |
++gawk-4.1.0-2.ph1.x86_64 |
|
| 404 |
++sudo-1.8.11p1-4.ph1.x86_64 |
|
| 405 |
++wget-1.15-1.ph1.x86_64 |
|
| 406 |
+``` |
|
| 407 |
+ |
|
| 408 |
+## Version skipping upgrade |
|
| 409 |
+ |
|
| 410 |
+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. |
|
| 411 |
+ |
|
| 412 |
+``` |
|
| 413 |
+root@photon-host-def [ ~ ]# rpm-ostree upgrade --check-diff |
|
| 414 |
+Updating from: photon:photon/3.0/x86_64/minimal |
|
| 415 |
+ |
|
| 416 |
+7 metadata, 13 content objects fetched; 1287 KiB transferred in 0 seconds |
|
| 417 |
++bison-3.0.2-2.ph1.x86_64 |
|
| 418 |
++gawk-4.1.0-2.ph1.x86_64 |
|
| 419 |
++tar-1.27.1-1.ph1.x86_64 |
|
| 420 |
++wget-1.15-1.ph1.x86_64 |
|
| 421 |
+ |
|
| 422 |
+root@photon-host-def [ ~ ]# rpm-ostree upgrade -r |
|
| 423 |
+Updating from: photon:photon/3.0/x86_64/minimal |
|
| 424 |
+ |
|
| 425 |
+107 metadata, 512 content objects fetched; 13064 KiB transferred in 1 seconds |
|
| 426 |
+Copying /etc changes: 5 modified, 0 removed, 16 added |
|
| 427 |
+Transaction complete; bootconfig swap: yes deployment count change: 1 |
|
| 428 |
+Freed objects: 19.3 MB |
|
| 429 |
+``` |
|
| 430 |
+After reboot, let's check the booting filetrees, the current dir for the current filetree and look at commit differences: |
|
| 431 |
+``` |
|
| 432 |
+root@photon-host-def [ ~ ]# rpm-ostree status |
|
| 433 |
+State: idle |
|
| 434 |
+AutomaticUpdates: disabled |
|
| 435 |
+Deployments: |
|
| 436 |
+* ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 437 |
+ Version: 3.0_minimal.1 (2019-09-16T09:51:33Z) |
|
| 438 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 439 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 440 |
+ |
|
| 441 |
+ ostree://photon:photon/3.0/x86_64/minimal |
|
| 442 |
+ Version: 3.0_minimal.1 (2019-09-16T09:51:33Z) |
|
| 443 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 444 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 445 |
+``` |
|
| 446 |
+ |
|
| 447 |
+``` |
|
| 448 |
+root@photon-host-cus1 [ ~ ]# ostree admin config-diff --print-current-dir |
|
| 449 |
+/ostree/deploy/photon/deploy/e663b2872efa01d80e4c34c823431472beb653373af32de83c7d2480316b8a6a.0 |
|
| 450 |
+ |
|
| 451 |
+root@photon-host-cus1 [ ~ ]# rpm-ostree db diff 8b4b e663 |
|
| 452 |
+ostree diff commit old: rollback deployment (8b4b9d4ec033d1eb816711bfdda595d1013fecbe5cd340f6a619cdc9d83a3bf2) |
|
| 453 |
+ostree diff commit new: booted deployment (e663b2872efa01d80e4c34c823431472beb653373af32de83c7d2480316b8a6a) |
|
| 454 |
+ |
|
| 455 |
+root@photon-host-cus1 [ ~ ]# rpm-ostree db diff 82bc 092e |
|
| 456 |
+error: Refspec '82bc' not found |
|
| 457 |
+``` |
|
| 458 |
+Interesting fact: The metadata for commit 82bc has been removed from the local repo. |
|
| 459 |
+ |
|
| 460 |
+## Tracking parent commits |
|
| 461 |
+ |
|
| 462 |
+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: |
|
| 463 |
+ |
|
| 464 |
+ |
|
| 465 |
+``` |
|
| 466 |
+root@photon-host-def [ ~ ]# rpm-ostree db diff 092e^ 092e |
|
| 467 |
+error: No such metadata object 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.commit |
|
| 468 |
+error: Refspec '82cb' not found |
|
| 469 |
+root@photon-host-def [ ~ ]# rpm-ostree db diff 092e^^ 092e |
|
| 470 |
+error: No such metadata object 82bca728eadb7292d568404484ad6889c3f6303600ca8c743a4336e0a10b3817.commit |
|
| 471 |
+``` |
|
| 472 |
+ |
|
| 473 |
+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. |
|
| 474 |
+ |
|
| 475 |
+## Resetting a branch to a previous commit |
|
| 476 |
+ |
|
| 477 |
+We can reset the head of a branch in a local repo to a previous commit, for example corresponding to version 0 (3.0_minimal). |
|
| 478 |
+ |
|
| 479 |
+``` |
|
| 480 |
+root@photon-host-def [ ~ ]# ostree reset photon:photon/3.0/x86_64/minimal cf35 |
|
| 481 |
+``` |
|
| 482 |
+ |
|
| 483 |
+Now if we look again at the branch commit history, the head is at version 0. |
|
| 484 |
+ |
|
| 485 |
+``` |
|
| 486 |
+root@photon-host-def [ ~ ]# ostree log photon/3.0/x86_64/minimal |
|
| 487 |
+commit cf357c0f376decb3bae42326737db7e36bcf3568ab901c33dc57800c3718f07b |
|
| 488 |
+ContentChecksum: c24d108c7b7451374b474456a47f512e648833040bfbd4f43d862456bd6d5a18 |
|
| 489 |
+Date: 2019-09-18 12:48:03 +0000 |
|
| 490 |
+Version: 3.0_minimal |
|
| 491 |
+``` |
| 0 | 492 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,19 @@ |
| 0 |
+# Installing a Photon RPM-OSTree Package |
|
| 1 |
+ |
|
| 2 |
+Photon OS 3.0 includes a `rpm-ostree-repo` package that can be installed on a VM. |
|
| 3 |
+ |
|
| 4 |
+This package provides an automated script that creates a repo tree that acts as a server. |
|
| 5 |
+ |
|
| 6 |
+## Composing your first OSTree repo |
|
| 7 |
+ |
|
| 8 |
+Use the following commands to initialize a new repo and to compose it. |
|
| 9 |
+ |
|
| 10 |
+``` |
|
| 11 |
+root [ ~ ]# cd /srv/rpm-ostree |
|
| 12 |
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2 |
|
| 13 |
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json |
|
| 14 |
+``` |
|
| 15 |
+ |
|
| 16 |
+You can now deploy a host. For more information, see [File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md) and [Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md) to learn create your own customized file tree. |
|
| 17 |
+ |
|
| 18 |
+ |
| 0 | 19 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,45 @@ |
| 0 |
+# Installing a Photon RPM-OStree host against a custom server repository |
|
| 1 |
+ |
|
| 2 |
+Organizations that maintain their own OSTree servers create custom image trees suited to their needs from which hosts can be deployed and upgraded. One single server may make available several branches to install, for example "base", "minimal" and "full". Or, if you think in terms of Windows OS SKUs - "Home", "Professional" or "Enterprise" edition. |
|
| 3 |
+ |
|
| 4 |
+So in fact there are two pieces of information the OSTree host installer needs - the server URL and the branch ref. Also, there are two ways to pass this info - manually via keyboard, when prompted and automated, by reading from a config file. |
|
| 5 |
+ |
|
| 6 |
+## Manual install of a custom host |
|
| 7 |
+ |
|
| 8 |
+For Photon 1.0 or 1.0 Revision 2, installing a Photon RPM-OSTree host that will pull from a server repository of your choice is very similar to the way we installed the host against the default server repo in [Chapter 2](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md). |
|
| 9 |
+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". |
|
| 10 |
+ |
|
| 11 |
+ |
|
| 12 |
+ |
|
| 13 |
+An additional screen will ask for the URL of server repo - just enter the IP address or fully qualified domain name of the [server installed in the previous step](Photon-RPM-OSTree-6-Installing-a-server.md). |
|
| 14 |
+ |
|
| 15 |
+ |
|
| 16 |
+ |
|
| 17 |
+Once this is done and the installation finished, reboot and you are ready to use it. |
|
| 18 |
+You may verify - just like in [Chapter 3.1](Photon-RPM-OStree-3-Concepts-in-action#querying-the-deployed-filetrees.md) - that you can get an rpm-ostree status. The value for the CommitID should be identical to the [host that installed from default repo](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md), if the [server](Photon-RPM-OSTree-6-Installing-a-server.md) has been installed fresh, from the same ISO. |
|
| 19 |
+ |
|
| 20 |
+## Automated install of a custom host via kickstart |
|
| 21 |
+ |
|
| 22 |
+Photon 3.0 supports 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. |
|
| 23 |
+ |
|
| 24 |
+If not familiar with the way kickstart works, visit [Kickstart Support in Photon OS](kickstart.md). The kickstart json config for OSTree is similar to minimal or full, except for these settings that should sound familiar: |
|
| 25 |
+ |
|
| 26 |
+``` |
|
| 27 |
+ ... |
|
| 28 |
+ "type": "ostree_host", |
|
| 29 |
+ "ostree_repo_url": "http://192.168.218.249", |
|
| 30 |
+ "ostree_repo_ref": "photon/3.0/x86_64/minimal", |
|
| 31 |
+ ... |
|
| 32 |
+``` |
|
| 33 |
+Or, for default installation |
|
| 34 |
+ |
|
| 35 |
+``` |
|
| 36 |
+ .... |
|
| 37 |
+ "type": "ostree_host", |
|
| 38 |
+ "default_repo": true, |
|
| 39 |
+ .... |
|
| 40 |
+``` |
|
| 41 |
+ |
|
| 42 |
+If the server is a future version of Photon OS, say Photon OS 4.0, and the administrator composed trees for the included json files, the ostree_repo_ref will take either value: **photon/4.0/x86_64/base**, **photon/4.0/x86_64/minimal**, or **photon/4.0/x86_64/full**. |
|
| 43 |
+ |
|
| 44 |
+In most situations, kickstart file is accessed via http from PXE boot. That enables booting from network and end to end install of hosts from pre-defined server URL and branch without assistance from user. |
| 0 | 45 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,345 @@ |
| 0 |
+# Package Oriented Server Operations |
|
| 1 |
+ |
|
| 2 |
+Now that we have a Photon RPM-OSTree server up and running (if not, see how to [install](Photon-RPM-OSTree-6-Installing-a-server.md)), we will learn how to provide the desired set of packages as input and instruct rpm-ostree to compose a filetree, that will result in creation (or update) of an OSTree repo. |
|
| 3 |
+The simplest way to explain is to take a look at the files installed by the Photon RPM-OSTree server during setup. |
|
| 4 |
+ |
|
| 5 |
+``` |
|
| 6 |
+root [ ~ ]# cd /srv/rpm-ostree/ |
|
| 7 |
+root [ /srv/rpm-ostree ]# ls -l |
|
| 8 |
+total 16 |
|
| 9 |
+lrwxrwxrwx 1 root root 31 Aug 28 19:06 lightwave-ostree.repo -> /etc/yum.repos.d/lightwave.repo |
|
| 10 |
+-rw-r--r-- 1 root root 7356 Aug 28 19:06 ostree-httpd.conf |
|
| 11 |
+-rw-r--r-- 1 root root 1085 Aug 28 19:06 photon-base.json |
|
| 12 |
+lrwxrwxrwx 1 root root 35 Aug 28 19:06 photon-extras-ostree.repo -> /etc/yum.repos.d/photon-extras.repo |
|
| 13 |
+lrwxrwxrwx 1 root root 32 Aug 28 19:06 photon-iso-ostree.repo -> /etc/yum.repos.d/photon-iso.repo |
|
| 14 |
+lrwxrwxrwx 1 root root 28 Aug 28 19:06 photon-ostree.repo -> /etc/yum.repos.d/photon.repo |
|
| 15 |
+lrwxrwxrwx 1 root root 36 Aug 28 19:06 photon-updates-ostree.repo -> /etc/yum.repos.d/photon-updates.repo |
|
| 16 |
+drwxr-xr-x 7 root root 4096 Aug 20 22:27 repo |
|
| 17 |
+``` |
|
| 18 |
+## JSON configuration file |
|
| 19 |
+ |
|
| 20 |
+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. |
|
| 21 |
+ |
|
| 22 |
+``` |
|
| 23 |
+root [ /srv/rpm-ostree ]# cat photon-base.json |
|
| 24 |
+{
|
|
| 25 |
+ "comment": "Photon Minimal OSTree", |
|
| 26 |
+ |
|
| 27 |
+ "osname": "photon", |
|
| 28 |
+ |
|
| 29 |
+ "ref": "photon/3.0/x86_64/minimal", |
|
| 30 |
+ |
|
| 31 |
+ "automatic_version_prefix": "3.0_minimal", |
|
| 32 |
+ |
|
| 33 |
+ "repos": ["photon"], |
|
| 34 |
+ |
|
| 35 |
+ "selinux": false, |
|
| 36 |
+ |
|
| 37 |
+ "initramfs-args": ["--no-hostonly"], |
|
| 38 |
+ |
|
| 39 |
+ "bootstrap_packages": ["filesystem"], |
|
| 40 |
+ |
|
| 41 |
+ "documentation": false, |
|
| 42 |
+ |
|
| 43 |
+ "packages": ["glibc", "zlib", "binutils", "gmp", "mpfr", "libgcc", "libstdc++","libgomp", |
|
| 44 |
+ "pkg-config", "ncurses", "bash", "bzip2", "cracklib", "cracklib-dicts", "shadow", |
|
| 45 |
+ "procps-ng", "iana-etc", "readline", "coreutils", "bc", "libtool", "net-tools", |
|
| 46 |
+ "findutils", "xz", "grub2", "grub2-pc", "grub2-efi", "iproute2", "util-linux", "linux", |
|
| 47 |
+ "attr", "libcap", "kmod", "expat", "dbus", "file", |
|
| 48 |
+ "sed", "grep", "cpio", "gzip", |
|
| 49 |
+ "openssl", "ca-certificates", "curl", |
|
| 50 |
+ "systemd", |
|
| 51 |
+ "openssh", "iptables", |
|
| 52 |
+ "photon-release", |
|
| 53 |
+ "vim", "photon-repos", |
|
| 54 |
+ "docker", "bridge-utils", |
|
| 55 |
+ "dracut", "dracut-tools", "rpm-ostree", "nss-altfiles", "which"] |
|
| 56 |
+} |
|
| 57 |
+``` |
|
| 58 |
+ |
|
| 59 |
+There are some mandatory settings, some optional. I'm only going to explain the most important ones for our use case. |
|
| 60 |
+**osname** and **ref** should be familiar, they have been explained in previous sections [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#osname) and [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#refspec). Basicaly, we are asking `rpm-ostree` to compose a tree for photon OS and photon/3.0/x86_64/minimal branch. |
|
| 61 |
+ |
|
| 62 |
+For more information, see the [OS Tree Documentation](https://rpm-ostree.readthedocs.io/en/latest/manual/treefile/). |
|
| 63 |
+ |
|
| 64 |
+## Package addition, removal, upgrade |
|
| 65 |
+ |
|
| 66 |
+**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. |
|
| 67 |
+Let's add to the list three new packages: gawk, sudo and wget using `vim photon-base.json` |
|
| 68 |
+ |
|
| 69 |
+**!!!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.** |
|
| 70 |
+ |
|
| 71 |
+## RPMS repository |
|
| 72 |
+ |
|
| 73 |
+But where are these packages located? RPM-OStree uses the same standard RPMS repositories, that yum installs from. |
|
| 74 |
+ |
|
| 75 |
+``` |
|
| 76 |
+root [ /srv/rpm-ostree ]# ls /etc/yum.repos.d/ |
|
| 77 |
+photon-debuginfo.repo photon-extras.repo photon-iso.repo photon-updates.repo photon.repo |
|
| 78 |
+``` |
|
| 79 |
+ |
|
| 80 |
+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. |
|
| 81 |
+ |
|
| 82 |
+``` |
|
| 83 |
+root [ /srv/rpm-ostree ]# cat /etc/yum.repos.d/photon.repo |
|
| 84 |
+[photon] |
|
| 85 |
+name=VMware Photon Linux 3.0(x86_64) |
|
| 86 |
+baseurl=https://dl.bintray.com/vmware/photon_release_$releasever_$basearch |
|
| 87 |
+gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY |
|
| 88 |
+gpgcheck=1 |
|
| 89 |
+enabled=1 |
|
| 90 |
+skip_if_unavailable=True |
|
| 91 |
+``` |
|
| 92 |
+ |
|
| 93 |
+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. |
|
| 94 |
+ |
|
| 95 |
+So what's in an RPMS repository? If we point the browser to https://dl.bintray.com/vmware/photon_release_3.0_x86_64, we can see there are three top directories: |
|
| 96 |
+* noarch - where all packages that don't depend on the architecture reside. Those may contain scripts, platform neutral source files, configuration. |
|
| 97 |
+* x86_64 - platform dependent packages for Intel 32 and 64 bits CPUs. |
|
| 98 |
+* 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. |
|
| 99 |
+ |
|
| 100 |
+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. |
|
| 101 |
+ |
|
| 102 |
+``` |
|
| 103 |
+root [ /srv/rpm-ostree ]# mount /dev/cdrom |
|
| 104 |
+root [ /srv/rpm-ostree ]# ls /mnt/cdrom/RPMS |
|
| 105 |
+noarch repodata x86_64 |
|
| 106 |
+``` |
|
| 107 |
+ |
|
| 108 |
+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. |
|
| 109 |
+ |
|
| 110 |
+ |
|
| 111 |
+``` |
|
| 112 |
+root [ /srv/rpm-ostree ]# cat /etc/yum.repos.d/photon-iso.repo |
|
| 113 |
+[photon-iso] |
|
| 114 |
+name=VMWare Photon Linux ISO 3.0(x86_64) |
|
| 115 |
+baseurl=file:///mnt/cdrom/RPMS |
|
| 116 |
+gpgkey=file:///etc/pki/rpm-gpg/VMWARE-RPM-GPG-KEY |
|
| 117 |
+gpgcheck=1 |
|
| 118 |
+enabled=0 |
|
| 119 |
+skip_if_unavailable=True |
|
| 120 |
+``` |
|
| 121 |
+ |
|
| 122 |
+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. |
|
| 123 |
+ |
|
| 124 |
+## Composing a tree |
|
| 125 |
+ |
|
| 126 |
+After so much preparation, we can execute a tree compose. We have only added 3 new packages and changed the RPMS repo source. Assuming that the JSON file is editted, run the following: |
|
| 127 |
+ |
|
| 128 |
+``` |
|
| 129 |
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json |
|
| 130 |
+Previous commit: 2940e10c4d90ce6da572cbaeeff7b511cab4a64c280bd5969333dd2fca57cfa8 |
|
| 131 |
+ |
|
| 132 |
+Downloading metadata [=========================================================================] 100% |
|
| 133 |
+ |
|
| 134 |
+Transaction: 117 packages |
|
| 135 |
+ Linux-PAM-1.1.8-2.ph3.x86_64 |
|
| 136 |
+ attr-2.4.47-1.ph3.x86_64 |
|
| 137 |
+ ... |
|
| 138 |
+ gawk-4.1.0-2.ph3.x86_64 |
|
| 139 |
+ ... |
|
| 140 |
+ sudo-1.8.11p1-4.ph3.x86_64 |
|
| 141 |
+ ... |
|
| 142 |
+ wget-1.15-1.ph3.x86_64 |
|
| 143 |
+ which-2.20-1.ph3.x86_64 |
|
| 144 |
+ xz-5.0.5-2.ph3.x86_64 |
|
| 145 |
+ zlib-1.2.8-2.ph3.x86_64 |
|
| 146 |
+Installing packages [==========================================================================] 100% |
|
| 147 |
+Writing '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/usr/share/rpm-ostree/treefile.json' |
|
| 148 |
+Preparing kernel |
|
| 149 |
+Creating empty machine-id |
|
| 150 |
+Executing: /usr/bin/dracut -v --tmpdir=/tmp -f /var/tmp/initramfs.img 4.0.9 --no-hostonly |
|
| 151 |
+... |
|
| 152 |
+*** Including module: bash *** |
|
| 153 |
+*** Including module: kernel-modules *** |
|
| 154 |
+*** Including module: resume *** |
|
| 155 |
+*** Including module: rootfs-block *** |
|
| 156 |
+*** Including module: terminfo *** |
|
| 157 |
+*** Including module: udev-rules *** |
|
| 158 |
+Skipping udev rule: 91-permissions.rules |
|
| 159 |
+Skipping udev rule: 80-drivers-modprobe.rules |
|
| 160 |
+*** Including module: ostree *** |
|
| 161 |
+*** Including module: systemd *** |
|
| 162 |
+*** Including module: usrmount *** |
|
| 163 |
+*** Including module: base *** |
|
| 164 |
+/etc/os-release: line 1: Photon: command not found |
|
| 165 |
+*** Including module: fs-lib *** |
|
| 166 |
+*** Including module: shutdown *** |
|
| 167 |
+*** Including modules done *** |
|
| 168 |
+*** Installing kernel module dependencies and firmware *** |
|
| 169 |
+*** Installing kernel module dependencies and firmware done *** |
|
| 170 |
+*** Resolving executable dependencies *** |
|
| 171 |
+*** Resolving executable dependencies done*** |
|
| 172 |
+*** Stripping files *** |
|
| 173 |
+*** Stripping files done *** |
|
| 174 |
+*** Store current command line parameters *** |
|
| 175 |
+*** Creating image file *** |
|
| 176 |
+*** Creating image file done *** |
|
| 177 |
+Image: /var/tmp/initramfs.img: 11M |
|
| 178 |
+======================================================================== |
|
| 179 |
+Version: dracut-041-1.ph3 |
|
| 180 |
+ |
|
| 181 |
+Arguments: -v --tmpdir '/tmp' -f --no-hostonly |
|
| 182 |
+ |
|
| 183 |
+dracut modules: |
|
| 184 |
+bash |
|
| 185 |
+kernel-modules |
|
| 186 |
+resume |
|
| 187 |
+rootfs-block |
|
| 188 |
+terminfo |
|
| 189 |
+udev-rules |
|
| 190 |
+ostree |
|
| 191 |
+systemd |
|
| 192 |
+usrmount |
|
| 193 |
+base |
|
| 194 |
+fs-lib |
|
| 195 |
+shutdown |
|
| 196 |
+======================================================================== |
|
| 197 |
+drwxr-xr-x 12 root root 0 Sep 1 00:52 . |
|
| 198 |
+crw-r--r-- 1 root root 5, 1 Sep 1 00:52 dev/console |
|
| 199 |
+crw-r--r-- 1 root root 1, 11 Sep 1 00:52 dev/kmsg |
|
| 200 |
+... (long list of files removed) |
|
| 201 |
+======================================================================== |
|
| 202 |
+Initializing rootfs |
|
| 203 |
+Migrating /etc/passwd to /usr/lib/ |
|
| 204 |
+Migrating /etc/group to /usr/lib/ |
|
| 205 |
+Moving /usr to target |
|
| 206 |
+Linking /usr/local -> ../var/usrlocal |
|
| 207 |
+Moving /etc to /usr/etc |
|
| 208 |
+Placing RPM db in /usr/share/rpm |
|
| 209 |
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/lib/nss_db/Makefile' |
|
| 210 |
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/cache/ldconfig/aux-cache' |
|
| 211 |
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/btmp' |
|
| 212 |
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/lastlog' |
|
| 213 |
+Ignoring non-directory/non-symlink '/var/tmp/rpm-ostree.TVO089/rootfs.tmp/var/log/wtmp' |
|
| 214 |
+Moving /boot |
|
| 215 |
+Using boot location: both |
|
| 216 |
+Copying toplevel compat symlinks |
|
| 217 |
+Adding tmpfiles-ostree-integration.conf |
|
| 218 |
+Committing '/var/tmp/rpm-ostree.TVO089/rootfs.tmp' ... |
|
| 219 |
+photon/1.0/x86_64/minimal => c505f4bddb4381e8b5213682465f1e5bb150a18228aa207d763cea45c6a81bbe |
|
| 220 |
+``` |
|
| 221 |
+ |
|
| 222 |
+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.ph3.x86_64, sudo-1.8.11p1-4.ph3.x86_64 and wget-1.15-1.ph3.x86_64 have been added. |
|
| 223 |
+ |
|
| 224 |
+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: |
|
| 225 |
+ |
|
| 226 |
+``` |
|
| 227 |
+root [ /srv/rpm-ostree ]# ls /var/tmp/rpm-ostree.TVO089/rootfs.tmp |
|
| 228 |
+bin dev lib media opt proc run srv sysroot usr |
|
| 229 |
+boot home lib64 mnt ostree root sbin sys tmp var |
|
| 230 |
+``` |
|
| 231 |
+ |
|
| 232 |
+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. |
|
| 233 |
+ |
|
| 234 |
+``` |
|
| 235 |
+root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json |
|
| 236 |
+Previous commit: c505f4bddb4381e8b5213682465f1e5bb150a18228aa207d763cea45c6a81bbe |
|
| 237 |
+ |
|
| 238 |
+Downloading metadata [=========================================================================] 100% |
|
| 239 |
+ |
|
| 240 |
+ |
|
| 241 |
+No apparent changes since previous commit; use --force-nocache to override |
|
| 242 |
+``` |
|
| 243 |
+ |
|
| 244 |
+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. |
|
| 245 |
+ |
|
| 246 |
+ |
|
| 247 |
+## Automatic version prefix |
|
| 248 |
+ |
|
| 249 |
+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. |
|
| 250 |
+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, |
|
| 251 |
+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"`. |
|
| 252 |
+ |
|
| 253 |
+## Installing package updates |
|
| 254 |
+ |
|
| 255 |
+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. |
|
| 256 |
+ |
|
| 257 |
+``` |
|
| 258 |
+"repos": ["photon", "photon-updates"], |
|
| 259 |
+``` |
|
| 260 |
+ |
|
| 261 |
+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. |
|
| 262 |
+``` |
|
| 263 |
+root [ ~ ]# rpm-ostree upgrade --check-diff |
|
| 264 |
+Updating from: photon:photon/3.0/x86_64/minimal |
|
| 265 |
+ |
|
| 266 |
+8 metadata, 13 content objects fetched; 1002 KiB transferred in 0 seconds |
|
| 267 |
+!bridge-utils-1.5-2.ph3.x86_64 |
|
| 268 |
+=bridge-utils-1.5-3.ph3.x86_64 |
|
| 269 |
+!bzip2-1.0.6-5.ph3.x86_64 |
|
| 270 |
+=bzip2-1.0.6-6.ph3.x86_64 |
|
| 271 |
+!curl-7.47.1-2.ph3.x86_64 |
|
| 272 |
+=curl-7.51.0-2.ph3.x86_64 |
|
| 273 |
+!docker-1.11.0-5.ph3.x86_64 |
|
| 274 |
+=docker-1.12.1-1.ph3.x86_64 |
|
| 275 |
+... |
|
| 276 |
++libssh2-1.8.0-1.ph3.x86_64 |
|
| 277 |
+... |
|
| 278 |
+ |
|
| 279 |
+root [ ~ ]# rpm-ostree upgrade |
|
| 280 |
+Updating from: photon:photon/1.0/x86_64/minimal |
|
| 281 |
+ |
|
| 282 |
+258 metadata, 1165 content objects fetched; 76893 KiB transferred in 8 seconds |
|
| 283 |
+Copying /etc changes: 6 modified, 0 removed, 14 added |
|
| 284 |
+Transaction complete; bootconfig swap: yes deployment count change: 1 |
|
| 285 |
+Changed: |
|
| 286 |
+ bridge-utils 1.5-2.ph3 -> 1.5-3.ph3 |
|
| 287 |
+ bzip2 1.0.6-5.ph3 -> 1.0.6-6.ph3 |
|
| 288 |
+ curl 7.47.1-2.ph3 -> 7.51.0-2.ph3 |
|
| 289 |
+ docker 1.11.0-5.ph3 -> 1.12.1-1.ph3 |
|
| 290 |
+ ... |
|
| 291 |
+Added: |
|
| 292 |
+ libssh2-1.8.0-1.ph3.x86_64 |
|
| 293 |
+Upgrade prepared for next boot; run "systemctl reboot" to start a reboot |
|
| 294 |
+``` |
|
| 295 |
+ |
|
| 296 |
+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. |
|
| 297 |
+ |
|
| 298 |
+``` |
|
| 299 |
+root [ ~ ]# rpm-ostree db diff 56ef 396e |
|
| 300 |
+ostree diff commit old: 56e (56ef687f1319604b7900a232715718d26ca407de7e1dc89251b206f8e255dcb4) |
|
| 301 |
+ostree diff commit new: 396 (396e1116ad94692b8c105edaee4fa12447ec3d8f73c7b3ade4e955163d517497) |
|
| 302 |
+Upgraded: |
|
| 303 |
+ bridge-utils-1.5-3.ph3.x86_64 |
|
| 304 |
+* Mon Sep 12 2016 Alexey Makhalov <amakhalov@vmware.com> 1.5-3 |
|
| 305 |
+- Update patch to fix-2. |
|
| 306 |
+ |
|
| 307 |
+ bzip2-1.0.6-6.ph3.x86_64 |
|
| 308 |
+* Fri Oct 21 2016 Kumar Kaushik <kaushikk@vmware.com> 1.0.6-6 |
|
| 309 |
+- Fixing security bug CVE-2016-3189. |
|
| 310 |
+ |
|
| 311 |
+ curl-7.51.0-2.ph3.x86_64 |
|
| 312 |
+* Wed Nov 30 2016 Xiaolin Li <xiaolinl@vmware.com> 7.51.0-2 |
|
| 313 |
+- Enable sftp support. |
|
| 314 |
+ |
|
| 315 |
+* Wed Nov 02 2016 Anish Swaminathan <anishs@vmware.com> 7.51.0-1 |
|
| 316 |
+- Upgrade curl to 7.51.0 |
|
| 317 |
+ |
|
| 318 |
+* Thu Oct 27 2016 Anish Swaminathan <anishs@vmware.com> 7.47.1-4 |
|
| 319 |
+- Patch for CVE-2016-5421 |
|
| 320 |
+ |
|
| 321 |
+* Mon Sep 19 2016 Xiaolin Li <xiaolinl@vmware.com> 7.47.1-3 |
|
| 322 |
+- Applied CVE-2016-7167.patch. |
|
| 323 |
+ |
|
| 324 |
+ docker-1.12.1-1.ph3.x86_64 |
|
| 325 |
+* Wed Sep 21 2016 Xiaolin Li <xiaolinl@vmware.com> 1.12.1-1 |
|
| 326 |
+- Upgraded to version 1.12.1 |
|
| 327 |
+ |
|
| 328 |
+* Mon Aug 22 2016 Alexey Makhalov <amakhalov@vmware.com> 1.12.0-2 |
|
| 329 |
+- Added bash completion file |
|
| 330 |
+ |
|
| 331 |
+* Tue Aug 09 2016 Anish Swaminathan <anishs@vmware.com> 1.12.0-1 |
|
| 332 |
+- Upgraded to version 1.12.0 |
|
| 333 |
+ |
|
| 334 |
+* Tue Jun 28 2016 Anish Swaminathan <anishs@vmware.com> 1.11.2-1 |
|
| 335 |
+- Upgraded to version 1.11.2 |
|
| 336 |
+... |
|
| 337 |
+Added: |
|
| 338 |
+ libssh2-1.8.0-1.ph3.x86_64 |
|
| 339 |
+``` |
|
| 340 |
+ |
|
| 341 |
+## Composing for a different branch |
|
| 342 |
+ |
|
| 343 |
+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. |
|
| 344 |
+Of course, you can create your own config files for your branches with desired lists of packages. You may compose on top of the existing tree, or you can [start fresh your own OSTRee repo](Photon-RPM-OSTree-8-File-oriented-server-operations.md#starting-a-fresh-ostree-repo), using your own customized versioning. |
| 0 | 345 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,52 @@ |
| 0 |
+# Appendix |
|
| 1 |
+ |
|
| 2 |
+## Photon 1.0 GA: systemd-networkd and systemd-resolved not starting in the updated image, on reboot |
|
| 3 |
+This issue has been fixed in 1.0 Revision 2 and above. |
|
| 4 |
+If you compose a custom image at the server, download at the RPM-OSTree host the updated image and reboot, systemd-networkd may report an access denied error, in which case your network interface is not properly configured, and ifconfig will not list an external IP address. This is a bug that was discovered very late and we didn't have time to address it for Photon 1.0. The easy workaround is to temporary relax the server permissions before composing the tree (image) and revert back to the secure umask after that. Here are the steps to recover, that work even after you've already composed a "bad" image and some hosts have downloaded and booted into it: |
|
| 5 |
+At server: |
|
| 6 |
+ 1. Execute **umask 022**. |
|
| 7 |
+ 2. Execute **rpm-ostree compose tree --force-nocache ...** to create a new, good image. |
|
| 8 |
+ 3. Execute **umask 027** to tighten back the server permissions as good security practice. |
|
| 9 |
+ |
|
| 10 |
+At every host that booted into the bad image, from console: |
|
| 11 |
+ 1. Execute **rpm-ostree rollback**, then reboot into the older good image. |
|
| 12 |
+ 2. Login after reboot, then execute **rpm-ostree upgrade** to download the new, good image from server. It's going to skip the bad image version. |
|
| 13 |
+ 3. Reboot into new good image and execute ifconfig, notice you now have an external IP address. Also, your host will have the recommended secure umask 0027 set. |
|
| 14 |
+ |
|
| 15 |
+## OSTree repo is no longer accessible via http after RPM-OSTree server has updated httpd package |
|
| 16 |
+If server itself is updated via tdnf that brings a newer version of httpd package, httpd.service file will be overwritten to a default value (not valid for OSTree repo), and hosts trying to install or upgrade will report an "invalid or missing config". To fix the problem: |
|
| 17 |
+ |
|
| 18 |
+* Replace the content of /usr/lib/systemd/system/httpd.service with: |
|
| 19 |
+``` |
|
| 20 |
+[Unit] |
|
| 21 |
+Description=The Apache HTTP Server |
|
| 22 |
+After=network.target remote-fs.target nss-lookup.target |
|
| 23 |
+ |
|
| 24 |
+[Service] |
|
| 25 |
+Type=forking |
|
| 26 |
+ExecStart=/usr/sbin/httpd -f /srv/rpm-ostree/ostree-httpd.conf -DFORGROUND |
|
| 27 |
+ExecReload=/usr/sbin/httpd -f /srv/rpm-ostree/ostree-httpd.conf -k graceful |
|
| 28 |
+KillSignal=SIGWINCH |
|
| 29 |
+KillMode=mixed |
|
| 30 |
+Restart=always |
|
| 31 |
+ |
|
| 32 |
+[Install] |
|
| 33 |
+WantedBy=multi-user.target |
|
| 34 |
+``` |
|
| 35 |
+* systemctl daemon-reload |
|
| 36 |
+* systemctl restart httpd |
|
| 37 |
+ |
|
| 38 |
+## Error composing when photon-iso repo is selected |
|
| 39 |
+If you are doing the trick explained in 9.3 to speed up composing by getting the RPMS from cdrom instead of the online repo, you may encounter an **error: cache too old:**. We are investigating - it could be an rpm-ostree bug or some incompatibility between the caching in tdnf vs. libhif used by ostree, but meanwhile just leave **"repos": ["photon"],** in photon-base.json. |
|
| 40 |
+ |
|
| 41 |
+## Package differences between RPM-OSTree "minimal" and minimal installation profile |
|
| 42 |
+This is not an actual issue, I'm only mentioning because of naming - people may expect that installing an RPM-OSTree host using the **photon/1.0/x86_64/minimal** reftag will create an exact equivalent, albeit read-only replica of the Photon minimal, when in fact you get fewer packages. That is because we were constrained by size of the starter ostree repo included on the cdrom, needed in order to install fast the server and the default host, yet still small enough for the ISO installer to run in 384 MB RAM in Fusion and Workstation, 512 MB in ESX. |
|
| 43 |
+ |
|
| 44 |
+That's easy to overcome - just add the wanted package names in the photon-base.json and re-compose the tree. |
|
| 45 |
+ |
|
| 46 |
+ |
|
| 47 |
+ |
|
| 48 |
+## Manual pages not included for installed packages |
|
| 49 |
+The packages in photon-base.json don't have their manual pages installed. This is for the same reason - keep the cdrom included ostree repo size small. If the manual pages are desired, just change to true the **documentation** setting in photon-base.json and re-compose. |
|
| 50 |
+ |
|
| 51 |
+ |
| 0 | 52 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,87 @@ |
| 0 |
+# Install or rebase to Photon OS 3.0 |
|
| 1 |
+ |
|
| 2 |
+Photon OS 3.0 provides full RPM-OSTree functionality, it lets the user drive it, rather than provide a pre-defined solution as part of the installation. |
|
| 3 |
+ |
|
| 4 |
+The number of packages included in the RPMS repo in Photon OS 3.0 increased significantly, compared to 1.0. To keep the ISO at reasonable size, Photon OS 2.0 no longer includes the compressed ostree.repo file, that helped optimize both the server and host install in 1.0 or 1.0 Rev2. That decision affected the OSTree features we ship out of the box. Customer could achieve the same results by several additional simple steps, that will be explained in this chapter. In addition, there is a new way to create a host raw image at server. |
|
| 5 |
+ |
|
| 6 |
+## Composing your own RPM-OSTree Server |
|
| 7 |
+ |
|
| 8 |
+You can compose your own RPM-OSTRee server in the following two ways: |
|
| 9 |
+ |
|
| 10 |
+ |
|
| 11 |
+1. By Manually executing the below command: |
|
| 12 |
+ ``` |
|
| 13 |
+ root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2 |
|
| 14 |
+ root [ /srv/rpm-ostree ]# rpm-ostree compose tree --repo=repo photon-base.json |
|
| 15 |
+ ``` |
|
| 16 |
+ |
|
| 17 |
+2. By installing `rpm-ostree-repo package` . This provides the script to create the repo tree which act as server by executing a single command. |
|
| 18 |
+ |
|
| 19 |
+## Installing an RPM-OSTree host |
|
| 20 |
+ |
|
| 21 |
+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. |
|
| 22 |
+Automated host install is supported, as explained in [Chapter 7.2 Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#72-automated-install-of-a-custom-host-via-kickstart). |
|
| 23 |
+ |
|
| 24 |
+## Rebasing a host from Photon 1.0 to 3.0 |
|
| 25 |
+ |
|
| 26 |
+If kickstart sounds too complicated and we still want to go the UI way 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 3.0, you need to rebase it. Notice that I didn't say "upgrade". |
|
| 27 |
+ |
|
| 28 |
+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 3.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 2.0 repo, or because the new config file includes them. |
|
| 29 |
+The OS name is the same (Photon), so the content in /var and /etc will be transferred over. |
|
| 30 |
+ |
|
| 31 |
+1. To install fresh, deploy a Photon 1.0 Rev2 host default, as described in [Chapter 2](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md). Of course, if you already have an existing Photon OS 1.0 host that you want to move to 2.0, skip this step. |
|
| 32 |
+2. Edit /ostree/repo/config and substitute the url, providing the IP address for the Photon OS 2.0 RPM-OSTree server installed above. This was explained in [Chapter 10](Photon-RPM-OSTree-10-Remotes.md#switching-repositories). |
|
| 33 |
+ostree should confirm that is the updated server IP for the "photon" remote. |
|
| 34 |
+``` |
|
| 35 |
+root@ostree-host [ ~ ]# ostree remote show-url photon |
|
| 36 |
+http://10.197.103.175:8000/repo |
|
| 37 |
+``` |
|
| 38 |
+3. Rebase your host to the new 2.0 server and Refspec. |
|
| 39 |
+ |
|
| 40 |
+ ``` |
|
| 41 |
+ root@ostree-host [ ~ ]# ostree remote add photon2 http://10.197.103.204:8000/repo --no-gpg-verify |
|
| 42 |
+ root@ostree-host [ ~ ]# rpm-ostree rebase photon-2:photon/3.0/x86_64/minimal |
|
| 43 |
+ |
|
| 44 |
+ Rebasing to photon-2:photon/3.0/x86_64/minimal |
|
| 45 |
+ â ‰ Receiving objects: 99% (1541/1549) 478.3 kB/s 107.1 MB |
|
| 46 |
+ Receiving objects: 99% (1541/1549) 478.3 kB/s 107.1 MB... done |
|
| 47 |
+ Staging deployment... done |
|
| 48 |
+ Upgraded: |
|
| 49 |
+ docker 18.06.2-3.ph3 -> 18.06.2-4.ph3 |
|
| 50 |
+ gmp 6.1.2-2.ph3 -> 6.1.2-3.ph3 |
|
| 51 |
+ gobject-introspection 1.58.0-2.ph3 -> 1.58.0-3.ph3 |
|
| 52 |
+ gzip 1.9-1.ph3 -> 1.9-2.ph3 |
|
| 53 |
+ linux 4.19.65-3.ph3 -> 4.19.69-1.ph3 |
|
| 54 |
+ mpfr 4.0.1-1.ph3 -> 4.0.1-2.ph3 |
|
| 55 |
+ ostree 2019.2-1.ph3 -> 2019.2-2.ph3 |
|
| 56 |
+ ostree-grub2 2019.2-1.ph3 -> 2019.2-2.ph3 |
|
| 57 |
+ ostree-libs 2019.2-1.ph3 -> 2019.2-2.ph3 |
|
| 58 |
+ zlib 1.2.11-1.ph3 -> 1.2.11-2.ph3 |
|
| 59 |
+ Added: |
|
| 60 |
+ efibootmgr-15-1.ph3.x86_64 |
|
| 61 |
+ efivar-36-1.ph3.x86_64 |
|
| 62 |
+ tar-1.30-3.ph3.x86_64 |
|
| 63 |
+ Run "systemctl reboot" to start a reboot |
|
| 64 |
+ ``` |
|
| 65 |
+1. Check the status |
|
| 66 |
+ |
|
| 67 |
+ ``` |
|
| 68 |
+ root@ostree-host [ ~ ]# rpm-ostree status |
|
| 69 |
+ State: idle |
|
| 70 |
+ AutomaticUpdates: disabled |
|
| 71 |
+ Deployments: |
|
| 72 |
+ * ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 73 |
+ Version: 3.0_minimal.2 (2019-09-18T08:22:15Z) |
|
| 74 |
+ BaseCommit: c8f2b116b067d7695f9033bf2a99505198269354e157c0f2d5b78266cb874239 |
|
| 75 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 76 |
+ |
|
| 77 |
+ ostree://photon:photon/1.0/x86_64/minimal |
|
| 78 |
+ Version: 1.0_minimal.1 (2017-01-11T02:18:42) |
|
| 79 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 80 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 81 |
+ ``` |
|
| 82 |
+ |
|
| 83 |
+You may now reboot to the new Photon OS 3.0 image. |
|
| 84 |
+ |
|
| 85 |
+## Creating a host raw image |
|
| 86 |
+It is now possible to run at server a script that is part of RPM-OStree package, to create a host raw mage. |
|
| 0 | 87 |
\ No newline at end of file |
| 1 | 88 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,73 @@ |
| 0 |
+# Photon RPM OSTree: a simple guide |
|
| 1 |
+ |
|
| 2 |
+- [Introduction](Photon-RPM-OSTree-1-Introduction.md) |
|
| 3 |
+ - [RPM-OSTree Overview](Photon-RPM-OSTree-1-Introduction.md#rpm-ostree-overview) |
|
| 4 |
+ - [Why use RPM-OSTree in Photon?](Photon-RPM-OSTree-1-Introduction.md#why-use-rpm-ostree-in-photon) |
|
| 5 |
+ - [Photon with RPM-OSTree installation profiles](Photon-RPM-OSTree-1-Introduction.md#photon-with-rpm-ostree-installation-profiles) |
|
| 6 |
+ - [Terminology](Photon-RPM-OSTree-1-Introduction.md#terminology) |
|
| 7 |
+ - [Sample code](Photon-RPM-OSTree-1-Introduction.md#sample-code) |
|
| 8 |
+ - [How to read this book](Photon-RPM-OSTree-1-Introduction.md#how-to-read-this-book) |
|
| 9 |
+ - [RPM-OSTree in Photon OS 3.0](Photon-RPM-OSTree-1-Introduction.md#rpm-ostree-in-photon-os-30) |
|
| 10 |
+- [Installing a Photon RPM-OSTree host against default server repository](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md) |
|
| 11 |
+ - [Who is this for?](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#who-is-this-for) |
|
| 12 |
+ - [Installing the ISO, step by step](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#installing-the-iso) |
|
| 13 |
+- [Concepts in action](Photon-RPM-OStree-3-Concepts-in-action.md) |
|
| 14 |
+ - [Querying the deployed filetrees](Photon-RPM-OStree-3-Concepts-in-action.md#querying-the-deployed-filetrees) |
|
| 15 |
+ - [Bootable filetree version](Photon-RPM-OStree-3-Concepts-in-action.md#bootable-filetree-version) |
|
| 16 |
+ - [Commit ID](Photon-RPM-OStree-3-Concepts-in-action.md#commit-id) |
|
| 17 |
+ - [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#osname) |
|
| 18 |
+ - [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#refspec) |
|
| 19 |
+ - [Deployments](Photon-RPM-OStree-3-Concepts-in-action.md#deployments) |
|
| 20 |
+- [Querying for commit, file and package metadata](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md) |
|
| 21 |
+ - [Commit history](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#commit-history) |
|
| 22 |
+ - [Listing file mappings](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-file-mappings) |
|
| 23 |
+ - [Listing configuration changes](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-configuration-changes) |
|
| 24 |
+ - [Listing packages](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-packages) |
|
| 25 |
+ - [Querying for package details](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#querying-for-package-details) |
|
| 26 |
+ - [Why am I unable to install, update or delete packages?](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#why-am-i-unable-to-install-update-or-delete-packages) |
|
| 27 |
+- [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md) |
|
| 28 |
+ - [Upgrade Overview](Photon-RPM-OSTree-5-Host-updating-operations.md#upgrade-overview) |
|
| 29 |
+ - [Incremental upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#incremental-upgrade) |
|
| 30 |
+ - [Listing file differences](Photon-RPM-OSTree-5-Host-updating-operations.md#listing-file-differences) |
|
| 31 |
+ - [Listing package differences](Photon-RPM-OSTree-5-Host-updating-operations.md#listing-package-differences) |
|
| 32 |
+ - [Rollback](Photon-RPM-OSTree-5-Host-updating-operations.md#rollback) |
|
| 33 |
+ - [Installing Packages](Photon-RPM-OSTree-5-Host-updating-operations.md#installing-packages) |
|
| 34 |
+ - [Uninstalling Packages](Photon-RPM-OSTree-5-Host-updating-operations.md#uninstalling-packages) |
|
| 35 |
+ - [Deleting a deployed filetree](Photon-RPM-OSTree-5-Host-updating-operations.md#deleting-a-deployed-filetree) |
|
| 36 |
+ - [Version skipping upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#version-skipping-upgrade) |
|
| 37 |
+ - [Tracking parent commits](Photon-RPM-OSTree-5-Host-updating-operations.md#tracking-parent-commits) |
|
| 38 |
+ - [Resetting a branch to a previous commit](Photon-RPM-OSTree-5-Host-updating-operations.md#resetting-a-branch-to-a-previous-commit) |
|
| 39 |
+- [Installing a Photon RPM-OSTree Package](Photon-RPM-OSTree-6-Installing-a-server.md) |
|
| 40 |
+ - [Composing your first OSTree repo](Photon-RPM-OSTree-6-Installing-a-server.md#composing-your-first-OSTree-repo) |
|
| 41 |
+- [Installing a Photon RPM-OStree host against a custom server repository](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md) |
|
| 42 |
+ - [Manual install of a custom host](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#manual-install-of-a-custom-host) |
|
| 43 |
+ - [Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#automated-install-of-a-custom-host-via-kickstart) |
|
| 44 |
+- [Automatic Updates](RPM-OSTree-AutoUpdate.md) |
|
| 45 |
+ - [Enable Automatic Updates](RPM-OSTree-AutoUpdate.md#enable-automatic-updates) |
|
| 46 |
+- [File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md) |
|
| 47 |
+ - [Starting a fresh OSTree repo](Photon-RPM-OStree-8-File-oriented-server-operations.md#starting-a-fresh-ostree-repo) |
|
| 48 |
+ - [Creating summary metadata](Photon-RPM-OStree-8-File-oriented-server-operations.md#creating-summary-metadata) |
|
| 49 |
+- [Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md) |
|
| 50 |
+ - [JSON configuration file](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#json-configuration-file) |
|
| 51 |
+ - [Package addition, removal, upgrade](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#package-addition-removal-upgrade) |
|
| 52 |
+ - [RPMS repository](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#rpms-repository) |
|
| 53 |
+ - [Composing a tree](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#composing-a-tree) |
|
| 54 |
+ - [Automatic version prefix](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#automatic-version-prefix) |
|
| 55 |
+ - [Installing package updates](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#installing-package-updates) |
|
| 56 |
+ - [Creating server metadata](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#creating-server-metadata) |
|
| 57 |
+ - [Starting a fresh OSTree repo](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#starting-a-fresh-ostree-repo) |
|
| 58 |
+- [Remotes](Photon-RPM-OSTree-10-Remotes.md) |
|
| 59 |
+ - [Listing remotes](Photon-RPM-OSTree-10-Remotes.md#listing-remotes) |
|
| 60 |
+ - [GPG signature verification](Photon-RPM-OSTree-10-Remotes.md#gpg-signature-verification) |
|
| 61 |
+ - [Switching repositories](Photon-RPM-OSTree-10-Remotes.md#switching-repositories) |
|
| 62 |
+ - [Adding and removing remotes](Photon-RPM-OSTree-10-Remotes.md#adding-and-removing-remotes) |
|
| 63 |
+ - [List available branches](Photon-RPM-OSTree-10-Remotes.md#list-available-branches) |
|
| 64 |
+- [Running container applications between bootable images](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md) |
|
| 65 |
+ - [Downloading a docker container appliance](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#downloading-a-docker-container-appliance) |
|
| 66 |
+ - [Rebooting into an existing image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#rebooting-into-an-existing-image) |
|
| 67 |
+ - [Reboot into a newly created image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#reboot-into-a-newly-created-image) |
|
| 68 |
+- [Install or rebase to Photon OS 3.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md) |
|
| 69 |
+ - [Composing your own RPM-OSTree Server](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#composing-your-own-rpm-ostree-server) |
|
| 70 |
+ - [Installing an RPM-OSTree host](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#installing-an-rpm-ostree-host) |
|
| 71 |
+ - [Rebasing a host from Photon 1.0 to 3.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#rebasing-a-host-from-photon-10-to-20) |
|
| 72 |
+ - [Creating a host raw image](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#creating-a-host-raw-image) |
|
| 0 | 73 |
\ No newline at end of file |
| 1 | 74 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,172 @@ |
| 0 |
+# Concepts in Action |
|
| 1 |
+ |
|
| 2 |
+Now that we have a fresh installed host (either as [[default|Photon-RPM-OSTree:-2-Installing-a-host-against-default-server-repository]] or [[custom|Photon-RPM-OSTree:-7-Installing-a-host-against-a-custom-server-repository]]), I can explain better the OStree concepts and see them in action. |
|
| 3 |
+ |
|
| 4 |
+## Querying the deployed filetrees |
|
| 5 |
+ |
|
| 6 |
+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. |
|
| 7 |
+``` |
|
| 8 |
+root@photon-host [ ~ ]# rpm-ostree status |
|
| 9 |
+ * ostree://photon:photon/3.0/x86_64/minimal |
|
| 10 |
+ Version: 3.0_minimal (2019-08-29T11:20:19Z) |
|
| 11 |
+ Commit: a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 12 |
+``` |
|
| 13 |
+## Bootable filetree version |
|
| 14 |
+ |
|
| 15 |
+**3.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 3.0_minimal.1, 3.0_minimal.2, 3.0_minimal.3 and so on. |
|
| 16 |
+ |
|
| 17 |
+## Commit ID |
|
| 18 |
+ |
|
| 19 |
+The ID listed is actually the first 5 bytes (10 hex digits) of the commit hash. If you want to see the verbose mode, use the `-v` option. |
|
| 20 |
+ |
|
| 21 |
+``` |
|
| 22 |
+root@photon-host [ ~ ]# rpm-ostree status -v |
|
| 23 |
+State: idle |
|
| 24 |
+AutomaticUpdates: disabled |
|
| 25 |
+Deployments: |
|
| 26 |
+* ostree://photon:photon/3.0/x86_64/minimal |
|
| 27 |
+ Version: 3.0_minimal (2019-08-29T11:20:19Z) |
|
| 28 |
+ Commit: a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 29 |
+ `- photon (2019-08-29T11:18:53Z) |
|
| 30 |
+ Staged: no |
|
| 31 |
+ StateRoot: photon |
|
| 32 |
+``` |
|
| 33 |
+ |
|
| 34 |
+### RPM OStree Options |
|
| 35 |
+ |
|
| 36 |
+To see the list of options available with the rpm-ostree command, use the -h option. |
|
| 37 |
+ |
|
| 38 |
+``` |
|
| 39 |
+root@photon-host [ ~ ]# rpm-ostree -h |
|
| 40 |
+Usage: |
|
| 41 |
+ rpm-ostree [OPTION?] COMMAND |
|
| 42 |
+ |
|
| 43 |
+Builtin Commands: |
|
| 44 |
+ compose Commands to compose a tree |
|
| 45 |
+ cleanup Clear cached/pending data |
|
| 46 |
+ db Commands to query the RPM database |
|
| 47 |
+ deploy Deploy a specific commit |
|
| 48 |
+ rebase Switch to a different tree |
|
| 49 |
+ rollback Revert to the previously booted tree |
|
| 50 |
+ status Get the version of the booted system |
|
| 51 |
+ upgrade Perform a system upgrade |
|
| 52 |
+ reload Reload configuration |
|
| 53 |
+ usroverlay Apply a transient overlayfs to /usr |
|
| 54 |
+ cancel Cancel an active transaction |
|
| 55 |
+ initramfs Enable or disable local initramfs regeneration |
|
| 56 |
+ install Overlay additional packages |
|
| 57 |
+ uninstall Remove overlayed additional packages |
|
| 58 |
+ override Manage base package overrides |
|
| 59 |
+ reset Remove all mutations |
|
| 60 |
+ refresh-md Generate rpm repo metadata |
|
| 61 |
+ kargs Query or modify kernel arguments |
|
| 62 |
+ |
|
| 63 |
+Help Options: |
|
| 64 |
+ -h, --help Show help options |
|
| 65 |
+ |
|
| 66 |
+Application Options: |
|
| 67 |
+ --version Print version information and exit |
|
| 68 |
+``` |
|
| 69 |
+ |
|
| 70 |
+## OSname |
|
| 71 |
+ |
|
| 72 |
+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. |
|
| 73 |
+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. |
|
| 74 |
+ |
|
| 75 |
+## Refspec |
|
| 76 |
+ |
|
| 77 |
+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/3.0/x86_64/full that will match the Full installation profile (full set of packages installed). |
|
| 78 |
+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. |
|
| 79 |
+ |
|
| 80 |
+``` |
|
| 81 |
+root@photon-host [ ~ ]# cat /ostree/repo/refs/remotes/photon/photon/3.0/x86_64/minimal |
|
| 82 |
+a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 83 |
+``` |
|
| 84 |
+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. |
|
| 85 |
+ |
|
| 86 |
+## Deployments |
|
| 87 |
+ |
|
| 88 |
+We've used so far `rpm-ostree`. The same information can be obtained running an `ostree` command: |
|
| 89 |
+ |
|
| 90 |
+``` |
|
| 91 |
+root@photon-host [ ~ ]# ostree admin status |
|
| 92 |
+* photon a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650.0 |
|
| 93 |
+ Version: 3.0_minimal |
|
| 94 |
+ origin refspec: photon:photon/3.0/x86_64/minimal |
|
| 95 |
+``` |
|
| 96 |
+ |
|
| 97 |
+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: |
|
| 98 |
+ |
|
| 99 |
+``` |
|
| 100 |
+root@photon-host [ ~ ]# cat /ostree/repo/refs/heads/ostree/0/1/0 |
|
| 101 |
+a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650 |
|
| 102 |
+``` |
|
| 103 |
+This also where this command that lists the references (local heads and remotes) takes its data from: |
|
| 104 |
+ |
|
| 105 |
+``` |
|
| 106 |
+root@photon-host [ ~ ]# ostree refs |
|
| 107 |
+ostree/0/1/0 |
|
| 108 |
+photon:photon/3.0/x86_64/minimal |
|
| 109 |
+``` |
|
| 110 |
+Based on that, it could find the root of the deployment that it boots from. The actual filetree is deployed right here: |
|
| 111 |
+ |
|
| 112 |
+``` |
|
| 113 |
+root@photon-host [ ~ ]# ls -l /ostree/deploy/photon/deploy/a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84f20833650.0 |
|
| 114 |
+total 36 |
|
| 115 |
+lrwxrwxrwx 2 root root 7 Sep 4 04:58 bin -> usr/bin |
|
| 116 |
+drwxr-xr-x 2 root root 4096 Jan 1 1970 boot |
|
| 117 |
+drwxr-xr-x 2 root root 4096 Jan 1 1970 dev |
|
| 118 |
+drwxr-xr-x 34 root root 4096 Sep 4 05:00 etc |
|
| 119 |
+lrwxrwxrwx 2 root root 8 Sep 4 04:58 home -> var/home |
|
| 120 |
+lrwxrwxrwx 3 root root 7 Sep 4 04:58 lib -> usr/lib |
|
| 121 |
+lrwxrwxrwx 3 root root 7 Sep 4 04:58 lib64 -> usr/lib |
|
| 122 |
+lrwxrwxrwx 2 root root 9 Sep 4 04:58 media -> run/media |
|
| 123 |
+lrwxrwxrwx 2 root root 7 Sep 4 04:58 mnt -> var/mnt |
|
| 124 |
+lrwxrwxrwx 2 root root 7 Sep 4 04:58 opt -> var/opt |
|
| 125 |
+lrwxrwxrwx 2 root root 14 Sep 4 04:58 ostree -> sysroot/ostree |
|
| 126 |
+drwxr-xr-x 2 root root 4096 Jan 1 1970 proc |
|
| 127 |
+lrwxrwxrwx 2 root root 12 Sep 4 04:58 root -> var/roothome |
|
| 128 |
+drwxr-xr-x 2 root root 4096 Jan 1 1970 run |
|
| 129 |
+lrwxrwxrwx 2 root root 8 Sep 4 04:58 sbin -> usr/sbin |
|
| 130 |
+lrwxrwxrwx 2 root root 7 Sep 4 04:58 srv -> var/srv |
|
| 131 |
+drwxr-xr-x 2 root root 4096 Jan 1 1970 sys |
|
| 132 |
+drwxr-xr-x 2 root root 4096 Jan 1 1970 sysroot |
|
| 133 |
+lrwxrwxrwx 2 root root 11 Sep 4 04:58 tmp -> sysroot/tmp |
|
| 134 |
+drwxr-xr-x 10 root root 4096 Jan 1 1970 usr |
|
| 135 |
+drwxr-xr-x 8 root root 4096 Sep 4 04:59 var |
|
| 136 |
+``` |
|
| 137 |
+ |
|
| 138 |
+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: |
|
| 139 |
+ |
|
| 140 |
+``` |
|
| 141 |
+root@photon-host [ ~ ]# cat /ostree/deploy/photon/deploy/a31a843985e314a9e70bcf09afe8d59f7351817d9fb743c2b6dab84 |
|
| 142 |
+f20833650.0.origin |
|
| 143 |
+[origin] |
|
| 144 |
+refspec=photon:photon/3.0/x86_64/minimal |
|
| 145 |
+``` |
|
| 146 |
+ |
|
| 147 |
+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. |
|
| 148 |
+ |
|
| 149 |
+The **photon** directory in the path is the actual OSname. Multiple deployments of same OS will share a writable /var folder. |
|
| 150 |
+ |
|
| 151 |
+``` |
|
| 152 |
+root@photon-host [ ~ ]# ls -l /ostree/deploy/photon/var/ |
|
| 153 |
+total 52 |
|
| 154 |
+drwxr-xr-x 4 root root 4096 Sep 4 05:00 cache |
|
| 155 |
+drwxr-xr-x 2 root root 4096 Sep 4 05:00 home |
|
| 156 |
+drwxr-xr-x 14 root root 4096 Sep 4 05:00 lib |
|
| 157 |
+drwxr-xr-x 2 root root 4096 Sep 4 05:00 local |
|
| 158 |
+lrwxrwxrwx 1 root root 11 Sep 4 04:59 lock -> ../run/lock |
|
| 159 |
+drwxr-xr-x 4 root root 4096 Sep 4 05:00 log |
|
| 160 |
+drwxr-xr-x 2 root root 4096 Sep 4 05:00 mail |
|
| 161 |
+drwxr-xr-x 2 root root 4096 Sep 4 05:00 mnt |
|
| 162 |
+drwxr-xr-x 4 root root 4096 Sep 4 05:00 opt |
|
| 163 |
+drwx------ 3 root root 4096 Sep 4 05:25 roothome |
|
| 164 |
+lrwxrwxrwx 1 root root 6 Sep 4 04:59 run -> ../run |
|
| 165 |
+drwxr-xr-x 2 root root 4096 Sep 4 05:00 spool |
|
| 166 |
+drwxr-xr-x 2 root root 4096 Sep 4 05:00 srv |
|
| 167 |
+drwxrwxrwt 5 root root 4096 Sep 4 05:34 tmp |
|
| 168 |
+drwxr-xr-x 11 root root 4096 Sep 4 05:00 usrlocal |
|
| 169 |
+``` |
|
| 170 |
+ |
|
| 171 |
+ |
| 0 | 172 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,33 @@ |
| 0 |
+# File Oriented Server Operations |
|
| 1 |
+ |
|
| 2 |
+In this section, we will checkout a filetree into a writable directory structure on disk, make several file changes and commit the changes back into the repository. Then we will download this commit and apply at the host. As you may have guessed, this chapter is mostly about OSTree - the base technology. I've not mentioned anything about packages, although it is quite possible to install packages (afler all, packages are made of files, right?) and commit without the help of rpm-ostree, but it's too much of a headache and not worth the effort, since rpm-ostree does it simpler and better. |
|
| 3 |
+ |
|
| 4 |
+When would you want to do that? When you want for all your hosts to get an application or configuration customization that is not encapsulated as part of a package upgrade. |
|
| 5 |
+ |
|
| 6 |
+## Starting a fresh OSTree repo |
|
| 7 |
+ |
|
| 8 |
+If you want to start fresh with your own branch and/or versioning scheme, you can delete the OSTree repo created during the Photon 3.0 RPM-OSTree server install and re-create it empty. |
|
| 9 |
+ |
|
| 10 |
+``` |
|
| 11 |
+root [ /srv/rpm-ostree ]# rm -rf repo/* |
|
| 12 |
+ |
|
| 13 |
+root [ /srv/rpm-ostree ]# ostree --repo=repo init --mode=archive-z2 |
|
| 14 |
+ |
|
| 15 |
+root [ /srv/rpm-ostree ]# ls repo |
|
| 16 |
+config objects refs state tmp uncompressed-objects-cache |
|
| 17 |
+ |
|
| 18 |
+root [ /srv/rpm-ostree ]# cat repo/config |
|
| 19 |
+[core] |
|
| 20 |
+repo_version=1 |
|
| 21 |
+mode=archive-z2 |
|
| 22 |
+``` |
|
| 23 |
+ |
|
| 24 |
+## Creating summary metadata |
|
| 25 |
+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: |
|
| 26 |
+ |
|
| 27 |
+``` |
|
| 28 |
+root [ /srv/rpm-ostree ]# ostree summary -u "This is BigData's OSTree server, it has three branches" |
|
| 29 |
+``` |
|
| 30 |
+ |
|
| 31 |
+We will find out later how the [hosts query for branches list](Photon-RPM-OSTree-10-Remotes.md#list-available-branches). |
|
| 32 |
+ |
| 0 | 33 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,50 @@ |
| 0 |
+# Automatic Updates |
|
| 1 |
+ |
|
| 2 |
+Automatic updates are disabled by default. |
|
| 3 |
+ |
|
| 4 |
+To verify this, run the status command. |
|
| 5 |
+ |
|
| 6 |
+``` |
|
| 7 |
+root@photon-host-def [ ~ ]# rpm-ostree status |
|
| 8 |
+State: idle |
|
| 9 |
+AutomaticUpdates: disabled |
|
| 10 |
+Deployments: |
|
| 11 |
+* ostree://photon-1:photon/3.0/x86_64/minimal |
|
| 12 |
+ Version: 3.0_minimal.1 (2019-09-16T09:51:33Z) |
|
| 13 |
+ BaseCommit: 28dc49ecb4604c0bc349e4445adc659491a1874c01198e6253a261f4d59708b7 |
|
| 14 |
+ LayeredPackages: createrepo_c rpm wget |
|
| 15 |
+ |
|
| 16 |
+``` |
|
| 17 |
+ |
|
| 18 |
+## Enable Automatic Updates |
|
| 19 |
+ |
|
| 20 |
+1. To enable automatic background updates, edit the `/etc/rpm-ostreed.conf`, and include the below lines in the `Daemon` section: |
|
| 21 |
+ |
|
| 22 |
+ ``` |
|
| 23 |
+ [Daemon] |
|
| 24 |
+ AutomaticUpdatePolicy=stage |
|
| 25 |
+ #IdleExitTimeout=60 |
|
| 26 |
+ ``` |
|
| 27 |
+ |
|
| 28 |
+1. Run the following commands: |
|
| 29 |
+ |
|
| 30 |
+ ``` |
|
| 31 |
+ $ systemctl enable rpm-ostree-automatic.timer |
|
| 32 |
+ $ systemctl start rpm-ostree-automatic.timer |
|
| 33 |
+ |
|
| 34 |
+ $ systemctl restart rpm-ostree-automatic |
|
| 35 |
+ ``` |
|
| 36 |
+ |
|
| 37 |
+1. Verify that the automatic update feature has been enabled: |
|
| 38 |
+ |
|
| 39 |
+ ``` |
|
| 40 |
+ $ rpm-ostree status -v |
|
| 41 |
+ State: idle |
|
| 42 |
+ |
|
| 43 |
+ AutomaticUpdates: stage; rpm-ostreed-automatic.timer: last run 16min ago |
|
| 44 |
+ ``` |
|
| 45 |
+ |
|
| 46 |
+1. On the server machine, perform another commit on the base tree. |
|
| 47 |
+ |
|
| 48 |
+Automatic updates are now enabled and will automatically update the host system. |
|
| 49 |
+ |
| ... | ... |
@@ -64,4 +64,76 @@ |
| 64 | 64 |
- [Default Firewall Settings](default-firewall-settings.md) |
| 65 | 65 |
- [Default Permissions and umask](default-permissions-and-umask.md) |
| 66 | 66 |
- [Disabling TLS 1.0 to Improve Transport Layer Security](disabling-tls-1.0.md) |
| 67 |
+- [Photon RPM OSTree] (Photon-RPM-OSTree-a-simple-guide.md) |
|
| 68 |
+ - [Introduction](Photon-RPM-OSTree-1-Introduction.md) |
|
| 69 |
+ - [RPM-OSTree Overview](Photon-RPM-OSTree-1-Introduction.md#rpm-ostree-overview) |
|
| 70 |
+ - [Why use RPM-OSTree in Photon?](Photon-RPM-OSTree-1-Introduction.md#why-use-rpm-ostree-in-photon) |
|
| 71 |
+ - [Photon with RPM-OSTree installation profiles](Photon-RPM-OSTree-1-Introduction.md#photon-with-rpm-ostree-installation-profiles) |
|
| 72 |
+ - [Terminology](Photon-RPM-OSTree-1-Introduction.md#terminology) |
|
| 73 |
+ - [Sample code](Photon-RPM-OSTree-1-Introduction.md#sample-code) |
|
| 74 |
+ - [How to read this book](Photon-RPM-OSTree-1-Introduction.md#how-to-read-this-book) |
|
| 75 |
+ - [RPM-OSTree in Photon OS 3.0](Photon-RPM-OSTree-1-Introduction.md#rpm-ostree-in-photon-os-30) |
|
| 76 |
+ - [Installing a Photon RPM-OSTree host against default server repository](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md) |
|
| 77 |
+ - [Who is this for?](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#who-is-this-for) |
|
| 78 |
+ - [Installing the ISO, step by step](Photon-RPM-OSTree-2-Installing-a-host-against-default-server-repository.md#installing-the-iso) |
|
| 79 |
+ - [Concepts in action](Photon-RPM-OStree-3-Concepts-in-action.md) |
|
| 80 |
+ - [Querying the deployed filetrees](Photon-RPM-OStree-3-Concepts-in-action.md#querying-the-deployed-filetrees) |
|
| 81 |
+ - [Bootable filetree version](Photon-RPM-OStree-3-Concepts-in-action.md#bootable-filetree-version) |
|
| 82 |
+ - [Commit ID](Photon-RPM-OStree-3-Concepts-in-action.md#commit-id) |
|
| 83 |
+ - [OSname](Photon-RPM-OStree-3-Concepts-in-action.md#osname) |
|
| 84 |
+ - [Refspec](Photon-RPM-OStree-3-Concepts-in-action.md#refspec) |
|
| 85 |
+ - [Deployments](Photon-RPM-OStree-3-Concepts-in-action.md#deployments) |
|
| 86 |
+ - [Querying for commit, file and package metadata](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md) |
|
| 87 |
+ - [Commit history](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#commit-history) |
|
| 88 |
+ - [Listing file mappings](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-file-mappings) |
|
| 89 |
+ - [Listing configuration changes](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-configuration-changes) |
|
| 90 |
+ - [Listing packages](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#listing-packages) |
|
| 91 |
+ - [Querying for package details](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#querying-for-package-details) |
|
| 92 |
+ - [Why am I unable to install, update or delete packages?](Photon-RPM-OSTree-4-Querying-for-commit-file-and-package-metadata.md#why-am-i-unable-to-install-update-or-delete-packages) |
|
| 93 |
+ - [Host updating operations](Photon-RPM-OSTree-5-Host-updating-operations.md) |
|
| 94 |
+ - [Upgrade overview](Photon-RPM-OSTree-5-Host-updating-operations.md#upgrade-overview) |
|
| 95 |
+ - [Incremental upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#incremental-upgrade) |
|
| 96 |
+ - [Listing file differences](Photon-RPM-OSTree-5-Host-updating-operations.md#listing-file-differences) |
|
| 97 |
+ - [Listing package differences](Photon-RPM-OSTree-5-Host-updating-operations.md#listing-package-differences) |
|
| 98 |
+ - [Rollback](Photon-RPM-OSTree-5-Host-updating-operations.md#rollback) |
|
| 99 |
+ - [Installing Packages](Photon-RPM-OSTree-5-Host-updating-operations.md#installing-packages) |
|
| 100 |
+ - [Uninstalling Packages](Photon-RPM-OSTree-5-Host-updating-operations.md#uninstalling-packages) |
|
| 101 |
+ - [Deleting a deployed filetree](Photon-RPM-OSTree-5-Host-updating-operations.md#deleting-a-deployed-filetree) |
|
| 102 |
+ - [Version skipping upgrade](Photon-RPM-OSTree-5-Host-updating-operations.md#version-skipping-upgrade) |
|
| 103 |
+ - [Tracking parent commits](Photon-RPM-OSTree-5-Host-updating-operations.md#tracking-parent-commits) |
|
| 104 |
+ - [Resetting a branch to a previous commit](Photon-RPM-OSTree-5-Host-updating-operations.md#resetting-a-branch-to-a-previous-commit) |
|
| 105 |
+ - [Installing a Photon RPM-OSTree Package](Photon-RPM-OSTree-6-Installing-a-server.md) |
|
| 106 |
+ - [Composing your first OSTree repo](Photon-RPM-OSTree-6-Installing-a-server.md#composing-your-first-OSTree-repo) |
|
| 107 |
+ - [Installing a Photon RPM-OStree host against a custom server repository](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md) |
|
| 108 |
+ - [Manual install of a custom host](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#manual-install-of-a-custom-host) |
|
| 109 |
+ - [Automated install of a custom host via kickstart](Photon-RPM-OSTree-7-Installing-a-host-against-a-custom-server-repository.md#automated-install-of-a-custom-host-via-kickstart) |
|
| 110 |
+ - [Automatic Updates](RPM-OSTree-AutoUpdate.md) |
|
| 111 |
+ - [Enable Automatic Updates](RPM-OSTree-AutoUpdate.md#enable-automatic-updates) |
|
| 112 |
+ - [File oriented server operations](Photon-RPM-OStree-8-File-oriented-server-operations.md) |
|
| 113 |
+ - [Starting a fresh OSTree repo](Photon-RPM-OStree-8-File-oriented-server-operations.md#starting-a-fresh-ostree-repo) |
|
| 114 |
+ - [Creating summary metadata](Photon-RPM-OStree-8-File-oriented-server-operations.md#creating-summary-metadata) |
|
| 115 |
+ - [Package oriented server operations](Photon-RPM-OSTree-9-Package-oriented-server-operations.md) |
|
| 116 |
+ - [JSON configuration file](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#json-configuration-file) |
|
| 117 |
+ - [Package addition, removal, upgrade](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#package-addition-removal-upgrade) |
|
| 118 |
+ - [RPMS repository](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#rpms-repository) |
|
| 119 |
+ - [Composing a tree](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#composing-a-tree) |
|
| 120 |
+ - [Automatic version prefix](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#automatic-version-prefix) |
|
| 121 |
+ - [Installing package updates](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#installing-package-updates) |
|
| 122 |
+ - [Creating server metadata](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#creating-server-metadata) |
|
| 123 |
+ - [Starting a fresh OSTree repo](Photon-RPM-OSTree-9-Package-oriented-server-operations.md#starting-a-fresh-ostree-repo) |
|
| 124 |
+ - [Remotes](Photon-RPM-OSTree-10-Remotes.md) |
|
| 125 |
+ - [Listing remotes](Photon-RPM-OSTree-10-Remotes.md#listing-remotes) |
|
| 126 |
+ - [GPG signature verification](Photon-RPM-OSTree-10-Remotes.md#gpg-signature-verification) |
|
| 127 |
+ - [Switching repositories](Photon-RPM-OSTree-10-Remotes.md#switching-repositories) |
|
| 128 |
+ - [Adding and removing remotes](Photon-RPM-OSTree-10-Remotes.md#adding-and-removing-remotes) |
|
| 129 |
+ - [List available branches](Photon-RPM-OSTree-10-Remotes.md#list-available-branches) |
|
| 130 |
+ - [Running container applications between bootable images](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md) |
|
| 131 |
+ - [Downloading a docker container appliance](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#downloading-a-docker-container-appliance) |
|
| 132 |
+ - [Rebooting into an existing image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#rebooting-into-an-existing-image) |
|
| 133 |
+ - [Reboot into a newly created image](Photon-RPM-OSTree-11-Running-container-applications-between-bootable-images.md#reboot-into-a-newly-created-image) |
|
| 134 |
+ - [Install or rebase to Photon OS 3.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md) |
|
| 135 |
+ - [Composing your own RPM-OSTree Server](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#composing-your-own-rpm-ostree-server) |
|
| 136 |
+ - [Installing an RPM-OSTree host](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#installing-an-rpm-ostree-host) |
|
| 137 |
+ - [Rebasing a host from Photon 1.0 to 3.0](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#rebasing-a-host-from-photon-10-to-20) |
|
| 138 |
+ - [Creating a host raw image](Photon-RPM-OSTree-Install-or-rebase-to-Photon-OS-2.0.md#creating-a-host-raw-image) |
|
| 67 | 139 |
|
| ... | ... |
@@ -20,7 +20,7 @@ The default iptables on the full version have the following settings: |
| 20 | 20 |
|
| 21 | 21 |
For more information on how to change the settings, see the man page for iptables. |
| 22 | 22 |
|
| 23 |
-Although the default iptables policy accepts SSH connections, the `sshd` configuration file on the full version of Photon OS is set to reject SSH connections. See [Permitting Root Login with SSH](#permitting-root-login-with-ssh). |
|
| 23 |
+Although the default iptables policy accepts SSH connections, the `sshd` configuration file on the full version of Photon OS is set to reject SSH connections. See [Permitting Root Login with SSH](../photon_troubleshoot/permitting-root-login-with-ssh.md). |
|
| 24 | 24 |
|
| 25 | 25 |
If you are unable to ping a Photon OS machine, check the firewall rules. To verify if the rules allow connectivity for the port and protocol, change the `iptables` commands by using `lsof` commands to see the processes listening on ports: |
| 26 | 26 |
|