diff options
| author | Sona Sarmadi <sona.sarmadi@enea.com> | 2019-01-14 12:32:51 +0100 |
|---|---|---|
| committer | Adrian Dudau <Adrian.Dudau@enea.com> | 2019-02-01 10:47:37 +0100 |
| commit | 15a0b108197ac64d711b166f8c0c25a271c96e71 (patch) | |
| tree | 585fc176a11d2214ec7db27e7510fec871e00236 | |
| parent | 374ddbbb8feb2daa7000cccd18ab3dcf0fb46d21 (diff) | |
| download | nfv-access-documentation-15a0b108197ac64d711b166f8c0c25a271c96e71.tar.gz | |
reference guide: add ostree section
Change-Id: Idde94a6bd36da0a17c501b7095f96945c8b48560
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
| -rw-r--r-- | doc/book-enea-nfv-access-reference-guide-intel/doc/book.xml | 2 | ||||
| -rwxr-xr-x | doc/book-enea-nfv-access-reference-guide-intel/doc/ostree.xml | 208 |
2 files changed, 210 insertions, 0 deletions
diff --git a/doc/book-enea-nfv-access-reference-guide-intel/doc/book.xml b/doc/book-enea-nfv-access-reference-guide-intel/doc/book.xml index e2819e1..ad26c6e 100644 --- a/doc/book-enea-nfv-access-reference-guide-intel/doc/book.xml +++ b/doc/book-enea-nfv-access-reference-guide-intel/doc/book.xml | |||
| @@ -21,6 +21,8 @@ | |||
| 21 | xmlns:xi="http://www.w3.org/2001/XInclude" /> | 21 | xmlns:xi="http://www.w3.org/2001/XInclude" /> |
| 22 | <xi:include href="dpdk.xml" | 22 | <xi:include href="dpdk.xml" |
| 23 | xmlns:xi="http://www.w3.org/2001/XInclude" /> | 23 | xmlns:xi="http://www.w3.org/2001/XInclude" /> |
| 24 | <xi:include href="ostree.xml" | ||
| 25 | xmlns:xi="http://www.w3.org/2001/XInclude" /> | ||
| 24 | <xi:include href="benchmarks.xml" | 26 | <xi:include href="benchmarks.xml" |
| 25 | xmlns:xi="http://www.w3.org/2001/XInclude" /> | 27 | xmlns:xi="http://www.w3.org/2001/XInclude" /> |
| 26 | <xi:include href="using_nfv_access_sdks.xml" | 28 | <xi:include href="using_nfv_access_sdks.xml" |
diff --git a/doc/book-enea-nfv-access-reference-guide-intel/doc/ostree.xml b/doc/book-enea-nfv-access-reference-guide-intel/doc/ostree.xml new file mode 100755 index 0000000..05d54e6 --- /dev/null +++ b/doc/book-enea-nfv-access-reference-guide-intel/doc/ostree.xml | |||
| @@ -0,0 +1,208 @@ | |||
| 1 | <?xml version="1.0" encoding="ISO-8859-1"?> | ||
| 2 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | ||
| 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | ||
| 4 | <chapter id="ostree"> | ||
| 5 | <title>OSTree</title> | ||
| 6 | |||
| 7 | <para>OSTree is an upgrade system for Linux-based operating systems that | ||
| 8 | performs atomic upgrades of complete filesystem trees. The underlying | ||
| 9 | architecture might be summarized as "git for operating system binaries". It | ||
| 10 | operates in userspace, and will work on top of any Linux filesystem. At its | ||
| 11 | core is a git-like content-addressed object store with branches (or "refs") | ||
| 12 | to track meaningful filesystem trees within the store. Similarly, one can | ||
| 13 | check out or commit to these branches.</para> | ||
| 14 | |||
| 15 | <para>For in-depth information on how OSTree works, consult the OSTree User | ||
| 16 | Manual, <ulink | ||
| 17 | url="https://ostree.readthedocs.io/en/latest/manual/introduction">ostree.readthedocs</ulink>. | ||
| 18 | The set of OSTree commands can be found at the following OSTree <ulink | ||
| 19 | url="https://www.mankier.com/package/ostree">man page.</ulink></para> | ||
| 20 | |||
| 21 | <section id="installing_system_upgrades"> | ||
| 22 | <title>Installing system upgrades</title> | ||
| 23 | |||
| 24 | <para>OSTree works by downloading system updates from remote servers, | ||
| 25 | which have to be set up before installing any system upgrades. There are | ||
| 26 | multiple ways through which system upgrades can be installed. Similarly to | ||
| 27 | git, one of the methods consists of pulling the branch related information | ||
| 28 | from the repository and checking out a commit ID. Another method, consists | ||
| 29 | of using a repository and a branch as the origin for future updates and | ||
| 30 | periodically pull the latest updates. Both of these techniques will be | ||
| 31 | detailed in the sections below.</para> | ||
| 32 | |||
| 33 | <section id="installing_by_commit_id"> | ||
| 34 | <title>Installing a system upgrade by using a commit ID</title> | ||
| 35 | |||
| 36 | <para>To upgrade a system by using a commit ID, a remote repository has | ||
| 37 | to be added on the board running NFV Access:</para> | ||
| 38 | |||
| 39 | <para><emphasis role="bold">How to upgrade a system by using a commit | ||
| 40 | ID</emphasis></para> | ||
| 41 | |||
| 42 | <orderedlist> | ||
| 43 | <listitem> | ||
| 44 | <para>Add a remote repository on the board running NFV | ||
| 45 | Access:</para> | ||
| 46 | |||
| 47 | <programlisting>ostree remote add nfv-access-remote https://<ostree-repository>:<port></programlisting> | ||
| 48 | </listitem> | ||
| 49 | |||
| 50 | <listitem> | ||
| 51 | <para>Pull the branch related information from the | ||
| 52 | repository:</para> | ||
| 53 | |||
| 54 | <programlisting>ostree pull nfv-access-remote <branch-name></programlisting> | ||
| 55 | </listitem> | ||
| 56 | |||
| 57 | <listitem> | ||
| 58 | |||
| 59 | <para>Inspect the branch commits:</para> | ||
| 60 | |||
| 61 | <programlisting>ostree log <branch-name></programlisting> | ||
| 62 | |||
| 63 | Inspecting the branch commits, outputs data in the following format: | ||
| 64 | |||
| 65 | <programlisting>commit <COMMIT-ID> | ||
| 66 | ContentChecksum: <CHECKSUM> | ||
| 67 | Date: <COMMIT-DATE> | ||
| 68 | |||
| 69 | <COMMIT-DESCRIPTION> | ||
| 70 | |||
| 71 | Example: | ||
| 72 | ostree log nfv-access-latest | ||
| 73 | commit 83e66d4376b415fca6a243ac4cf7704b8fceb0220621ff5aa59b4ee0715b9567 | ||
| 74 | ContentChecksum: dc5e7d46151acccae052751730e22062bd2d9ca6fa9990a622000e909e879467 | ||
| 75 | Date: 2018-12-20 16:04:22 +0000 | ||
| 76 | |||
| 77 | Commit example number 2 | ||
| 78 | |||
| 79 | commit 6e03344470b35385e584a79cd395ca90d134851b4cc512edeea5380f3cccc812 | ||
| 80 | ContentChecksum: 1d6a362491ecb25d5f56b9d6300463c0263bb68c8b50a368b1250c061225ba60 | ||
| 81 | Date: 2018-12-20 15:16:09 +0000 | ||
| 82 | |||
| 83 | Commit example number 1</programlisting> | ||
| 84 | |||
| 85 | |||
| 86 | </listitem> | ||
| 87 | |||
| 88 | <listitem> | ||
| 89 | <para>Specify the commit ID you wish to deploy</para> | ||
| 90 | |||
| 91 | <programlisting>ostree admin deploy <COMMIT-ID></programlisting> | ||
| 92 | </listitem> | ||
| 93 | </orderedlist> | ||
| 94 | |||
| 95 | <note> | ||
| 96 | <para>Running <literal>ostree admin deploy</literal> will upgrade the | ||
| 97 | GRUB configuration to set the newly deployed commit as the default NFV | ||
| 98 | Access version.</para> | ||
| 99 | </note> | ||
| 100 | </section> | ||
| 101 | |||
| 102 | <section id="installing_by_update_channel"> | ||
| 103 | <title>Installing a system upgrade by using an update channel</title> | ||
| 104 | |||
| 105 | <para>To upgrade a system by using an update channel, a remote | ||
| 106 | repository has to be configured as the origin for future updates:</para> | ||
| 107 | |||
| 108 | <programlisting>ostree admin set-origin nfv-access-remote \ | ||
| 109 | https://<ostree-repository>:<port> <branch-name></programlisting> | ||
| 110 | |||
| 111 | <para>Each time the remote branch is updated, the changes can be | ||
| 112 | deployed on a board with the <literal>ostree admin upgrade</literal> | ||
| 113 | command.</para> | ||
| 114 | </section> | ||
| 115 | |||
| 116 | <section id="removing_invalid_sys_upgrade"> | ||
| 117 | <title>How to correctly remove an invalid ostree version</title> | ||
| 118 | |||
| 119 | <orderedlist> | ||
| 120 | <listitem> | ||
| 121 | <para> Identify which commit is invalid by running <literal>ostree | ||
| 122 | admin status,</literal> which lists current commits. Example output: | ||
| 123 | </para> | ||
| 124 | |||
| 125 | <programlisting>ostree admin status | ||
| 126 | poky 210f327ab52730c33910f9a40108333b353b36adfadf44a7d7579d3f57d0.0 (pending) | ||
| 127 | origin refspec: 210f327ab52730c33910f9a40108333b353b36adfadf44a7d7579d3f57d0 | ||
| 128 | * poky 884256bab349d7d4e1bfd603d70b59cae9143b4d7e996256246760815c12.0 | ||
| 129 | origin refspec: 884256bab349d7d4e1bfd603d70b59cae9143b4d7e996256246760815c12 | ||
| 130 | poky 8791932934bcfd33e2d3c0c9d2fbd63f90486cd62c5ddae40f8d2b94ba4a.0 (rollback) | ||
| 131 | origin refspec: my-remote:test-branch</programlisting> | ||
| 132 | </listitem> | ||
| 133 | |||
| 134 | <listitem> | ||
| 135 | <para>Undeploy the faulty commit by running <literal>ostree admin | ||
| 136 | undeploy <commit number></literal>, where <literal><commit | ||
| 137 | number></literal>is the index of the commits listed in the | ||
| 138 | <literal>ostree admin status</literal> command.</para> | ||
| 139 | |||
| 140 | <programlisting>ostree undeploy 2</programlisting> | ||
| 141 | </listitem> | ||
| 142 | |||
| 143 | <listitem> | ||
| 144 | <para>Run the <literal>ostree admin status</literal> command to verify | ||
| 145 | the invalid version has been removed:</para> | ||
| 146 | |||
| 147 | <programlisting>ostree admin status | ||
| 148 | poky 210f327ab52730c33910f9a40108333b353b36adfadf44a7d7579d3f57d0.0 (pending) | ||
| 149 | origin refspec: 210f327ab52730c33910f9a40108333b353b36adfadf44a7d7579d3f57d0 | ||
| 150 | * poky 884256bab349d7d4e1bfd603d70b59cae9143b4d7e996256246760815c12.0 | ||
| 151 | origin refspec: 884256bab349d7d4e1bfd603d70b59cae9143b4d7e996256246760815c12</programlisting> | ||
| 152 | </listitem> | ||
| 153 | </orderedlist> | ||
| 154 | </section> | ||
| 155 | </section> | ||
| 156 | |||
| 157 | <section id="change_builtin_kernel_param"> | ||
| 158 | <title>Changing built-in kernel parameters</title> | ||
| 159 | |||
| 160 | <para>Each time OSTree deploys or undeploys a commit, the GRUB | ||
| 161 | configuration file is generated automatically. System administrators can | ||
| 162 | change what kernel parameters are specified in the GRUB configuration | ||
| 163 | file, by editing <literal>/etc/enea-nfv-access/boot/00_default</literal> | ||
| 164 | or creating a file in the same folder, for example | ||
| 165 | <literal>/etc/enea-nfv-access/boot/10_custom</literal>.</para> | ||
| 166 | |||
| 167 | <para>When a GRUB configuration file is created, files in the | ||
| 168 | <literal>/etc/enea-nfv-access/boot/</literal> folder are evaluated in | ||
| 169 | alphanumeric order, making, for example, a file named | ||
| 170 | <literal><literal>10_custom</literal></literal> override settings set in | ||
| 171 | <literal><literal>00_default</literal></literal>.</para> | ||
| 172 | |||
| 173 | <para><emphasis role="bold">There are 3 keywords that can change the way | ||
| 174 | GRUB configurations are created:</emphasis></para> | ||
| 175 | |||
| 176 | <itemizedlist> | ||
| 177 | <listitem> | ||
| 178 | <para><literal>base_folder</literal>: specifies where boot specific | ||
| 179 | files are located, such as kernel binaries, initrd files or GRUB | ||
| 180 | configurations.</para> | ||
| 181 | </listitem> | ||
| 182 | |||
| 183 | <listitem> | ||
| 184 | <para><literal>machine_config</literal>: specifies machine-specific | ||
| 185 | kernel parameters. For example this keyword should specify what serial | ||
| 186 | port is used for kernel boot messages or how to initialize network | ||
| 187 | connections.</para> | ||
| 188 | </listitem> | ||
| 189 | |||
| 190 | <listitem> | ||
| 191 | <para><literal>extra_config</literal>: specifies what other kernel | ||
| 192 | parameters should be added to the command line. This keyword should be | ||
| 193 | followed by kernel parameters that are not specific to the machine | ||
| 194 | (e.g. number of hugepages).</para> | ||
| 195 | </listitem> | ||
| 196 | </itemizedlist> | ||
| 197 | |||
| 198 | <para>A keyword should always be followed by a <literal>space</literal> | ||
| 199 | character and the content that is associated with that keyword: | ||
| 200 | <literal><keyword> <content></literal>.</para> | ||
| 201 | |||
| 202 | <para>If a change has been done in the | ||
| 203 | <literal>/etc/enea-nfv-access/boot</literal> folder, the GRUB | ||
| 204 | configuration can be explicitly regenerated by running <literal> | ||
| 205 | nfv-grub-generator -o /boot/loader/grub.cfg</literal> or waiting until the | ||
| 206 | next OSTree version is deployed.</para> | ||
| 207 | </section> | ||
| 208 | </chapter> | ||
