Browse code

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

archive authored on 2018/12/07 23:30:14
Showing 130 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 
3 3
 Name:           cloud-init
4 4
 Version:        18.3
5
-Release:        1%{?dist}
5
+Release:        2%{?dist}
6 6
 Summary:        Cloud instance init scripts
7 7
 Group:          System Environment/Base
8 8
 License:        GPLv3
... ...
@@ -22,6 +22,7 @@ Patch6:         systemd-service-changes.patch
22 22
 Patch7:         makecheck.patch
23 23
 Patch8:         systemd-resolved-config.patch
24 24
 Patch9:         cloud-init-azureds.patch
25
+Patch10:        ds-identity.patch
25 26
 
26 27
 BuildRequires:  python3
27 28
 BuildRequires:  python3-libs
... ...
@@ -77,6 +78,7 @@ ssh keys and to let the user run various scripts.
77 77
 %patch7 -p1
78 78
 %patch8 -p1
79 79
 %patch9 -p1
80
+%patch10 -p1
80 81
 
81 82
 find systemd -name "cloud*.service*" | xargs sed -i s/StandardOutput=journal+console/StandardOutput=journal/g
82 83
 
... ...
@@ -145,6 +147,8 @@ rm -rf $RPM_BUILD_ROOT
145 145
 
146 146
 
147 147
 %changelog
148
+*   Tue Dec 04 2018 Ajay Kaher <akaher@vmware.com> 18.3-2
149
+-   Fix auto startup at boot time
148 150
 *   Wed Oct 24 2018 Ajay Kaher <akaher@vmware.com> 18.3-1
149 151
 -   Upgraded version to 18.3
150 152
 *   Sun Oct 07 2018 Tapas Kundu <tkundu@vmware.com> 0.7.9-15
151 153
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+diff -rupN cloud-init-18.3/tools/ds-identify cloud-init-18.3_ds-identity-fixed/tools/ds-identify
1
+--- cloud-init-18.3/tools/ds-identify	2018-06-20 00:19:26.000000000 +0000
2
+@@ -85,7 +85,7 @@ _DI_LOGGED=""
3
+ DI_MAIN=${DI_MAIN:-main}
4
+ 
5
+ DI_BLKID_OUTPUT=""
6
+-DI_DEFAULT_POLICY="search,found=all,maybe=all,notfound=${DI_DISABLED}"
7
++DI_DEFAULT_POLICY="search,found=all,maybe=all,notfound=${DI_ENABLED}"
8
+ DI_DEFAULT_POLICY_NO_DMI="search,found=all,maybe=all,notfound=${DI_ENABLED}"
9
+ DI_DMI_CHASSIS_ASSET_TAG=""
10
+ DI_DMI_PRODUCT_NAME=""
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Docbook-xsl-1.79.1
2 2
 Name:		docbook-xsl
3 3
 Version:	1.79.1
4
-Release:	5%{?dist}
4
+Release:	6%{?dist}
5 5
 License:	Apache License
6 6
 URL:		http://www.docbook.org
7 7
 Source0:	http://downloads.sourceforge.net/docbook/%{name}-%{version}.tar.bz2
... ...
@@ -11,16 +11,21 @@ Vendor:		VMware, Inc.
11 11
 Distribution:	Photon
12 12
 Requires:	libxml2
13 13
 BuildRequires:	libxml2
14
+BuildRequires:  zip
14 15
 BuildArch:      noarch
15 16
 
16 17
 %description
17
-The DocBook XML DTD-4.5 package contains document type definitions for 
18
-verification of XML data files against the DocBook rule set. These are 
19
-useful for structuring books and software documentation to a standard 
18
+The DocBook XML DTD-4.5 package contains document type definitions for
19
+verification of XML data files against the DocBook rule set. These are
20
+useful for structuring books and software documentation to a standard
20 21
 allowing you to utilize transformations already written for that standard.
21 22
 %prep
22 23
 %setup -q
24
+
23 25
 %build
26
+zip -d tools/lib/jython.jar Lib/distutils/command/wininst-6.exe
27
+zip -d tools/lib/jython.jar Lib/distutils/command/wininst-7.1.exe
28
+
24 29
 %install
25 30
 install -v -m755 -d %{buildroot}/usr/share/xml/docbook/xsl-stylesheets-1.79.1 &&
26 31
 
... ...
@@ -41,8 +46,8 @@ install -v -m644    RELEASE-NOTES* NEWS* \
41 41
 
42 42
 #There is no source code for make check
43 43
 #%check
44
-#chmod 777 tests -R  
45
-#make %{?_smp_mflags} check 
44
+#chmod 777 tests -R
45
+#make %{?_smp_mflags} check
46 46
 
47 47
 %post
48 48
 if [ ! -d /etc/xml ]; then install -v -m755 -d /etc/xml; fi &&
... ...
@@ -82,7 +87,9 @@ fi
82 82
 %{_docdir}/*
83 83
 
84 84
 %changelog
85
-*	Thu Aug 18 2017 Rongrong Qiu <rqiu@vmware.com> 1.79.1-5
85
+*	Tue Dec 04 2018 Ashwin H<ashwinh@vmware.com> 1.79.1-6
86
+-       Remove windows installers
87
+*	Fri Aug 18 2017 Rongrong Qiu <rqiu@vmware.com> 1.79.1-5
86 88
 -	Update make check for bug 1635477
87 89
 *	Tue Apr 25 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.79.1-4
88 90
 -	Fix arch
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        EdgeX Foundry Go Services
5 5
 Name:           edgex
6 6
 Version:        0.6.0
7
-Release:        1%{?dist}
7
+Release:        2%{?dist}
8 8
 License:        Apache-2.0
9 9
 URL:            https://github.com/edgexfoundry/edgex-go
10 10
 Group:          Applications/System
... ...
@@ -33,7 +33,6 @@ BuildRequires:  make
33 33
 BuildRequires:  systemd-devel
34 34
 BuildRequires:  zeromq-devel
35 35
 Requires:       systemd
36
-Requires:       mongodb
37 36
 Requires:       consul
38 37
 
39 38
 %description
... ...
@@ -93,5 +92,7 @@ install -p -m644 %{SOURCE6} %{buildroot}%{_datadir}/%{name}/scripts/`basename %{
93 93
 %{_var}/log/*
94 94
 
95 95
 %changelog
96
+*   Wed Dec 05 2018 Alexey Makhalov <amakhalov@vmware.com> 0.6.0-2
97
+-   Remove 'Requires: mongodb'. But edgex still depends on mongo.
96 98
 *   Fri Jul 06 2018 Alexey Makhalov <amakhalov@vmware.com> 0.6.0-1
97 99
 -   Initial version
... ...
@@ -1,14 +1,14 @@
1 1
 Summary:        A fast, reliable HA, load balancing, and proxy solution.
2 2
 Name:           haproxy
3
-Version:        1.8.13
4
-Release:        2%{?dist}
3
+Version:        1.8.14
4
+Release:        1%{?dist}
5 5
 License:        GPL
6 6
 URL:            http://www.haproxy.org
7 7
 Group:          Applications/System
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10
-Source0:        http://www.haproxy.org/download/1.6/src/%{name}-%{version}.tar.gz
11
-%define sha1 haproxy=1c8588d63c7592404d0a3ea59aa41c2dccaaa909
10
+Source0:        http://www.haproxy.org/download/1.8/src/%{name}-%{version}.tar.gz
11
+%define sha1 haproxy=589c6f933d73e8d6ba5307c8304cafb80e968481
12 12
 BuildRequires:  openssl-devel
13 13
 BuildRequires:  pcre-devel
14 14
 BuildRequires:  lua-devel
... ...
@@ -58,6 +58,8 @@ install -vDm644 examples/transparent_proxy.cfg  %{buildroot}/%{_sysconfdir}/hapr
58 58
 %{_mandir}/*
59 59
 
60 60
 %changelog
61
+*   Tue Dec 04 2018 Ajay Kaher <akaher@vmware.com> 1.8.14-1
62
+-   Update to version 1.8.14
61 63
 *   Thu Oct 25 2018 Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> 1.8.13-2
62 64
 -   Build with USE_SYSTEMD=1 to fix service startup.
63 65
 *   Wed Sep 12 2018 Anish Swaminathan <anishs@vmware.com> 1.8.13-1
64 66
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+commit 6da1fb3f64d43be37e640efbec60400d1f1ac39e
1
+Author: Young_X <YangX92@hotmail.com>
2
+Date:   Sat Sep 8 14:46:27 2018 +0800
3
+
4
+    avoid potential int32 overflows in multiply_ms()
5
+
6
+diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c
7
+index af6e412..c2d5925 100644
8
+--- a/tools/ppm2tiff.c
9
+@@ -70,15 +70,16 @@ BadPPM(char* file)
10
+ 	exit(-2);
11
+ }
12
+ 
13
++
14
++#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
15
++#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
16
++
17
+ static tmsize_t
18
+ multiply_ms(tmsize_t m1, tmsize_t m2)
19
+ {
20
+-	tmsize_t bytes = m1 * m2;
21
+-
22
+-	if (m1 && bytes / m1 != m2)
23
+-		bytes = 0;
24
+-
25
+-	return bytes;
26
++        if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
27
++            return 0;
28
++        return m1 * m2;
29
+ }
30
+ 
31
+ int
0 32
new file mode 100644
... ...
@@ -0,0 +1,64 @@
0
+commit f1b94e8a3ba49febdd3361c0214a1d1149251577
1
+Author: Young_X <YangX92@hotmail.com>
2
+Date:   Sat Sep 8 14:36:12 2018 +0800
3
+
4
+    only read/write TIFFTAG_GROUP3OPTIONS or TIFFTAG_GROUP4OPTIONS if compression is COMPRESSION_CCITTFAX3 or COMPRESSION_CCITTFAX4
5
+
6
+diff --git a/tools/pal2rgb.c b/tools/pal2rgb.c
7
+index 01fcf94..01d8502 100644
8
+--- a/tools/pal2rgb.c
9
+@@ -402,7 +402,23 @@ cpTags(TIFF* in, TIFF* out)
10
+ {
11
+     struct cpTag *p;
12
+     for (p = tags; p < &tags[NTAGS]; p++)
13
+-	cpTag(in, out, p->tag, p->count, p->type);
14
++    {
15
++        if( p->tag == TIFFTAG_GROUP3OPTIONS )
16
++        {
17
++            uint16 compression;
18
++            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
19
++                    compression != COMPRESSION_CCITTFAX3 )
20
++                continue;
21
++        }
22
++        if( p->tag == TIFFTAG_GROUP4OPTIONS )
23
++        {
24
++            uint16 compression;
25
++            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
26
++                    compression != COMPRESSION_CCITTFAX4 )
27
++                continue;
28
++        }
29
++        cpTag(in, out, p->tag, p->count, p->type);
30
++    }
31
+ }
32
+ #undef NTAGS
33
+ 
34
+diff --git a/tools/tiff2bw.c b/tools/tiff2bw.c
35
+index 05faba8..5bef314 100644
36
+--- a/tools/tiff2bw.c
37
+@@ -450,7 +450,23 @@ cpTags(TIFF* in, TIFF* out)
38
+ {
39
+     struct cpTag *p;
40
+     for (p = tags; p < &tags[NTAGS]; p++)
41
+-	cpTag(in, out, p->tag, p->count, p->type);
42
++    {
43
++        if( p->tag == TIFFTAG_GROUP3OPTIONS )
44
++        {
45
++            uint16 compression;
46
++            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
47
++                    compression != COMPRESSION_CCITTFAX3 )
48
++                continue;
49
++        }
50
++        if( p->tag == TIFFTAG_GROUP4OPTIONS )
51
++        {
52
++            uint16 compression;
53
++            if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
54
++                    compression != COMPRESSION_CCITTFAX4 )
55
++                continue;
56
++        }
57
++        cpTag(in, out, p->tag, p->count, p->type);
58
++    }
59
+ }
60
+ #undef NTAGS
61
+ 
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        TIFF libraries and associated utilities.
2 2
 Name:           libtiff
3 3
 Version:        4.0.9
4
-Release:        4%{?dist}
4
+Release:        5%{?dist}
5 5
 License:        libtiff
6 6
 URL:            http://www.simplesystems.org/libtiff/
7 7
 Group:          System Environment/Libraries
... ...
@@ -17,6 +17,8 @@ Patch4:         libtiff-4.0-9-CVE-2017-11613-1.patch
17 17
 Patch5:         libtiff-4.0-9-CVE-2017-11613-2.patch
18 18
 Patch6:         libtiff-4.0-9-CVE-2018-7456.patch
19 19
 Patch7:         libtiff-4.0.9-CVE-2018-8905.patch
20
+Patch8:         libtiff-4.0.9-CVE-2018-17100.patch
21
+Patch9:         libtiff-4.0.9-CVE-2018-17101.patch
20 22
 BuildRequires:  libjpeg-turbo-devel
21 23
 Requires:       libjpeg-turbo
22 24
 %description
... ...
@@ -39,6 +41,8 @@ It contains the libraries and header files to create applications
39 39
 %patch5 -p1
40 40
 %patch6 -p1
41 41
 %patch7 -p1
42
+%patch8 -p1
43
+%patch9 -p1
42 44
 %build
43 45
 %configure \
44 46
     --disable-static
... ...
@@ -72,6 +76,8 @@ make %{?_smp_mflags} -k check
72 72
 %{_datadir}/man/man3/*
73 73
 
74 74
 %changelog
75
+*   Sun Dec 02 2018 Ashwin H <xiaolinl@vmware.com> 4.0.9-5
76
+-   Fix CVE-2018-17100, CVE-2018-17101
75 77
 *   Mon May 14 2018 Xiaolin Li <xiaolinl@vmware.com> 4.0.9-4
76 78
 -   Fix CVE-2018-7456, CVE-2018-8905, CVE-2018-5784, CVE-2017-11613
77 79
 *   Wed Feb 14 2018 Dheeraj Shetty <dheerajs@vmware.com> 4.0.9-3
... ...
@@ -3,7 +3,24 @@ From: Alexey Makhalov <amakhalov@vmware.com>
3 3
 Date: Tue, 29 Sep 2015 15:55:49 -0700
4 4
 Subject: [PATCH] pci/probe.c: Hardcodded pci probe.
5 5
 
6
-Added pci=scan_all cmdline parameter to verify hardcodded pci values
6
+PCI probing takes a long time to scan resources for all devices
7
+on PCI bus. Idea of this patch is to hardcode known resources
8
+for known devices. In VMware hypervisor we do not have much
9
+virtual PCI devices.
10
+
11
+is_known_device() has list of known devices and available
12
+resources (BARs) for them.
13
+It returns: 0 if BAR not available for the given device
14
+            1 if available and sz parameter will have BAR size
15
+
16
+guess_bar_count() returns maximum number of BARs for the given
17
+class to do not probe for all 6 bars
18
+
19
+has_rom() returns 0 if given class does not have any ROM BARs,
20
+which allows to skip ROM probing
21
+
22
+Added pci=scan_all cmdline parameter verifies hardcodded pci
23
+values at runtime.
7 24
 ---
8 25
  drivers/pci/pci.c   |   2 +
9 26
  drivers/pci/pci.h   |   2 +
... ...
@@ -456,10 +473,10 @@ diff -ur linux-4.19.1/drivers/pci/probe.c linux-4.19.1_new/drivers/pci/probe.c
456 456
 +
457 457
 +		if (pci_scan_and_verify)
458 458
 +			pci_read_bases(dev, 6, PCI_ROM_ADDRESS);
459
-+		else if (class != PCI_CLASS_STORAGE_IDE)
459
++		else
460 460
 +			pci_read_bases(dev,
461
-+			guess_bar_count(dev->class),
462
-+			has_rom(dev->class, PCI_ROM_ADDRESS));
461
++				guess_bar_count(dev->class),
462
++				has_rom(dev->class, PCI_ROM_ADDRESS));
463 463
  
464 464
  		pci_subsystem_ids(dev, &dev->subsystem_vendor, &dev->subsystem_device);
465 465
  
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:        Kernel
3 3
 Name:           linux-esx
4 4
 Version:        4.19.1
5
-Release:        2%{?dist}
5
+Release:        3%{?dist}
6 6
 License:        GPLv2
7 7
 URL:            http://www.kernel.org/
8 8
 Group:          System Environment/Kernel
... ...
@@ -186,6 +186,8 @@ ln -sf linux-%{uname_r}.cfg /boot/photon.cfg
186 186
 /usr/src/linux-headers-%{uname_r}
187 187
 
188 188
 %changelog
189
+*   Thu Nov 29 2018 Alexey Makhalov <amakhalov@vmware.com> 4.19.1-3
190
+-   Fix BAR4 is zero issue for IDE devices
189 191
 *   Thu Nov 15 2018 Ajay Kaher <akaher@vmware.com> 4.19.1-2
190 192
 -   Adding BuildArch
191 193
 *   Thu Nov 08 2018 Him Kalyan Bordoloi <bordoloih@vmware.com> 4.19.1-1
192 194
deleted file mode 100644
... ...
@@ -1,86 +0,0 @@
1
-Name:           mongodb
2
-Version:        3.4.10
3
-Release:        1%{?dist}
4
-Summary:        The MongoDB Database
5
-Group:          Applications/Database
6
-License:        AGPLv3
7
-URL:            http://www.mongodb.org/
8
-Source0:        https://github.com/mongodb/mongo/archive/mongo-r%{version}.tar.gz
9
-%define sha1    mongo-r=39b1e86c650a7b1b3ccc1dee86d088fc95a0a225
10
-Vendor:         VMware, Inc.
11
-Distribution:   Photon
12
-BuildRequires:  scons
13
-BuildRequires:  systemd
14
-
15
-%description
16
-MongoDB (from "humongous") is a scalable, high-performance, open source, document-oriented database.
17
-
18
-%prep
19
-%setup -qn mongo-r%{version}
20
-
21
-%build
22
-%ifarch x86_64
23
-scons %{?_smp_mflags} MONGO_VERSION=%{version} \
24
-    --disable-warnings-as-errors
25
-%endif
26
-
27
-%ifarch aarch64
28
-scons %{?_smp_mflags} MONGO_VERSION=%{version} CCFLAGS="-march=armv8-a+crc" \
29
-    --disable-warnings-as-errors
30
-%endif
31
-
32
-
33
-
34
-%install
35
-%ifarch x86_64
36
-scons %{?_smp_mflags} MONGO_VERSION=%{version} install \
37
-    --prefix=%{buildroot}%{_prefix} \
38
-    --disable-warnings-as-errors
39
-%endif
40
-
41
-%ifarch aarch64
42
-scons %{?_smp_mflags} MONGO_VERSION=%{version} CCFLAGS="-march=armv8-a+crc" install \
43
-    --prefix=%{buildroot}%{_prefix} \
44
-    --disable-warnings-as-errors
45
-%endif
46
-
47
-install -d %{buildroot}/var/log/%{name}
48
-install -d %{buildroot}/var/lib/mongo
49
-install -d -m 755 %{buildroot}%{_unitdir}
50
-install -D -m 644 rpm/mongod.service %{buildroot}%{_unitdir}
51
-install -D -m 644 rpm/mongod.conf %{buildroot}/etc/mongod.conf
52
-
53
-
54
-%clean
55
-rm -rf %{buildroot}
56
-
57
-# Pre-install
58
-%pre
59
-if ! getent group mongod >/dev/null; then
60
-    /sbin/groupadd -r mongod
61
-fi
62
-if ! getent passwd mongod >/dev/null; then
63
-    /sbin/useradd -g mongod mongod -s /sbin/nologin
64
-fi
65
-
66
-%preun
67
-    %systemd_preun mongod.service
68
-
69
-%postun
70
-    %systemd_postun_with_restart mongod.service
71
-
72
-%post
73
-    %systemd_post mongod.service
74
-
75
-
76
-%files
77
-%defattr(-,root,root,-)
78
-%{_bindir}/*
79
-%{_unitdir}/mongod.service
80
-%config(noreplace) %attr(0644, mongod, mongod) %{_sysconfdir}/mongod.conf
81
-%attr(0766, mongod, mongod) %dir /var/log/%{name}
82
-%attr(0766, mongod, mongod) %dir /var/lib/mongo
83
-
84
-%changelog
85
-*   Fri Mar 16 2018 Dheeraj Shetty <dheerajs@vmware.com> 3.4.10-1
86
--   Initial build.  First version
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        IPv4 and IPv6 validation methods
2 2
 Name:           perl-Data-Validate-IP
3 3
 Version:        0.27
4
-Release:        1%{?dist}
4
+Release:        2%{?dist}
5 5
 License:        GPL+ or Artistic
6 6
 Group:          Development/Libraries
7 7
 URL:            https://metacpan.org/release/Data-Validate-IP
... ...
@@ -12,6 +12,7 @@ Distribution:   Photon
12 12
 BuildArch:      noarch
13 13
 BuildRequires:  perl
14 14
 Requires:       perl
15
+BuildRequires:  perl-NetAddr-IP
15 16
 Requires:       perl-NetAddr-IP
16 17
 
17 18
 %description
... ...
@@ -33,6 +34,10 @@ make install DESTDIR=%{buildroot}
33 33
 find %{buildroot} -name 'perllocal.pod' -delete
34 34
 
35 35
 %check
36
+# Install the required perl module - Test::Requires
37
+export PERL_MM_USE_DEFAULT=1
38
+echo "yes" | cpan -a
39
+cpan -i Test::Requires
36 40
 make test
37 41
 
38 42
 %files
... ...
@@ -40,5 +45,7 @@ make test
40 40
 %{_mandir}/man3/*
41 41
 
42 42
 %changelog
43
+*   Mon Dec 03 2018 Dweep Advani <dadvani@vmware.com> 0.27-2
44
+-   Fixing the makecheck tests
43 45
 *   Thu Sep 27 2018 Srivatsa S. Bhat <srivatsa@csail.mit.edu> 0.27-1
44 46
 -   Initial version.
... ...
@@ -2,7 +2,7 @@
2 2
 Summary:	Provide the stuff missing in List::Util
3 3
 Name:		perl-List-MoreUtils
4 4
 Version:	0.428
5
-Release:	1%{?dist}
5
+Release:	2%{?dist}
6 6
 License:	GPL+ or Artistic
7 7
 Group:          Development/Libraries
8 8
 URL:		http://search.cpan.org/dist/List-MoreUtils/
... ...
@@ -33,6 +33,10 @@ find %{buildroot} -name 'perllocal.pod' -delete
33 33
 %{_fixperms} -c %{buildroot}
34 34
 
35 35
 %check
36
+# Install required module List::MoreUtils::XS for maketest
37
+export PERL_MM_USE_DEFAULT=1
38
+echo "yes" | cpan -a
39
+cpan -i List::MoreUtils::XS
36 40
 make test
37 41
 
38 42
 %files
... ...
@@ -42,6 +46,8 @@ make test
42 42
 %{_mandir}/man3/List::MoreUtils::Contributing.3.gz
43 43
 
44 44
 %changelog
45
+*   Mon Dec 03 2018 Dweep Advani <dadvani@vmware.com> 0.428-2
46
+-   Fix makecheck tests
45 47
 *   Fri Sep 21 2018 Dweep Advani <dadvani@vmware.com> 0.428-1
46 48
 -   Update to version 0.428
47 49
 *   Wed Apr 05 2017 Robert Qi <qij@vmware.com> 0.418-1
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        Perl extension for using OpenSSL
2 2
 Name:           perl-Net-SSLeay
3 3
 Version:        1.85
4
-Release:        2%{?dist}
4
+Release:        3%{?dist}
5 5
 License:        Perl Artistic License 2.0
6 6
 Group:          Development/Libraries
7 7
 URL:            http://search.cpan.org/~mikem/Net-SSLeay-%{version}/
... ...
@@ -47,6 +47,10 @@ find %{buildroot} -type f -name .packlist -delete
47 47
 find %{buildroot} -type f -name '*.bs' -empty -delete
48 48
 
49 49
 %check
50
+# Install required modules for test - Test::Pod, Test::Exception, Test::Warn and Test::NoWarnings
51
+export PERL_MM_USE_DEFAULT=1
52
+echo "yes" | cpan -a
53
+cpan -i Test::Pod Test::Exception Test::Warn Test::NoWarnings
50 54
 make test
51 55
 
52 56
 %files
... ...
@@ -54,6 +58,8 @@ make test
54 54
 %{_mandir}/man?/*
55 55
 
56 56
 %changelog
57
+*   Mon Dec 03 2018 Dweep Advani <dadvani@vmware.com> 1.85-3
58
+-   Fixing makecheck tests
57 59
 *   Wed Oct 17 2018 Alexey Makhalov <amakhalov@vmware.com> 1.85-2
58 60
 -   Move fips logic to spec file
59 61
 *   Fri Sep 21 2018 Dweep Advani <dadvani@vmware.com> 1.85-1
... ...
@@ -66,4 +72,3 @@ make test
66 66
 -   GA - Bump release of all rpms
67 67
 *   Mon Mar 28 2016 Mahmoud Bassiouny <mbassiounu@vmware.com> 1.72-1
68 68
 -   Initial version.
69
-
70 69
new file mode 100644
... ...
@@ -0,0 +1,72 @@
0
+From 2f6c124e127b5dd98723e7e75a9825c4ed8bd5c7 Mon Sep 17 00:00:00 2001
1
+From: Paul Howarth <paul@city-fan.org>
2
+Date: Fri, 23 Feb 2018 13:03:13 +0000
3
+Subject: [PATCH] Backport of fix for CVE-2018-6594 from pycryptodome
4
+
5
+When creating ElGamal keys, the generator wasn't a square residue: ElGamal
6
+encryption done with those keys cannot be secure under the DDH assumption.
7
+
8
+More details:
9
+- https://github.com/TElgamal/attack-on-pycrypto-elgamal
10
+- https://github.com/Legrandin/pycryptodome/issues/90
11
+- https://github.com/dlitz/pycrypto/issues/253
12
+
13
+This commit is a backport to pycrypto of Legrandin/pycryptodome@99c27a3b
14
+Thanks to Weikeng Chen.
15
+---
16
+ lib/Crypto/PublicKey/ElGamal.py | 30 +++++++++++++++---------------
17
+ 1 file changed, 15 insertions(+), 15 deletions(-)
18
+
19
+diff --git a/lib/Crypto/PublicKey/ElGamal.py b/lib/Crypto/PublicKey/ElGamal.py
20
+index 0ab07fc8..064e42bf 100644
21
+--- a/lib/Crypto/PublicKey/ElGamal.py
22
+@@ -154,33 +154,33 @@ def generate(bits, randfunc, progress_func=None):
23
+         if number.isPrime(obj.p, randfunc=randfunc):
24
+             break
25
+     # Generate generator g
26
+-    # See Algorithm 4.80 in Handbook of Applied Cryptography
27
+-    # Note that the order of the group is n=p-1=2q, where q is prime
28
+     if progress_func:
29
+         progress_func('g\n')
30
+     while 1:
31
++        # Choose a square residue; it will generate a cyclic group of order q.
32
++        obj.g = pow(number.getRandomRange(2, obj.p, randfunc), 2, obj.p)
33
++
34
+         # We must avoid g=2 because of Bleichenbacher's attack described
35
+         # in "Generating ElGamal signatures without knowning the secret key",
36
+         # 1996
37
+-        #
38
+-        obj.g = number.getRandomRange(3, obj.p, randfunc)
39
+-        safe = 1
40
+-        if pow(obj.g, 2, obj.p)==1:
41
+-            safe=0
42
+-        if safe and pow(obj.g, q, obj.p)==1:
43
+-            safe=0
44
++        if obj.g in (1, 2):
45
++            continue
46
++
47
+         # Discard g if it divides p-1 because of the attack described
48
+         # in Note 11.67 (iii) in HAC
49
+-        if safe and divmod(obj.p-1, obj.g)[1]==0:
50
+-            safe=0
51
++        if (obj.p - 1) % obj.g == 0:
52
++            continue
53
++
54
+         # g^{-1} must not divide p-1 because of Khadir's attack
55
+         # described in "Conditions of the generator for forging ElGamal
56
+         # signature", 2011
57
+         ginv = number.inverse(obj.g, obj.p)
58
+-        if safe and divmod(obj.p-1, ginv)[1]==0:
59
+-            safe=0
60
+-        if safe:
61
+-            break
62
++        if (obj.p - 1) % ginv == 0:
63
++            continue
64
++
65
++        # Found
66
++        break
67
++
68
+     # Generate private key x
69
+     if progress_func:
70
+         progress_func('x\n')
... ...
@@ -4,12 +4,13 @@
4 4
 Summary:        The Python Cryptography Toolkit.
5 5
 Name:           pycrypto
6 6
 Version:        2.6.1
7
-Release:        3%{?dist}
7
+Release:        4%{?dist}
8 8
 License:        Public Domain and Python
9 9
 URL:            http://www.pycrypto.org/
10 10
 Source0:        https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/%{name}-%{version}.tar.gz
11 11
 %define         sha1 pycrypto=aeda3ed41caf1766409d4efc689b9ca30ad6aeb2
12 12
 Patch0:         pycrypto-2.6.1-CVE-2013-7459.patch
13
+Patch1:		pycrypto-2.6.1-CVE-2018-6594.patch
13 14
 Group:          Development/Tools
14 15
 Vendor:         VMware, Inc.
15 16
 Distribution:   Photon
... ...
@@ -18,7 +19,7 @@ BuildRequires:  python-setuptools
18 18
 BuildRequires:  python2-devel
19 19
 Requires:       python2
20 20
 %description
21
-This is a collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.). 
21
+This is a collection of both secure hash functions (such as SHA256 and RIPEMD160), and various encryption algorithms (AES, DES, RSA, ElGamal, etc.).
22 22
 
23 23
 %package -n     python3-pycrypto
24 24
 Summary:        python3-pycrypto
... ...
@@ -33,6 +34,7 @@ Python 3 version.
33 33
 %prep
34 34
 %setup -q
35 35
 %patch0 -p1
36
+%patch1 -p1
36 37
 
37 38
 %build
38 39
 python2 setup.py build
... ...
@@ -55,6 +57,8 @@ python3 setup.py test
55 55
 %{python3_sitelib}/*
56 56
 
57 57
 %changelog
58
+*   Thu Nov 29 2018 Siju Maliakkal <smaliakkal@vmware.com> 2.6.1-4
59
+-   Apply patch for CVE-2018-6594
58 60
 *   Thu Jul 20 2017 Anish Swaminathan <anishs@vmware.com> 2.6.1-3
59 61
 -   Apply patch for CVE-2013-7459
60 62
 *   Thu Jul 13 2017 Divya Thaluru <dthaluru@vmware.com> 2.6.1-2
... ...
@@ -3,7 +3,7 @@
3 3
 
4 4
 Name:           python-ConcurrentLogHandler
5 5
 Version:        0.9.1
6
-Release:        2%{?dist}
6
+Release:        3%{?dist}
7 7
 Summary:        Concurrent logging handler (drop-in replacement for RotatingFileHandler) Python 2.6+
8 8
 License:        Apache-2.0
9 9
 Group:          Development/Languages/Python
... ...
@@ -58,7 +58,15 @@ python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
58 58
 popd
59 59
 python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
60 60
 
61
-#No test case available for this package
61
+%check
62
+PATH=%{buildroot}%{_bindir}:${PATH} \
63
+PYTHONPATH=%{buildroot}%{python_sitelib} \
64
+python2 stresstest.py
65
+pushd ../p3dir
66
+PATH=%{buildroot}%{_bindir}:${PATH} \
67
+PYTHONPATH=%{buildroot}%{python3_sitelib} \
68
+python3 stresstest.py
69
+popd
62 70
 
63 71
 %files
64 72
 %defattr(-,root,root,-)
... ...
@@ -73,6 +81,8 @@ python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
73 73
 %exclude /usr/tests/stresstest.py
74 74
 
75 75
 %changelog
76
+*   Mon Dec 03 2018 Ashwin H <ashwinh@vmware.com> 0.9.1-3
77
+-   Add %check
76 78
 *   Thu Sep 21 2017 Bo Gan <ganb@vmware.com> 0.9.1-2
77 79
 -   Disable test as no tests are available
78 80
 *   Fri Aug 25 2017 Vinay Kulkarni <kulkarniv@vmware.com> 0.9.1-1
79 81
new file mode 100644
... ...
@@ -0,0 +1,75 @@
0
+commit 7f3dd65e5dc79cc456ef58a052501ec256d5070b
1
+Author: Giuseppe Lavagetto <lavagetto@gmail.com>
2
+Date:   Mon Feb 13 14:12:39 2017 +0100
3
+
4
+    Support auth API both <= 2.2.5 and >= 2.3.0
5
+    
6
+    Closes #210
7
+
8
+diff --git a/src/etcd/auth.py b/src/etcd/auth.py
9
+index 796772d..c5c7346 100644
10
+--- a/src/etcd/auth.py
11
+@@ -14,13 +14,28 @@ class EtcdAuthBase(object):
12
+         self.name = name
13
+         self.uri = "{}/auth/{}s/{}".format(self.client.version_prefix,
14
+                                            self.entity, self.name)
15
++        # This will be lazily evaluated if not manually set
16
++        self._legacy_api = None
17
++
18
++    @property
19
++    def legacy_api(self):
20
++        if self._legacy_api is None:
21
++            # The auth API has changed between 2.2 and 2.3, true story!
22
++            major, minor, _ = map(int, self.client.version.split('.'))
23
++            self._legacy_api = (major < 3 and minor < 3)
24
++        return self._legacy_api
25
++
26
+ 
27
+     @property
28
+     def names(self):
29
+         key = "{}s".format(self.entity)
30
+         uri = "{}/auth/{}".format(self.client.version_prefix, key)
31
+         response = self.client.api_execute(uri, self.client._MGET)
32
+-        return json.loads(response.data.decode('utf-8'))[key]
33
++        if self.legacy_api:
34
++            return json.loads(response.data.decode('utf-8'))[key]
35
++        else:
36
++            return [obj[self.entity]
37
++                    for obj in json.loads(response.data.decode('utf-8'))[key]]
38
+ 
39
+     def read(self):
40
+         try:
41
+@@ -102,7 +117,16 @@ class EtcdUser(EtcdAuthBase):
42
+ 
43
+     def _from_net(self, data):
44
+         d = json.loads(data.decode('utf-8'))
45
+-        self.roles = d.get('roles', [])
46
++        roles = d.get('roles', [])
47
++        try:
48
++            self.roles = roles
49
++        except TypeError:
50
++            # with the change of API, PUT responses are different
51
++            # from GET reponses, which makes everything so funny.
52
++            # Specifically, PUT responses are the same as before...
53
++            if self.legacy_api:
54
++                raise
55
++            self.roles = [obj['role'] for obj in roles]
56
+         self.name = d.get('user')
57
+ 
58
+     def _to_net(self, prevobj=None):
59
+diff --git a/src/etcd/tests/test_auth.py b/src/etcd/tests/test_auth.py
60
+index 14475f9..5c8c0b0 100644
61
+--- a/src/etcd/tests/test_auth.py
62
+@@ -93,6 +93,10 @@ class EtcdUserTest(TestEtcdAuthBase):
63
+         self.assertEquals(u.roles, set(['guest', 'root']))
64
+         # set roles as a list, it works!
65
+         u.roles = ['guest', 'test_group']
66
++        # We need this or the new API will return an internal error
67
++        r = auth.EtcdRole(self.client, 'test_group')
68
++        r.acls = {'*': 'R', '/test/*': 'RW'}
69
++        r.write()
70
+         try:
71
+             u.write()
72
+         except:
... ...
@@ -3,12 +3,13 @@
3 3
 
4 4
 Name:           python-etcd
5 5
 Version:        0.4.5
6
-Release:        1%{?dist}
6
+Release:        2%{?dist}
7 7
 Summary:        Python API for etcd
8 8
 License:        MIT
9 9
 Group:          Development/Languages/Python
10 10
 Url:            https://pypi.python.org/pypi/python-etcd
11 11
 Source0:        %{name}-%{version}.tar.gz
12
+Patch0:         auth-api-compatibility.patch
12 13
 %define sha1    python-etcd=9e79ae82429cf2ffbe2b5647e14bc29571afd766
13 14
 Vendor:         VMware, Inc.
14 15
 Distribution:   Photon
... ...
@@ -18,6 +19,15 @@ BuildRequires:  python2-devel
18 18
 BuildRequires:  python2-libs
19 19
 BuildRequires:  python-pip
20 20
 BuildRequires:  python-setuptools
21
+%if %{with_check}
22
+BuildRequires:  python-dnspython
23
+BuildRequires:  python-urllib3
24
+BuildRequires:  python-pyOpenSSL
25
+BuildRequires:  etcd
26
+BuildRequires:  openssl-devel
27
+BuildRequires:  curl-devel
28
+BuildRequires:  libffi-devel
29
+%endif
21 30
 Requires:       python2
22 31
 Requires:       python2-libs
23 32
 Requires:       python-setuptools
... ...
@@ -33,12 +43,18 @@ BuildRequires:  python3-devel
33 33
 BuildRequires:  python3-libs
34 34
 BuildRequires:  python3-pip
35 35
 BuildRequires:  python3-setuptools
36
+%if %{with_check}
37
+BuildRequires:  python3-dnspython
38
+BuildRequires:  python3-urllib3
39
+BuildRequires:  python3-pyOpenSSL
40
+%endif
36 41
 
37 42
 %description -n python3-etcd
38 43
 Python3 API for etcd
39 44
 
40 45
 %prep
41 46
 %setup -n %{name}-%{version}
47
+%patch0 -p1
42 48
 rm -rf ../p3dir
43 49
 cp -a . ../p3dir
44 50
 
... ...
@@ -54,6 +70,14 @@ python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}
54 54
 popd
55 55
 python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
56 56
 
57
+%check
58
+easy_install_2=$(ls /usr/bin |grep easy_install |grep 2)
59
+$easy_install_2 nose
60
+python2 setup.py test
61
+easy_install_3=$(ls /usr/bin |grep easy_install |grep 3)
62
+$easy_install_3 nose
63
+python3 setup.py test
64
+
57 65
 %files
58 66
 %defattr(-,root,root,-)
59 67
 %{python2_sitelib}/*
... ...
@@ -63,5 +87,7 @@ python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
63 63
 %{python3_sitelib}/*
64 64
 
65 65
 %changelog
66
+*   Tue Dec 04 2018 Ashwin H<ashwinh@vmware.com> 0.4.5-2
67
+-   Add %check
66 68
 *   Sat Aug 26 2017 Vinay Kulkarni <kulkarniv@vmware.com> 0.4.5-1
67 69
 -   Initial version of python etcd for PhotonOS.
... ...
@@ -5,7 +5,7 @@
5 5
 Summary:        Query Language for JSON
6 6
 Name:           python-jmespath
7 7
 Version:        0.9.3
8
-Release:        1%{?dist}
8
+Release:        2%{?dist}
9 9
 License:        MIT
10 10
 Group:          Development/Languages/Python
11 11
 Vendor:         VMware, Inc.
... ...
@@ -18,6 +18,14 @@ BuildRequires:  python2-libs
18 18
 BuildRequires:  python2-devel
19 19
 BuildRequires:  python-setuptools
20 20
 BuildRequires:  python-xml
21
+BuildRequires:  python3-devel
22
+BuildRequires:  python3-libs
23
+BuildRequires:  python3-setuptools
24
+BuildRequires:  python3-xml
25
+%if %{with_check}
26
+BuildRequires:  openssl-devel
27
+BuildRequires:  curl-devel
28
+%endif
21 29
 Requires:       python2
22 30
 Requires:       python2-libs
23 31
 BuildArch:      noarch
... ...
@@ -27,10 +35,6 @@ JMESPath (pronounced “james path”) allows you to declaratively specify how t
27 27
 
28 28
 %package -n     python3-jmespath
29 29
 Summary:        python-jmespath
30
-BuildRequires:  python3-devel
31
-BuildRequires:  python3-libs
32
-BuildRequires:  python3-setuptools
33
-BuildRequires:  python3-xml
34 30
 Requires:       python3
35 31
 Requires:       python3-libs
36 32
 
... ...
@@ -58,8 +62,12 @@ popd
58 58
 python2 setup.py install --single-version-externally-managed -O1 --root=%{buildroot}
59 59
 
60 60
 %check
61
+easy_install_2=$(ls /usr/bin |grep easy_install |grep 2)
62
+$easy_install_2 nose
61 63
 python2 setup.py test
62 64
 pushd ../p3dir
65
+easy_install_3=$(ls /usr/bin |grep easy_install |grep 3)
66
+$easy_install_3 nose
63 67
 python3 setup.py test
64 68
 popd
65 69
 
... ...
@@ -74,5 +82,8 @@ popd
74 74
 %{_bindir}/jp.py-%{python3_version}
75 75
 
76 76
 %changelog
77
+*   Wed Nov 28 2018 Tapas Kundu <tkundu@vmware.com> 0.9.3-2
78
+-   Fix make check
79
+-   moved the build requires from subpackages
77 80
 *   Sun Jan 07 2018 Kumar Kaushik <kaushikk@vmware.com> 0.9.3-1
78 81
 -   Initial packaging for photon.
79 82
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+--- a/src/lxml/tests/test_threading.py	2018-11-28 23:02:48.320893543 +0530
1
+@@ -153,9 +153,9 @@ class ThreadingTestCase(HelperTestCase):
2
+             self.assertTrue(len(log))
3
+             if last_log is not None:
4
+                 self.assertEqual(len(last_log), len(log))
5
+-            self.assertEqual(4, len(log))
6
++            self.assertTrue(len(log) >= 2, len(log))
7
+             for error in log:
8
+-                self.assertTrue(':ERROR:XSLT:' in str(error))
9
++                self.assertTrue(':ERROR:XSLT:' in str(error), str(error))
10
+             last_log = log
11
+ 
12
+     def test_thread_xslt_apply_error_log(self):
... ...
@@ -3,12 +3,13 @@
3 3
 Summary:        XML and HTML with Python
4 4
 Name:           python-lxml
5 5
 Version:        4.2.4
6
-Release:        1%{?dist}
6
+Release:        2%{?dist}
7 7
 Group:          Development/Libraries
8 8
 License:        BSD
9 9
 URL:            http://lxml.de
10 10
 Source0:        https://pypi.python.org/packages/39/e8/a8e0b1fa65dd021d48fe21464f71783655f39a41f218293c1c590d54eb82/lxml-%{version}.tar.gz
11 11
 %define sha1    lxml=4a77c5471dfea2a32fd16475d130350af7d33f85
12
+Patch0:         lxml-make-check-fix.patch
12 13
 Vendor:         VMware, Inc.
13 14
 Distribution:   Photon
14 15
 BuildRequires:  python2-devel
... ...
@@ -17,6 +18,9 @@ BuildRequires:  python-xml
17 17
 BuildRequires:  libxslt
18 18
 BuildRequires:  libxslt-devel
19 19
 BuildRequires:  cython
20
+BuildRequires:  python3
21
+BuildRequires:  python3-devel
22
+BuildRequires:  python3-libs
20 23
 Requires:       python2
21 24
 Requires:       libxslt
22 25
 
... ...
@@ -25,12 +29,6 @@ The lxml XML toolkit is a Pythonic binding for the C libraries libxml2 and libxs
25 25
 
26 26
 %package -n     python3-lxml
27 27
 Summary:        python-lxml
28
-BuildRequires:  python3
29
-BuildRequires:  python3-devel
30
-BuildRequires:  python3-libs
31
-BuildRequires:  libxslt
32
-BuildRequires:  libxslt-devel
33
-BuildRequires:  cython
34 28
 Requires:       libxslt
35 29
 Requires:       python3
36 30
 Requires:       python3-libs
... ...
@@ -40,6 +38,7 @@ Python 3 version.
40 40
 
41 41
 %prep
42 42
 %setup -q -n lxml-%{version}
43
+%patch0 -p1
43 44
 rm -rf ../p3dir
44 45
 cp -a . ../p3dir
45 46
 
... ...
@@ -76,6 +75,9 @@ rm -rf %{buildroot}
76 76
 %{python3_sitelib}/*
77 77
 
78 78
 %changelog
79
+*   Wed Nov 28 2018 Tapas Kundu <tkundu@vmware.com> 4.2.4-2
80
+-   Fix make check
81
+-   moved build requires from subpackage
79 82
 *   Sun Sep 09 2018 Tapas Kundu <tkundu@vmware.com> 4.2.4-1
80 83
 -   Update to version 4.2.4
81 84
 *   Mon Aug 07 2017 Dheeraj Shetty <dheerajs@vmware.com> 3.7.3-3
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        Array processing for numbers, strings, records, and objects
5 5
 Name:           python-numpy
6 6
 Version:        1.15.1
7
-Release:        1%{?dist}
7
+Release:        2%{?dist}
8 8
 License:        BSD
9 9
 Group:          Development/Languages/Python
10 10
 Vendor:         VMware, Inc.
... ...
@@ -20,6 +20,14 @@ BuildRequires:  python2-devel
20 20
 BuildRequires:  lapack-devel
21 21
 BuildRequires:  unzip
22 22
 
23
+BuildRequires:  python3
24
+BuildRequires:  python3-devel
25
+BuildRequires:  python3-setuptools
26
+BuildRequires:  python3-xml
27
+%if %{with_check}
28
+BuildRequires:  curl-devel
29
+BuildRequires:  openssl-devel
30
+%endif
23 31
 Requires:       python2
24 32
 Requires:       python2-libs
25 33
 
... ...
@@ -28,10 +36,6 @@ NumPy is a general-purpose array-processing package designed to efficiently mani
28 28
 
29 29
 %package -n     python3-numpy
30 30
 Summary:        python-numpy
31
-BuildRequires:  python3
32
-BuildRequires:  python3-devel
33
-BuildRequires:  python3-setuptools
34
-BuildRequires:  python3-xml
35 31
 Requires:       python3
36 32
 Requires:       python3-libs
37 33
 
... ...
@@ -55,14 +59,14 @@ python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
55 55
 
56 56
 %check
57 57
 easy_install_2=$(ls /usr/bin |grep easy_install |grep 2)
58
-$easy_install_2 nose
58
+$easy_install_2 nose pytest
59 59
 mkdir test
60 60
 pushd test
61 61
 PYTHONPATH=%{buildroot}%{python2_sitelib} PATH=$PATH:%{buildroot}%{_bindir} python2 -c "import numpy; numpy.test()"
62 62
 popd
63 63
 
64 64
 easy_install_3=$(ls /usr/bin |grep easy_install |grep 3)
65
-$easy_install_3 nose
65
+$easy_install_3 nose pytest
66 66
 pushd test
67 67
 PYTHONPATH=%{buildroot}%{python3_sitelib} PATH=$PATH:%{buildroot}%{_bindir} python3 -c "import numpy; numpy.test()"
68 68
 popd
... ...
@@ -80,6 +84,8 @@ rm -rf test
80 80
 %{_bindir}/f2py3
81 81
 
82 82
 %changelog
83
+*   Mon Dec 03 2018 Tapas Kundu <tkundu@vmware.com> 1.15.1-2
84
+-   Fixed make check
83 85
 *   Sun Sep 09 2018 Tapas Kundu <tkundu@vmware.com> 1.15.1-1
84 86
 -   Update to version 1.15.1
85 87
 *   Fri Aug 25 2017 Alexey Makhalov <amakhalov@vmware.com> 1.12.1-5
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        A high-level scripting language
2 2
 Name:           python3
3 3
 Version:        3.7.0
4
-Release:        1%{?dist}
4
+Release:        2%{?dist}
5 5
 License:        PSF
6 6
 URL:            http://www.python.org/
7 7
 Group:          System Environment/Programming
... ...
@@ -207,6 +207,7 @@ rm -rf %{buildroot}/*
207 207
 %exclude %{_libdir}/python3.7/lib-dynload/pyexpat*.so
208 208
 %exclude %{_libdir}/python3.7/curses
209 209
 %exclude %{_libdir}/python3.7/lib-dynload/_curses*.so
210
+%exclude %{_libdir}/python3.7/distutils/command/wininst-*.exe
210 211
 
211 212
 %files  xml
212 213
 %{_libdir}/python3.7/xml/*
... ...
@@ -256,6 +257,8 @@ rm -rf %{buildroot}/*
256 256
 %{_libdir}/python3.7/test/*
257 257
 
258 258
 %changelog
259
+*   Tue Dec 04 2018 Tapas Kundu <tkundu@vmware.com> 3.7.0-2
260
+-   Excluded windows installer from python3 libs packaging.
259 261
 *   Wed Sep 26 2018 Tapas Kundu <tkundu@vmware.com> 3.7.0-1
260 262
 -   Updated to version 3.7.0
261 263
 *   Mon Sep 18 2017 Alexey Makhalov <amakhalov@vmware.com> 3.6.1-9
... ...
@@ -83,7 +83,7 @@ index 9033efc..1eeb714 100644
83 83
  #define ERROR_TDNF_OUT_OF_MEMORY        (ERROR_TDNF_SYSTEM_BASE + ENOMEM)
84 84
  #define ERROR_TDNF_NO_DATA              (ERROR_TDNF_SYSTEM_BASE + ENODATA)
85 85
 diff --git a/include/tdnftypes.h b/include/tdnftypes.h
86
-index 6aabaf0..2ebc466 100644
86
+index f2fbdb5..d89163c 100644
87 87
 --- a/include/tdnftypes.h
88 88
 +++ b/include/tdnftypes.h
89 89
 @@ -160,6 +160,7 @@ typedef struct _TDNF_SOLVED_PKG_INFO
... ...
@@ -95,7 +95,7 @@ index 6aabaf0..2ebc466 100644
95 95
      PTDNF_PKG_INFO pPkgsExisting;
96 96
      PTDNF_PKG_INFO pPkgsToInstall;
97 97
 diff --git a/solv/prototypes.h b/solv/prototypes.h
98
-index 1865b99..0fd08a5 100644
98
+index 2484649..9789316 100644
99 99
 --- a/solv/prototypes.h
100 100
 +++ b/solv/prototypes.h
101 101
 @@ -246,6 +246,17 @@ SolvFindHighestOrLowestInstalled(
... ...
@@ -117,16 +117,13 @@ index 1865b99..0fd08a5 100644
117 117
  uint32_t
118 118
  SolvCreateSack(
119 119
 diff --git a/solv/tdnfpackage.c b/solv/tdnfpackage.c
120
-index d394f07..3a926a1 100644
120
+index 9631cde..80c33c2 100644
121 121
 --- a/solv/tdnfpackage.c
122 122
 +++ b/solv/tdnfpackage.c
123
-@@ -1558,4 +1558,119 @@ cleanup:
124
- 
125
- error:
126
-     goto cleanup;
127
--}
128
-\ No newline at end of file
129
-+}
123
+@@ -1673,3 +1673,118 @@ SolvIsGlob(
124
+     }
125
+     return nResult;
126
+ }
130 127
 +
131 128
 +uint32_t
132 129
 +SolvGetNevraFromId(
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        dnf/yum equivalent using C libs
5 5
 Name:           tdnf
6 6
 Version:        2.0.0
7
-Release:        2%{?dist}
7
+Release:        3%{?dist}
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 License:        LGPLv2.1,GPLv2
... ...
@@ -21,14 +21,13 @@ BuildRequires:  libsolv-devel
21 21
 BuildRequires:  curl-devel
22 22
 Obsoletes:      yum
23 23
 Provides:       yum
24
-Source0:        %{name}-%{version}-alpha.1.tar.gz
25
-%define sha1    tdnf=625331f1b2e72fdacd64c137667553be1c4236cf
24
+Source0:        %{name}-%{version}-beta.tar.gz
25
+%define sha1    tdnf=3d316ac465bef668f3deeda5b98c9a21c22e8323
26 26
 Source1:        cache-updateinfo
27 27
 Source2:        cache-updateinfo.service
28 28
 Source3:        cache-updateinfo.timer
29 29
 Source4:        updateinfo.sh
30 30
 Patch0:         tdnf-epoch-and-perm.patch
31
-Patch1:         tdnf-crash.patch
32 31
 
33 32
 %description
34 33
 tdnf is a yum/dnf equivalent which uses libsolv and libcurl
... ...
@@ -50,9 +49,8 @@ Group:		Development/Libraries
50 50
 Library providing cli libs for tdnf like clients.
51 51
 
52 52
 %prep
53
-%setup -qn %{name}-%{version}-alpha.1
53
+%setup -qn %{name}-%{version}-beta
54 54
 %patch0 -p1
55
-%patch1 -p1
56 55
 
57 56
 %build
58 57
 autoreconf -i
... ...
@@ -150,6 +148,8 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
150 150
     %{_libdir}/libtdnfcli.so.*
151 151
 
152 152
 %changelog
153
+*   Wed Nov 21 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-3
154
+-   Update to 2.0.0 beta release.
153 155
 *   Mon Oct 08 2018 Keerthana K <keerthanak@vmware.com> 2.0.0-2
154 156
 -   Fix bug on tdnf crash when photon-iso repo only enabled without mounting cdrom.
155 157
 *   Fri Feb 09 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.0.0-1
... ...
@@ -1,7 +1,7 @@
1 1
 Name:           traceroute
2 2
 Summary:        Traces the route taken by packets over an IPv4/IPv6 network
3 3
 Version:        2.1.0
4
-Release:        2%{?dist}
4
+Release:        3%{?dist}
5 5
 License:        GPLv2+
6 6
 Group:          Applications/Internet
7 7
 Url:            http://traceroute.sourceforge.net
... ...
@@ -28,7 +28,6 @@ rm -rf %{buildroot}
28 28
 install -d %{buildroot}/bin
29 29
 install -m755 traceroute/traceroute %{buildroot}/bin
30 30
 pushd %{buildroot}/bin
31
-ln -s traceroute traceroute6
32 31
 popd
33 32
 
34 33
 install -d %{buildroot}%{_bindir}
... ...
@@ -37,7 +36,6 @@ install -m755 wrappers/tcptraceroute %{buildroot}%{_bindir}
37 37
 install -d %{buildroot}%{_mandir}/man8
38 38
 install -p -m644 traceroute/traceroute.8 $RPM_BUILD_ROOT%{_mandir}/man8
39 39
 pushd %{buildroot}%{_mandir}/man8
40
-ln -s traceroute.8 traceroute6.8
41 40
 ln -s traceroute.8 tcptraceroute.8
42 41
 popd
43 42
 
... ...
@@ -53,6 +51,8 @@ rm -rf $RPM_BUILD_ROOT
53 53
 
54 54
 
55 55
 %changelog
56
+*   Fri Nov 30 2018 Ashwin H <ashwinh@vmware.com> 2.1.0-3
57
+-   Remove traceroute6 softlink as iputils provides traceroute6
56 58
 *   Tue Apr 25 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.1.0-2
57 59
 -   Ensure non empty debuginfo
58 60
 *   Tue Mar 28 2017 Xiaolin Li <xiaolinl@vmware.com> 2.1.0-1
... ...
@@ -18,6 +18,7 @@ This information is intended for Photon OS administrators and developers:
18 18
 |Download and Install Photon OS.|[Installation Guide](photon_installation/README.md)|
19 19
 |Fundamentals of administering Photon OS. Basics of managing packages, controlling services with systemd, setting up networking, and initializing Photon OS. |[Administration Guide](photon_admin/README.md)|
20 20
 |Use Photon OS.|[User Guide](photon_user/README.md)|
21
+|Use Photon OS command-line utilities.|[Command-Line Interface Reference](photon_cli/README.md)|
21 22
 |Solutions for common problems that you might encounter while using Photon OS.|[Troubleshooting Guide](photon_troubleshoot/README.md)|
22 23
 
23 24
 ----------
... ...
@@ -20,29 +20,29 @@
20 20
         * [Use Cached Sources](photon_installation/use_cached_sources.md)
21 21
         * [View Build Logs](photon_installation/view_build_logs.md)
22 22
     - [Running Photon OS on vSphere](photon_installation/Running-Photon-OS-on-vSphere.md)
23
-        - [Prerequisites](photon_installation/photon_os_vsphere_prerequisites.md)
23
+        - [Prerequisites for Running Photon OS on vSphere](photon_installation/photon_os_vsphere_prerequisites.md)
24 24
         - [Importing the OVA for Photon OS 3.0](photon_installation/importing_ova_for_photon_os_3.0.md)
25 25
         - [Installing the ISO Image for Photon OS 3.0](photon_installation/installing-the-iso-image-for-photon-os-30.md)
26 26
     - [Running Photon OS on Fusion](photon_installation/Running-Project-Photon-on-Fusion.md)
27
-        - [Prerequisites](photon_installation/photon_os_fusion_prerequisites.md)
28
-        - [Importing the OVA for Photon OS 3.0](photon_installation/importing-the-ova-for-photon-os-3.0-fusion.md)
27
+        - [Prerequisites for Running Photon OS on Fusion](photon_installation/photon_os_fusion_prerequisites.md)
28
+        - [Importing the OVA for Photon OS 3.0](photon_installation/importing-ova-for-photon-os-3.0-fusion.md)
29 29
         - [Installing the ISO Image for Photon OS 3.0](photon_installation/installing-the-iso-image-for-photon-os-30-fusion.md)
30 30
     - [Running Photon OS on Workstation](photon_installation/Running-Photon-OS-on-Workstation.md)
31
-        - [Prerequisites](photon_installation/photon_os_workstation_prerequisites.md)
31
+        - [Prerequisites for Running Photon OS on Workstation](photon_installation/photon_os_workstation_prerequisites.md)
32 32
         - [Importing the OVA for Photon OS 3.0](photon_installation/importing_ova_for_photon_os_3.0-workstation.md)
33 33
         - [Installing the ISO Image for Photon OS 2.0](photon_installation/installing-the-iso-image-for-photon-os-30-workstation.md)
34 34
     - [Running Photon OS on AWS EC2](photon_installation/Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute.md)
35
-        - [Prerequisites](photon_installation/photon_os_ecc_prerequisites.md)
35
+        - [Prerequisites for Running Photon OS on AWS EC2](photon_installation/photon_os_ecc_prerequisites.md)
36 36
         - [Set Up Photon OS on EC2](photon_installation/set-up-PhotonOS-on-ec2.md)
37 37
         - [Deploy a Containerized Application in Photon OS using SSH](photon_installation/deploying-a-containerized-application-in-photon-os-ssh.md)
38 38
         - [Launch the Web Server with Cloud-Init](photon_installation/launch-web-server-with-cloud-init.md)
39 39
         - [Terminate the AMI Instance](photon_installation/terminate-the-ami-instance.md)
40 40
     - [Running Photon OS on Microsoft Azure](photon_installation/Running-Photon-OS-on-Microsoft-Azure.md)
41
-        - [Prerequisites](photon_installation/photon-os-azure-prerequisites.md)
41
+        - [Prerequisites for Running Photon OS on Azure](photon_installation/photon-os-azure-prerequisites.md)
42 42
         - [Set Up Azure Storage and Uploading the VHD](photon_installation/setting-up-azure-storage-and-uploading-the-vhd.md)
43 43
         - [Remove Photon OS From Azure](photon_installation/remove-photon-os-from-azure.md)
44 44
     - [Running Photon OS on Google Compute Engine](photon_installation/Running-Photon-OS-on-Google-Compute-Engine.md)
45
-        - [Prerequisites for Photon OS on GCE](photon_installation/photon-os-gce-prerequisites.md)
45
+        - [Prerequisites for Running Photon OS on GCE](photon_installation/photon-os-gce-prerequisites.md)
46 46
         - [Installing Photon OS on Google Compute Engine](photon_installation/installing-photon-os-on-google-compute-engine.md)
47 47
     - [Deploying a Containerized Application in Photon OS](photon_installation/deploying-a-containerized-application-in-photon-os.md)
48 48
     - [Installing and Using Lightwave on Photon OS](photon_installation/Installing-and-Using-Lightwave-on-Photon-OS.md)
... ...
@@ -53,10 +53,7 @@
53 53
         - [Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed](photon_installation/Remotely-Upgrade-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
54 54
     - [Photon Management Daemon](photon_installation/using-the-photon-management-daemon.md)
55 55
         - [Installing the pmd Package](photon_installation/installing_pmd_package.md)
56
-        - [Available APIs](photon_installation/available_apis.md)
57
-    - [Command-line Interfaces](photon_installation/command-line_interfaces.md)
58
-        - [Photon Management Daemon Command-line Interface (pmd-cli)](photon_installation/pmd-cli.md)
59
-        - [Photon Network Manager Command-line Interface (netmgr)](photon_installation/netmgr-cli.md)   
56
+        - [Available APIs](photon_installation/available_apis.md)   
60 57
 - [Administration Guide](photon_admin/README.md)
61 58
     - [Photon OS Packages](photon_admin/photon_os_packages.md) 
62 59
         - [Examining the Packages in the SPECS Directory on Github](photon_admin/examining_packages_spec_dir.md)
... ...
@@ -103,6 +100,7 @@
103 103
         - [Network Configuration Manager - C API](photon_admin/netmgr.c.md)
104 104
         - [Network Configuration Manager - Python API](photon_admin/netmgr.python.md)
105 105
     -   [Cloud-Init on Photon OS](photon_admin/cloud-init-on-photon-os.md)
106
+        - [Cloud-Init Overview](photon_admin/cloud-init.md)
106 107
         - [Deploy Photon OS With cloud-init](photon_admin/deploy_photon_with_cloud-init.md) 
107 108
         - [Creating a Stand-Alone Photon Machine with cloud-init](photon_admin/creating-a-stand-alone-photon-machine-with-cloud-init.md)
108 109
         -   [Customizing a Photon OS Machine on EC2](photon_admin/customizing-a-photon-os-machine-on-ec2.md)
... ...
@@ -126,6 +124,53 @@
126 126
             - [Configure Kubernetes Services on Master](photon_user/configure_kubernetes_on_master.md)
127 127
             - [Configure Kubernetes Services on Node](photon_user/configure_kubernetes_on_node.md)
128 128
     - [Mounting Remote File Systems](photon_user/nfs-utils.md)
129
-- [Troubleshooting](photon_troubleshoot/README.md)
130
-- [Frequently Asked Questions](Frequently-Asked-Questions.md)
131
-* [Security Advisories](https://github.com/vmware/photon/wiki/Security-Advisories)
132 129
\ No newline at end of file
130
+- [Command-Line Reference](photon_cli/README.md)
131
+	- [Command-line Interfaces](photon_cli/command-line_interfaces.md)
132
+		- [Photon Management Daemon Command-line Interface (pmd-cli)](photon_cli/pmd-cli.md)
133
+		- [Photon Network Manager Command-line Interface (netmgr)](photon_cli/netmgr-cli.md)
134
+- [Troubleshooting Guide](photon_troubleshoot/README.md)
135
+    - [Introduction](photon_troubleshoot/introduction.md)
136
+        - [Systemd and TDNF](photon_troubleshoot/systemd-and-tdnf.md)
137
+        - [The Root Account and the `sudo` and `su` Commands](photon_troubleshoot/root-account-sudo-and-su-commands.md)
138
+        - [Checking the Version and Build Number](photon_troubleshoot/checking-the-version-and-build-number.md)
139
+        - [General Best Practices](photon_troubleshoot/general-best-practices.md)
140
+        - [Photon OS Logs](photon_troubleshoot/photon-os-logs.md)
141
+        - [Troubleshooting Progression](photon_troubleshoot/troubleshooting-progression.md)
142
+    - [Solutions to Common Problems](photon_troubleshoot/solutions-to-common-problems.md)
143
+        - [Resetting a Lost Root Password](photon_troubleshoot/resetting-a-lost-root-password.md)
144
+        - [Fixing Permissions on Network Configuration Files](photon_troubleshoot/network-config-files-permissions.md)
145
+        - [Permitting Root Login with SSH](photon_troubleshoot/permitting-root-login-with-ssh.md)
146
+        - [Fixing Sendmail](photon_troubleshoot/fixing-sendmail.md)
147
+    - [Troubleshooting Tools on Photon OS](photon_troubleshoot/troubleshooting-tools.md)
148
+        - [Common Tools](photon_troubleshoot/common-tools.md)
149
+        - [Troubleshooting Tools Installed by Default](photon_troubleshoot/default-tools.md)
150
+        - [Installing Tools From Repositories](photon_troubleshoot/installing-tools.md)
151
+        - [Linux Troubleshooting Tools](photon_troubleshoot/linux-troubleshooting-tools.md)
152
+    - [Troubleshooting With systemd](photon_troubleshoot/systemd.md)
153
+        - [Troubleshooting Services with `systemctl`](photon_troubleshoot/troubleshooting-services.md)
154
+        - [Analyzing System Logs with `journalctl`](photon_troubleshoot/analyzing-system-logs-with-journalctl.md)
155
+        - [Inspecting Services with `systemd-analyze`](photon_troubleshoot/inspecting-services-with-systemd-analyze.md)
156
+    - [Network Troubleshooting](photon_troubleshoot/networking.md)
157
+        - [Managing the Network Configuration](photon_troubleshoot/managing-the-network-configuration.md)
158
+        - [Inspecting IP Addresses](photon_troubleshoot/inspecting-ip-addresses.md)
159
+        - [Inspecting the Status of Network Links with `networkctl`](photon_troubleshoot/inspecting-network-links-with-networkctl.md)
160
+        - [Network Debugging](photon_troubleshoot/network-debugging.md)
161
+        - [Checking Firewall Rules](photon_troubleshoot/checking-firewall-rules.md)
162
+        - [Inspect Network Settings with `netmgr`](photon_troubleshoot/netmgr.md)
163
+    - [File System Troubleshooting](photon_troubleshoot/file-system.md)
164
+        - [Checking Disk Space](photon_troubleshoot/checking-disk-space.md)
165
+        - [Adding a Disk and Partitioning It](photon_troubleshoot/adding-a-disk-and-partitioning-it.md)
166
+        - [Expanding Disk Partition](photon_troubleshoot/expanding-disk-partition.md)
167
+        - [List Disk Partitions](photon_troubleshoot/fdisk.md)
168
+        - [File System Consistency Check Tool](photon_troubleshoot/fsck.md)
169
+        - [Fixing File System Errors When fsck Fails](photon_troubleshoot/fixing-file-system-errors-when-fsck-fails.md)
170
+    - [Troubleshooting Packages](photon_troubleshoot/packages.md)
171
+    - [Kernel Problems and Boot and Login Problems](photon_troubleshoot/kernel-problems-and-boot-and-login-errors.md)
172
+        - [Kernel Overview](photon_troubleshoot/kernel-overview.md)
173
+        - [Boot Process Overview](photon_troubleshoot/boot-process-overview.md)
174
+        - [Blank Screen on Reboot](photon_troubleshoot/blank-screen-on-reboot.md)
175
+        - [Investigating Unexpected Behavior](photon_troubleshoot/investigating-strange-behavior.md)
176
+        - [Investigating the Guest Kernel](photon_troubleshoot/investigating-the-guest-kernel.md)
177
+        - [Kernel Log Replication with VProbes](photon_troubleshoot/kernel-log-replication-with-vprobes.md)
178
+    -   [Performance Issues](photon_troubleshoot/performance-issues.md)
179
+- [Security Advisories](https://github.com/vmware/photon/wiki/Security-Advisories)
133 180
\ No newline at end of file
134 181
deleted file mode 100644
... ...
@@ -1,3 +0,0 @@
1
-# Upgrading the Kernel Version Requires Grub Changes for AWS and GCE Images
2
-
3
-If you upgrade the Photon OS Linux kernel with `tdnf upgrade linux`, you must modify the `/boot/grub2/grub.cfg` file to reflect the correct kernel version so that it works with AWS and GCE images. For example, if you install Photon OS 1.0 with kernel 4.4.8 and then upgrade the Linux kernel to 4.4.26, you must edit the /boot/grub2/grub.cfg file to replace the line containing `linux /boot/vmlinuz-4.4.8` with `linux /boot/vmlinuz-4.4.26`.
4 1
\ No newline at end of file
5 2
deleted file mode 100644
... ...
@@ -1,132 +0,0 @@
1
-# Compatible Cloud Images
2
-
3
-The [Bintray website](https://bintray.com/vmware/photon/) contains the following cloud-ready images of Photon OS: 
4
-
5
-1. GCE - Google Compute Engine
6
-
7
-1. AMI - Amazon Machine Image
8
-
9
-1. OVA
10
-
11
-Because the cloud-ready images of Photon OS are built to be compatible with their corresponding cloud platform or format, you typically do not need to build a cloud image--just go to Bintray and download the image for the platform that you are working on. 
12
-
13
-If, however, you want to build your own cloud image, perhaps because you seek to customize the code, see the next section on how to build cloud images.
14
-
15
-## How to build cloud images
16
-
17
-	sudo make cloud-image IMG_NAME=image-name
18
-
19
-	image-name: gce/ami/azure/ova
20
-
21
-The output of the build process produces the following file formats:
22
-
23
-GCE - A tar file consisting of disk.raw as the raw disk file 
24
-
25
-AMI - A raw disk file
26
-
27
-<!-- Azure - A vhd file -->
28
-
29
-OVA - An ova file (vmdk + ovf)
30
-
31
-If you want, you can build all the cloud images by running the following command: 
32
-
33
-	sudo make cloud-image-all 
34
-
35
-<!-- ###How to build Photon bosh-stemcell
36
-
37
-Please follow the link to [build](https://github.com/cloudfoundry/bosh/blob/develop/bosh-stemcell/README.md) Photon bosh-stemcell
38
-
39
-## How to create running instances in the cloud
40
-
41
-The following sections contain some high-level instructions on how to create instances of Photon OS in the Google Compute Engine (GCE) and Amazon Elastic Cloud Compute (EC2). For more information, see the Amazon or Google cloud documentation. 
42
-
43
-### GCE
44
-
45
-The tar file can be uploaded to Google's cloud storage and an instance can be created after creating an image from the tar file. You will need the Google Cloud SDK on your host machine to upload the image and create instances.
46
-
47
-####Install Google cloud SDK on host machine
48
-
49
-	curl https://sdk.cloud.google.com | bash
50
-
51
-####Upload the tar file
52
-
53
-	gsutil cp photon-gce.tar.gz gs://bucket-name
54
-
55
-####Create image
56
-
57
-	gcloud compute --project project-id images create image-name --description description --source-uri https://storage.googleapis.com/bucket-name/photon-gce.tar.gz
58
-
59
-####Create instance of GCE
60
-
61
-	gcloud compute --project project-id instances create instance-name --zone "us-central1-f" --machine-type "n1-standard-1" other-options
62
-
63
-(You can also create instances from the Google developer console.)
64
-
65
-For more information, see [Running a Photon OS Machine on GCE](photon-admin-guide.md#running-a-photon-os-machine-on-gce). 
66
-
67
-### AWS EC2
68
-
69
-Install the [AWS CLI](http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os) and [EC2 CLI](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html) tools. 
70
-
71
-####Bundle the image
72
-
73
-	ec2-bundle-image -c cert.pem -k private-key.pem -u $AWS_USER_ID --arch x86_64 --image photon-ami.raw --destination directory-name
74
-
75
-####Upload the bundle
76
-
77
-	ec2-upload-bundle --manifest directory-name/photon-ami.raw.manifest.xml --bucket bucket-name --access-key $AWS_ACCESS_KEY --secret-key $AWS_SECRET_KEY
78
-
79
-####Register the AMI
80
-
81
-	ec2-register bucket-name/photon-ami.raw.manifest.xml --name name --architecture x86_64 --virtualization-type hvm
82
-
83
-You can now launch instances using the AWS console.
84
-
85
-For more information, see [Customizing a Photon OS Machine on EC2](photon-admin-guide.md#customizing-a-photon-os-machine-on-ec2).
86
-
87
-
88
-<!--
89
-##AZURE
90
-
91
-Install the [Azure CLI] (https://www.npmjs.com/package/azure)
92
-
93
-Install [QEMU](https://en.wikibooks.org/wiki/QEMU/Installing_QEMU)
94
-
95
-####Create the image
96
-azure vm image create image_name path_to_vhd -l "West US" -o linux
97
-
98
-Create running VM instances using Azure management portal
99
-
100
-###OVA
101
-
102
-The OVA image uses an optimized version of the 4.4.8 Linux kernel. Two ova files are generated from the build: photon-ova.ova, which is the full version of Photon OS, and photon-custom.ova, which is the minimal version of Photon OS. The password for photon-ova.ova should be changed using guest customization options when you upload it to VMware vCenter. Photon-custom.ova comes with the default password set to `changeme`; you must change it the first time you log in.
103
-
104
-#### OVA Prerequisites
105
-
106
-[VDDK 6.0](https://developercenter.vmware.com/web/sdk/60/vddk)
107
-
108
-To utilize the VDDK libraries the following procedure may be used, this extracts the libraries and temporarily exports them to the LD_LIBRARY_PATH for the *current session*.  (tested on Ubuntu 1404 & 1604)  If you wish to make this permenant and system-wide then you may want to create a config file in /etc/ld.so.conf.d/.
109
-
110
-    tar -zxf VMware-vix-disklib-6.0.2-3566099.x86_64.tar.gz
111
-    cp -r vmware-vix-disklib-distrib/include/* /usr/include/
112
-    mkdir /usr/lib/vmware
113
-    cp -a ~/vmware-vix-disklib-distrib/lib64/* /usr/lib/vmware/
114
-    rm /usr/lib/vmware/libstdc++.so.6
115
-    export LD_LIBRARY_PATH=/usr/lib/vmware
116
-
117
-[OVFTOOL](https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL410&productId=491)
118
-
119
-OVF Tool should be downloaded and installed on the host.
120
-
121
-    sh VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle --eulas-agreed --required
122
-
123
-<!-- 
124
-##Photon Bosh
125
-
126
-Please refer [bosh docs] (http://bosh.io/docs) to deploy BOSH on Photon 
127
-
128
-
129
-
130 1
deleted file mode 100644
... ...
@@ -1,79 +0,0 @@
1
-# Overview
2
-=================
3
-```cloud-init``` is a multi-distribution package that handles early initialization of a cloud instance.
4
-
5
-In-depth documentation for cloud-init is available here:
6
-
7
-[https://cloudinit.readthedocs.org/en/latest/](https://cloudinit.readthedocs.org/en/latest/)
8
-
9
-Supported installations
10
-=================
11
-
12
-Both the full version of and the minimal version of Photon OS support cloud-init. 
13
-
14
-Supported capabilities
15
-=================
16
-
17
-Photon OS supports the following cloud-init capabilities:
18
-
19
-
20
-* run commands: execute a list of commands with output to console.
21
-* configure ssh keys: add an entry to ~/.ssh/authorized_keys for the configured user.
22
-* install package: install additional packages on first boot.
23
-* configure networking: update /etc/hosts, hostname, etc.
24
-* write files: write arbitrary files to disk.
25
-* add yum repository: add a yum repository to /etc/yum.repos.d.
26
-* create groups and users: add groups and users to the system and set properties for them. 
27
-* run yum upgrade: upgrade all packages.
28
-* reboot: reboot or power off when done with cloud-init.
29
-
30
-
31
-Getting Started
32
-=================
33
-The Amazon Machine Image of Photon OS has an ```ec2 datasource``` turned on by default so an ```ec2``` configuration is accepted.
34
-However, for testing, the following methods provide ways to do ```cloud-init``` with a standalone instance of Photon OS.
35
-
36
-Using a Seed ISO
37
-This will be using the ```nocloud``` data source. In order to initialize the system in this way, an ISO file needs to be created with a meta-data file and an user-data file as shown below:
38
-```
39
-$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
40
-$ printf "#cloud-config\nhostname: testhost\n" > user-data
41
-$ genisoimage  -output seed.iso -volid cidata -joliet -rock user-data meta-data
42
-```
43
-
44
-Attach the `seed.iso` generated above to your machine and reboot for the init to take effect.
45
-In this case, the hostname is set to ```testhost```.
46
-
47
-Using a Seed Disk File
48
-To init using local disk files, do the following:
49
-```
50
-mkdir /var/lib/cloud/seed/nocloud
51
-cd /var/lib/cloud/seed/nocloud
52
-$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
53
-$ printf "#cloud-config\nhostname: testhost\n" > user-data
54
-```
55
-Reboot the machine and the hostname will be set to `testhost`.
56
-
57
-Frequencies
58
-Cloud-init modules have predetermined frequencies. Based on the frequency setting, multiple runs will yield different results. For the scripts to always run, remove the `instances` directory before rebooting.
59
-```
60
-rm -rf /var/lib/cloud/instances
61
-```
62
-
63
-Module Frequency Info
64
-Name                  |  Frequency
65
-disable_ec2_metadata  | Always
66
-users_groups          | Instance
67
-write_files           | Instance
68
-update_hostname       | Always
69
-final_message         | Always
70
-resolv_conf           | Instance
71
-growpart              | Always
72
-update_etc_hosts      | Always
73
-power_state_change    | Instance
74
-phone_home            | Instance
75 1
deleted file mode 100644
76 2
Binary files a/docs/images/resetpw.png and /dev/null differ
77 3
deleted file mode 100644
78 4
Binary files a/docs/images/top-in-photon-os.png and /dev/null differ
79 5
deleted file mode 100644
80 6
Binary files a/docs/images/watchcmd.png and /dev/null differ
... ...
@@ -6,14 +6,12 @@
6 6
 -   [Introduction](introduction.md)
7 7
 - [Photon OS Packages](photon_os_packages.md)
8 8
     -   [Examining the Packages in the SPECS Directory on Github](examining_packages_spec_dir.md)
9
-    -   [Looking at the Differences Between the Minimal and the Full
10
-        Version](differences_between_minimal_and_full_version.md)
9
+    -   [Looking at the Differences Between the Minimal and the Full Version](differences_between_minimal_and_full_version.md)
11 10
     -   [The Root Account and the `sudo` and `su` Commands](root_account_and_sudo_commands.md)
12 11
     -   [Photon OS Package Repositories](photon-os-package-repositories.md)
13 12
     -   [Examining Signed Packages](signed-packages.md)
14 13
     -   [Building a Package from a Source RPM](building-a-package-from-a-source-rpm.md)
15
-    -   [Compiling C++ Code on the Minimal Version of Photon
16
-        OS](compiling-c-code-on-the-minimal-version-of-photon-os.md)        
14
+    -   [Compiling C++ Code on the Minimal Version of Photon OS](compiling-c-code-on-the-minimal-version-of-photon-os.md)        
17 15
 - [Package Management in Photon OS with `tdnf`](package_management.md)  
18 16
     - [Introduction to `tdnf`](tdnf.md)
19 17
     - [Configuration Files and Repositories](configuration-files-and-repositories.md)
... ...
@@ -23,28 +21,20 @@
23 23
     - [Standard Syntax for `tdnf` Commands](standard_tdnf_syntax.md)
24 24
         -   [Options for Commands](options-for-commands.md)
25 25
         -   [Commands](commands.md)
26
-- [Managing Services with
27
-    systemd](managing-services-with-systemd.md)
26
+- [Managing Services with systemd](managing-services-with-systemd.md)
28 27
     -   [Viewing Services](viewing-services.md)
29 28
     -   [Controlling Services](controlling-services.md)
30 29
     -   [Creating a Startup Service](creating-a-startup-service.md)
31
-    -   [Disabling the Photon OS
32
-        httpd.service](disabling-the-photon-os-httpd.service.md)
33
-    -   [Auditing System Events with
34
-        auditd](auditing-system-events-with-auditd.md)
35
-    -   [Analyzing systemd Logs with
36
-        journalctl](analyzing-systemd-logs-with-journalctl.md)
37
-    -   [Migrating Scripts to
38
-        systemd](migrating-scripts-to-systemd.md)
30
+    -   [Disabling the Photon OS httpd.service](disabling-the-photon-os-httpd.service.md)
31
+    -   [Auditing System Events with auditd](auditing-system-events-with-auditd.md)
32
+    -   [Analyzing systemd Logs with journalctl](analyzing-systemd-logs-with-journalctl.md)
33
+    -   [Migrating Scripts to systemd](migrating-scripts-to-systemd.md)
39 34
     -   [Installing Sendmail](installing-sendmail.md)        
40
--   [Managing the Network
41
-    Configuration](managing-the-network-configuration.md)
35
+-   [Managing the Network Configuration](managing-the-network-configuration.md)
42 36
     -   [Commands to Manage Network Service](network_management_commands.md)
43 37
     -   [Using the Network Configuration Manager](using-the-network-configuration-manager.md)
44
-    -   [Use `ip` and `ss` Commands Instead of `ifconfig` and
45
-        `netstat`](use-ip-and-ss-commands.md)
46
-    -   [Configuring Network
47
-        Interfaces](configuring-network-interfaces.md)
38
+    -   [Use `ip` and `ss` Commands Instead of `ifconfig` and `netstat`](use-ip-and-ss-commands.md)
39
+    -   [Configuring Network Interfaces](configuring-network-interfaces.md)
48 40
     -   [Setting a Static IP Address](setting-a-static-ip-address.md)
49 41
     -   [Turning Off DHCP](turning-off-dhcp.md)
50 42
     -   [Adding a DNS Server](adding-a-dns-server.md)
... ...
@@ -59,13 +49,11 @@
59 59
     - [Network Configuration Manager - C API](netmgr.c.md)
60 60
     - [Network Configuration Manager - Python API](netmgr.python.md)        
61 61
 -   [Cloud-Init on Photon OS](cloud-init-on-photon-os.md)
62
+    - [Cloud-Init Overview](cloud-init.md)
62 63
     - [Deploy Photon OS With cloud-init](deploy_photon_with_cloud-init.md)
63
-    - [Creating a Stand-Alone Photon Machine with
64
-        cloud-init](creating-a-stand-alone-photon-machine-with-cloud-init.md)
65
-    -   [Customizing a Photon OS Machine on
66
-        EC2](customizing-a-photon-os-machine-on-ec2.md)
67
-    -   [Running a Photon OS Machine on
68
-        GCE](running-a-photon-os-machine-on-gce.md)
64
+    - [Creating a Stand-Alone Photon Machine with cloud-init](creating-a-stand-alone-photon-machine-with-cloud-init.md)
65
+    -   [Customizing a Photon OS Machine on EC2](customizing-a-photon-os-machine-on-ec2.md)
66
+    -   [Running a Photon OS Machine on GCE](running-a-photon-os-machine-on-gce.md)
69 67
 -   [Containers](photon_os_containers.md)
70 68
     -   [Docker Containers](docker-containers.md)
71 69
     -   [Kubernetes](kubernetes.md)
... ...
@@ -2,6 +2,7 @@
2 2
 
3 3
 The minimal and full versions of Photon OS include the cloud-init service as a built-in component. Cloud-init is a set of Python scripts that initialize cloud instances of Linux machines. The cloud-init scripts configure SSH keys and run commands to customize the machine without user interaction. The commands can set the root password, create a hostname, configure networking, write files to disk, upgrade packages, run custom scripts, and restart the system. 
4 4
 
5
+- [Cloud-Init Overview](cloud-init.md)
5 6
 - [Deploy Photon OS With cloud-init](deploy_photon_with_cloud-init.md)
6 7
 - [Creating a Stand-Alone Photon Machine with cloud-init](creating-a-stand-alone-photon-machine-with-cloud-init.md)
7 8
 - [Customizing a Photon OS Machine on EC2](customizing-a-photon-os-machine-on-ec2.md)
8 9
new file mode 100644
... ...
@@ -0,0 +1,79 @@
0
+# Cloud-Init Overview
1
+=================
2
+```cloud-init``` is a multi-distribution package that handles early initialization of a cloud instance.
3
+
4
+In-depth documentation for cloud-init is available here:
5
+
6
+[https://cloudinit.readthedocs.org/en/latest/](https://cloudinit.readthedocs.org/en/latest/)
7
+
8
+Supported installations
9
+=================
10
+
11
+Both the full version of and the minimal version of Photon OS support cloud-init. 
12
+
13
+Supported capabilities
14
+=================
15
+
16
+Photon OS supports the following cloud-init capabilities:
17
+
18
+
19
+* run commands: execute a list of commands with output to console.
20
+* configure ssh keys: add an entry to ~/.ssh/authorized_keys for the configured user.
21
+* install package: install additional packages on first boot.
22
+* configure networking: update /etc/hosts, hostname, etc.
23
+* write files: write arbitrary files to disk.
24
+* add yum repository: add a yum repository to /etc/yum.repos.d.
25
+* create groups and users: add groups and users to the system and set properties for them. 
26
+* run yum upgrade: upgrade all packages.
27
+* reboot: reboot or power off when done with cloud-init.
28
+
29
+
30
+Getting Started
31
+=================
32
+The Amazon Machine Image of Photon OS has an ```ec2 datasource``` turned on by default so an ```ec2``` configuration is accepted.
33
+However, for testing, the following methods provide ways to do ```cloud-init``` with a standalone instance of Photon OS.
34
+
35
+Using a Seed ISO
36
+----------------
37
+This will be using the ```nocloud``` data source. In order to initialize the system in this way, an ISO file needs to be created with a meta-data file and an user-data file as shown below:
38
+```
39
+$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
40
+$ printf "#cloud-config\nhostname: testhost\n" > user-data
41
+$ genisoimage  -output seed.iso -volid cidata -joliet -rock user-data meta-data
42
+```
43
+
44
+Attach the `seed.iso` generated above to your machine and reboot for the init to take effect.
45
+In this case, the hostname is set to ```testhost```.
46
+
47
+Using a Seed Disk File
48
+----------------
49
+To init using local disk files, do the following:
50
+```
51
+mkdir /var/lib/cloud/seed/nocloud
52
+cd /var/lib/cloud/seed/nocloud
53
+$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
54
+$ printf "#cloud-config\nhostname: testhost\n" > user-data
55
+```
56
+Reboot the machine and the hostname will be set to `testhost`.
57
+
58
+Frequencies
59
+-----------
60
+Cloud-init modules have predetermined frequencies. Based on the frequency setting, multiple runs will yield different results. For the scripts to always run, remove the `instances` directory before rebooting.
61
+```
62
+rm -rf /var/lib/cloud/instances
63
+```
64
+
65
+Module Frequency Info
66
+------------------------------------
67
+Name                  |  Frequency
68
+----------------------|-------------
69
+disable_ec2_metadata  | Always
70
+users_groups          | Instance
71
+write_files           | Instance
72
+update_hostname       | Always
73
+final_message         | Always
74
+resolv_conf           | Instance
75
+growpart              | Always
76
+update_etc_hosts      | Always
77
+power_state_change    | Instance
78
+phone_home            | Instance
... ...
@@ -13,6 +13,6 @@ The Network Configuration Manager library that ships with Photon OS 2.0 provides
13 13
 
14 14
 For more information, see:
15 15
 
16
-- **CLI** - see the ``-net`` commands in the [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md)
16
+- **CLI** - see the ``-net`` commands in the [Photon Management Daemon Command-line Interface (pmd-cli)](photon_cli/pmd-cli.md)
17 17
 - **C APIs** - [Network Configuration Manager - C API](netmgr.c.md)
18 18
 - **Python APIs** - [Network Configuration Manager - Python API](netmgr.python.md)
19 19
\ No newline at end of file
20 20
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+# Command-Line Reference
1
+
2
+The Photon OS *Command-Line Reference* provides information about the command-line interfaces available in Photon OS.
3
+
4
+**Product version: 3.0**
5
+
6
+This documentation applies to all 3.0.x releases.
7
+
8
+## Intended Audiences
9
+
10
+This information is intended for Photon OS administrators and users.
11
+
12
+----------
13
+
14
+Copyright &copy; 2016-2018 VMware, Inc. All rights reserved. [Copyright and trademark information](http://pubs.vmware.com/copyright-trademark.html). Any feedback you provide to VMware is subject to the terms at [www.vmware.com/community_terms.html](http://www.vmware.com/community_terms.html).
15
+
16
+**VMware, Inc.**<br>
17
+3401 Hillview Ave.<br>
18
+Palo Alto, CA 94304
19
+
20
+[www.vmware.com](http://www.vmware.com)
0 21
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+# Summary
1
+
2
+## Photon OS 3.0
3
+
4
+----
5
+
6
+- [Command-Line Interface Reference](README.md)
7
+    - [Command-line Interfaces](command-line_interfaces.md)
8
+        - [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md)
9
+        - [Photon Network Manager Command-line Interface (netmgr)](netmgr-cli.md)
0 10
\ No newline at end of file
1 11
new file mode 100644
... ...
@@ -0,0 +1,6 @@
0
+# Command-line Interfaces
1
+
2
+Photon OS includes the following command-line utilities:
3
+
4
+- [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md). The pmd-cli utility enables Photon customers to invoke API requests securely on local and remote servers. 
5
+- [Photon Network Manager Command-line Interface (netmgr)](netmgr-cli.md). A command line interface to manage network configuration of the system.
0 6
new file mode 100644
... ...
@@ -0,0 +1,239 @@
0
+# Photon Network Manager Command-line Interface (netmgr)
1
+
2
+For locally logged-on users, Photon OS provides a command line interface to manage network configuration of the system.
3
+
4
+- [Setup Steps](#setup-steps)
5
+- [Syntax](#syntax)
6
+- [Network Manager CLI](#network-manager-cli)
7
+
8
+# Setup Steps
9
+
10
+The netmgr tool is included with your Photon OS distribution. To make sure that you have the latest version, you can run:
11
+~~~~
12
+tdnf install netmgmt
13
+~~~~
14
+# Syntax
15
+The CLI is built on set, get, add, delete command model and uses the option-name - option-value model of specifying command parameters.
16
+~~~~
17
+netmgr <network object> <--get | --set | --add | --del> <command options>
18
+~~~~
19
+Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&quot;) as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether.
20
+
21
+## network object
22
+
23
+``<network object>`` is one of the following values:
24
+
25
+- ``link_info``
26
+- ``ip4_address``
27
+- ``ip6_address``
28
+- ``ip_route``
29
+- ``dns_servers``
30
+- ``dns_domains``
31
+- ``dhcp_duid``
32
+- ``if_iaid``
33
+- ``ntp_servers``
34
+- ``hostname``
35
+- ``wait_for_link``
36
+- ``wait_for_ip``
37
+- ``error_info``
38
+- ``net_info``
39
+
40
+# Network Manager CLI
41
+
42
+## link_info
43
+
44
+Get the mac address, MTU, link state, and link mode for the (optionally) specified interface.
45
+~~~~
46
+netmgr link_info --get --interface <ifname>
47
+~~~~
48
+Set the MAC address, link state (up or down), link mode (manual or auto), or MTU for the specified interface.
49
+~~~~
50
+netmgr link_info --set --interface <ifname> --macaddr <mac_address>
51
+netmgr link_info --set --interface <ifname> --mode <manual|auto>
52
+netmgr link_info --set --interface <ifname> --state <up|down>
53
+netmgr link_info --set --interface <ifname> --mtu <mtu>
54
+~~~~
55
+## ip4_address
56
+
57
+Get the IPv4 address for the specified interface.
58
+~~~~
59
+netmgr ip4_address --get --interface <ifname>
60
+~~~~
61
+Set the IPv4 address (dot-decimal/prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
62
+~~~~
63
+netmgr ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <ipv4_address/prefix> --gateway <gateway_address>
64
+~~~~
65
+## ip6_address
66
+
67
+Get IPv6 addresses for the specified interface.
68
+~~~~
69
+netmgr ip6_address --get --interface <ifname>
70
+~~~~
71
+Add one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) to the specified interface.
72
+~~~~
73
+netmgr ip6_address --add --interface <ifname> --addrlist <ipv6_addr1/prefix,ipv6_addr2/prefix,...>
74
+~~~~
75
+Delete one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) from the specified interface.
76
+~~~~
77
+netmgr ip6_address --del --interface <ifname> --addrlist <ipv6_addr1/prefix,ipv6_addr2/prefix,...>
78
+~~~~
79
+Set the IPv6 DHCP mode (1=enable, 0=disable) and IPv6 auto-configuration settings (1=enable, 0=disable) for the specified interface.
80
+~~~~
81
+netmgr ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0>
82
+~~~~
83
+## ip_route
84
+
85
+Get the static IP route for the specified interface.
86
+~~~~
87
+netmgr ip_route --get --interface <ifname>
88
+~~~~
89
+Add the static IP route (gateway IP, destination network, and metric) to the specified interface.
90
+~~~~
91
+netmgr ip_route --add --interface <ifname> --gateway <gateway_address> --destination <destination_network/prefix> --metric <N>
92
+~~~~
93
+Delete the specified static IP route from the specified interface.
94
+~~~~
95
+netmgr ip_route --del --interface <ifname> --destination <destination_network/prefix>
96
+~~~~
97
+## dns_servers
98
+
99
+Get the list of DNS servers.
100
+~~~~
101
+netmgr dns_servers --get
102
+~~~~
103
+Set the DNS mode (DHCP or static) for one or more DNS servers (comma-separated list).
104
+~~~~
105
+netmgr dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
106
+~~~~
107
+Add a DNS server to the list of DNS servers.
108
+~~~~
109
+netmgr dns_servers --add --servers <server>
110
+~~~~
111
+Remove the specified DNS server from the list of DNS servers.
112
+~~~~
113
+netmgr dns_servers --del --servers <server>
114
+~~~~
115
+## dns_domains
116
+
117
+Get the list of DNS domains.
118
+~~~~
119
+netmgr dns_domains --get
120
+~~~~
121
+Set the list of DNS domains (one or more DNS domains in a comma-separated list).
122
+~~~~
123
+netmgr dns_domains --set --domains <domain1,domain2,...>
124
+~~~~
125
+Add a DNS domain to the list of DNS domains.
126
+~~~~
127
+netmgr dns_domains --add --domains <domain>
128
+~~~~
129
+Delete a DNS domain from the list of DNS domains.
130
+~~~~
131
+netmgr dns_domains --del --domains <domain>
132
+~~~~
133
+## dhcp_duid
134
+
135
+Get the DHCP DUID (optionally interface-specific DUID) for the system.
136
+~~~~
137
+netmgr dhcp_duid --get
138
+~~~~
139
+Set the DHCP DUID for the system, optionally per-interface if the interface is specified.
140
+~~~~
141
+netmgr dhcp_duid --set --duid <duid>
142
+~~~~
143
+## if_iaid
144
+
145
+Get the IAID for the specified interface.
146
+~~~~
147
+netmgr if_iaid --get --interface <ifname>
148
+~~~~
149
+Set the IAID for the specified interface.
150
+~~~~
151
+netmgr if_iaid --set --interface <ifname> --iaid <iaid>
152
+~~~~
153
+## ntp_servers
154
+
155
+Get the NTP servers list.
156
+~~~~
157
+netmgr ntp_servers --get
158
+~~~~
159
+Set the NTP servers list.
160
+~~~~
161
+netmgr ntp_servers --set --servers <server1,server2,...>
162
+~~~~
163
+Add the specified server to the NTP servers list.
164
+~~~~
165
+netmgr ntp_servers --add --servers <server>
166
+~~~~
167
+Delete the specified server from the NTP servers list.
168
+~~~~
169
+netmgr ntp_servers --del --servers <server>
170
+~~~~
171
+## hostname
172
+
173
+Get the system hostname.
174
+~~~~
175
+netmgr hostname --get
176
+~~~~
177
+Set the system hostname.
178
+~~~~
179
+netmgr hostname --set --name <hostname>
180
+~~~~
181
+## wait_for_link
182
+
183
+Wait for the specified network interface to be up and usable (it can send and receive packets).
184
+~~~~
185
+netmgr wait_for_link --interface <ifname> --timeout <timeout>
186
+~~~~
187
+The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
188
+
189
+**Note:** You might need to use wait_for_ip to wait until you can send and receive IP packets.
190
+
191
+## wait_for_ip
192
+
193
+Wait for the specified interface to acquire a valid IP address for the specified address type.
194
+~~~~
195
+netmgr wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6>
196
+~~~~
197
+The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
198
+
199
+## error_info
200
+
201
+Get error information about the specified error code.
202
+~~~~
203
+netmgr error_info --errcode <error_code>
204
+~~~~
205
+Here is a list of error codes:
206
+
207
+- 4097 - invalid parameter
208
+- 4098 - not supported
209
+- 4099 - out of memory
210
+- 4100 - value not found
211
+- 4101 - value exists
212
+- 4102 - invalid interface
213
+- 4103 - invalid mode
214
+- 4104 - bad configuration file
215
+- 4105 - write failed
216
+- 4106 - timeout
217
+- 4107 - DCHP timeout
218
+
219
+## net_info
220
+
221
+Get the specified network configuration parameter for the specified object.
222
+~~~~
223
+netmgr net_info --get --object <ifname or filename> --paramname <param_name>
224
+~~~~
225
+**Note:** The object can be an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf).
226
+
227
+Set the value of the specified network configuration parameter for the specified object (interface or file).
228
+~~~~
229
+netmgr net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value>
230
+~~~~
231
+**Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -.
232
+
233
+For example, in order to add static IPv4 address "10.10.10.1/24" to eth0 interface, the following command adds this **Address** to the **Network** section of the **eth0** network configuration file.
234
+~~~~
235
+netmgr net_info --set --object eth0 --paramname +Network_Address --paramvalue "10.10.10.1/24"
236
+~~~~
237
+
238
+
0 239
new file mode 100644
... ...
@@ -0,0 +1,486 @@
0
+# Photon Management Daemon Command-line Interface (pmd-cli)
1
+
2
+Photon OS 2.0 provides the Photon Management Daemon command line interface (pmd-cli).
3
+
4
+- [Setup Steps](#setup-steps)
5
+- [Syntax](#syntax)
6
+- [Firewall Management](#firewall-management)
7
+- [Network Management](#network-management)
8
+- [Package Management](#package-management)
9
+- [User Management](#user-management)
10
+
11
+# Setup Steps
12
+
13
+The pmd-cli utility is included with your Photon OS 2.0 distribution. To make sure that you have the latest version, you can run:
14
+~~~~
15
+tdnf install pmd-cli
16
+~~~~
17
+# Syntax
18
+~~~~
19
+pmd-cli [connection_auth_options] <component> <command> [command_options]
20
+~~~~
21
+Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&quot;) as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether.
22
+
23
+## Connection / Authorization Options
24
+
25
+### Local Connections
26
+
27
+For local connections, you omit the connection and authorization options:
28
+~~~~
29
+pmd-cli <component> <cmd> <options>
30
+~~~~
31
+Permissions for the currently logged-in user apply when executing commands. This is the same as specifying --servername localhost.
32
+
33
+### Remote Connections
34
+
35
+For connecting to a remote server (a server other than the local server), you specify two connection / authorization options:
36
+
37
+- ``--servername``: name of the server
38
+- ``--user``: username of a user account on the server
39
+
40
+**Note:**  For authentication, you can specify the username (–user &lt;username&gt;) on the command line, but never the password. For security reasons, the system must prompt you for the password.
41
+
42
+What follows are three options for remote connections.
43
+
44
+**System User**
45
+~~~~
46
+pmd-cli --servername <server> --user <username>
47
+~~~~
48
+**Lightwave User**
49
+
50
+Before using this method, the pmd server must be joined or should be part of embedded Lightwave.
51
+~~~~
52
+pmd-cli --servername <server> --user <username> --domain <lightwave_domain>
53
+~~~~
54
+**Kerberos spn**
55
+
56
+Before using this method, the client must run kinit successfully.
57
+~~~~
58
+pmd-cli --servername <server> --spn <service_principal_name>
59
+~~~~
60
+## Component
61
+
62
+``<component>`` is one of the following values:
63
+
64
+- ``firewall``
65
+- ``net``
66
+- ``pkg``
67
+- ``usr``
68
+
69
+# Firewall Management
70
+
71
+The Photon Management Daemon provides CLI commands to help you get information about the firewall.
72
+
73
+## Syntax
74
+~~~~
75
+pmd-cli [connection_auth_options] firewall <command> [command_options]
76
+~~~~
77
+## firewall help
78
+
79
+Get help for firewall CLI commands.
80
+~~~~
81
+pmd-cli firewall help
82
+~~~~
83
+## firewall rules
84
+
85
+Get a list of the current persistent firewall rules.
86
+~~~~
87
+pmd-cli firewall rules [command-options]
88
+~~~~
89
+This command returns information about each firewall rule, such as the chain to which it belongs, the policy to enforce, the table to manipulate, and so on.
90
+
91
+Add a new firewall rule.
92
+~~~~
93
+pmd-cli firewall rules --chain <chain_name> --add <rule_specification>
94
+~~~~
95
+Example:
96
+~~~~
97
+pmd-cli firewall rules --chain INPUT --add "-p tcp -m tcp --dport 21 -j ACCEPT"
98
+~~~~
99
+**Note:** To confirm that the firewall rule was added, run iptables -S. Running pmd-cli firewall rules lists only persistent rules.
100
+
101
+Delete a new firewall rule.
102
+~~~~
103
+pmd-cli firewall rules --chain <chain_name> --delete <rule_specification>
104
+~~~~
105
+**Note:**  To confirm that the firewall rule was removed, run iptables -S. Running pmd-cli firewall rules lists only persistent rules.
106
+
107
+Make firewall rule changes peristent (add --persist flag)
108
+~~~~
109
+pmd-cli firewall rules --chain <chain_name> --add <rule_specification> --persist
110
+~~~~
111
+
112
+## firewall version
113
+
114
+Get the version number of the fwmgmt component on the server.
115
+~~~~
116
+pmd-cli firewall version
117
+~~~~
118
+# Network Management
119
+
120
+The Photon Management Daemon provides CLI commands to help you manage network interfaces.
121
+
122
+## Syntax
123
+~~~~
124
+pmd-cli [connection_auth_options] net <command> [command_options]
125
+~~~~
126
+Many of these commands require the interface name (–interface &lt;ifname&gt;). Command options are described below.
127
+
128
+## net link_info
129
+
130
+Get the mac address, mtu, link state, and link mode for the specified interface.
131
+~~~~
132
+pmd-cli net link_info --get --interface <ifname>
133
+~~~~
134
+Set the MAC address, mode (manual or auto), link state (up or down), link mode (manual or auto), and MTU for the specified interface.
135
+~~~~
136
+pmd-cli net link_info --set --interface <ifname> --macaddr <mac_address> --mode <manual|auto> --state <up|down> --mtu <mtu>
137
+~~~~
138
+## net ip4_address
139
+
140
+Get the IPv4 address for the specified interface.
141
+~~~~
142
+pmd-cli net ip4_address --get --interface <ifname>
143
+~~~~
144
+Set the IPv4 address (dot-decimal/prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
145
+~~~~
146
+pmd-cli net ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <IPv4Address/prefix> --gateway <gateway_address>
147
+~~~~
148
+## net ip6_address
149
+
150
+Get IPv6 address(es) for the specified interface.
151
+~~~~
152
+pmd-cli net ip6_address --get --interface <ifname>
153
+~~~~
154
+Add one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) to the specified interface.
155
+~~~~
156
+pmd-cli net ip6_address --add --interface <ifname> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...>
157
+~~~~
158
+Delete one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) from the specified interface.
159
+~~~~
160
+pmd-cli net ip6_address --del --interface <ifname> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...>
161
+~~~~
162
+Set the DHCP mode (1=enable, 0=disable) and autoconfigure settings (1=enable, 0=disable) for the specified interface.
163
+~~~~
164
+pmd-cli net ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0>
165
+~~~~
166
+## net ip_route
167
+
168
+Get the static IP route for the specified interface.
169
+~~~~
170
+pmd-cli net ip_route --get --interface <ifname>
171
+~~~~
172
+Add the static IP route (gateway IP, destination network, and metric) to the specified interface.
173
+~~~~
174
+pmd-cli net ip_route --add --interface <ifname> --gateway <GatewayIP> --destination <DestinationNetwork/prefix> --metric <N>
175
+~~~~
176
+Delete the specified static IP route from the specified interface.
177
+~~~~
178
+pmd-cli net ip_route --del --interface <ifname> --destination <DestinationNetwork/prefix>
179
+~~~~
180
+## net dns_servers
181
+
182
+Get the list of DNS servers.
183
+~~~~
184
+pmd-cli net dns_servers --get
185
+~~~~
186
+Set the DNS mode (dhcp or static) for one or more DNS servers (comma-separated list).
187
+~~~~
188
+pmd-cli net dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
189
+~~~~
190
+Add a DNS server to the list of DNS servers.
191
+~~~~
192
+pmd-cli net dns_servers --add --servers <server>
193
+~~~~
194
+Remove the specified DNS server from the list of DNS servers.
195
+~~~~
196
+pmd-cli net dns_servers --del --servers <server>
197
+~~~~
198
+## net dns_domains
199
+
200
+Get the list of DNS domains.
201
+~~~~
202
+pmd-cli net dns_domains --get
203
+~~~~
204
+Set the list of DNS domains (one or more DNS domains in a comma-separated list).
205
+~~~~
206
+pmd-cli net dns_domains --set --domains <domain1,domain2,...>
207
+~~~~
208
+Add a DNS domain to the list of DNS domains.
209
+~~~~
210
+pmd-cli net dns_domains --add --domains <domain1>
211
+~~~~
212
+Delete a DNS domain from the list of DNS domains.
213
+~~~~
214
+pmd-cli net dns_domains --del --domains <domain1>
215
+~~~~
216
+## net dhcp_duid
217
+
218
+Get the DHCP DUID (optionally interface-specific DUID) for the system.
219
+~~~~
220
+pmd-cli net dhcp_duid --get
221
+~~~~
222
+Set the DHCP DUID for the system, optionally per-interface if the interface is specified.
223
+~~~~
224
+pmd-cli net dhcp_duid --set --duid <duid>
225
+~~~~
226
+## net if_iaid
227
+
228
+Get the IAID for the specified interface.
229
+~~~~
230
+pmd-cli net if_iaid --get --interface <ifname>
231
+~~~~
232
+Set the IAID for the specified interface.
233
+~~~~
234
+pmd-cli net if_iaid --set --interface <ifname> --iaid <iaid>
235
+~~~~
236
+## net ntp_servers
237
+
238
+Get the NTP servers list.
239
+~~~~
240
+pmd-cli net ntp_servers --get
241
+~~~~
242
+Set the NTP servers list.
243
+~~~~
244
+pmd-cli net ntp_servers --set --servers <server1,server2,...>
245
+~~~~
246
+Add the specified server to the NTP servers list.
247
+~~~~
248
+pmd-cli net ntp_servers --add --servers <server>
249
+~~~~
250
+Delete the specified server from the NTP servers list.
251
+~~~~
252
+pmd-cli net ntp_servers --del --servers <server>
253
+~~~~
254
+## net hostname
255
+
256
+Get the system hostname.
257
+~~~~
258
+pmd-cli net hostname --get
259
+~~~~
260
+Set the system hostname.
261
+~~~~
262
+pmd-cli net hostname --set --name <hostname>
263
+~~~~
264
+## net wait_for_link
265
+
266
+Wait for the specified network interface to be up and usable (it can send and receive packets).
267
+~~~~
268
+pmd-cli net wait_for_link --interface <ifname> --timeout <timeout>
269
+~~~~
270
+The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
271
+
272
+**Note:** You might need to use net wait_for_ip to wait until you can send and receive IP packets.
273
+
274
+## net wait_for_ip
275
+
276
+Wait for the specified interface to acquire a valid IP address for the specified address type.
277
+~~~~
278
+pmd-cli net wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6>
279
+~~~~
280
+The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
281
+
282
+## net error_info
283
+
284
+Get error information about the specified error code.
285
+~~~~
286
+pmd-cli net error_info --errcode <error_code>
287
+~~~~
288
+Here is a list of error codes:
289
+
290
+- 4097 - invalid parameter
291
+- 4098 - not supported
292
+- 4099 - out of memory
293
+- 4100 - value not found
294
+- 4101 - value exists
295
+- 4102 - invalid interface
296
+- 4103 - invalid mode
297
+- 4104 - bad configuration file
298
+- 4105 - write failed
299
+- 4106 - timout
300
+- 4107 - DCHP timeout
301
+
302
+## net net_info
303
+
304
+Get the specified network configuration parameter for the specified object.
305
+~~~~
306
+pmd-cli net net_info --get --object <ifname or filename> --paramname <param_name>
307
+~~~~
308
+**Note:** The object can be an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf).
309
+
310
+Set the value of the specified network configuration parameter for the specified object (interface or file).
311
+~~~~
312
+pmd-cli net net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value>
313
+~~~~
314
+**Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -.
315
+
316
+# Package Management
317
+
318
+The Photon Management Daemon provides CLI commands to help you manage packages and repositories.
319
+
320
+## Syntax
321
+~~~~
322
+pmd-cli [connection options] pkg <command> [command options]
323
+~~~~
324
+If a command allows for multiple package names, simply specify on the command line, separated by spaces.
325
+~~~~
326
+pmd-cli pkg info <package_name_1> <package_name_2> <package_name_3> ...
327
+~~~~
328
+## pkg help
329
+
330
+Get help text for pkg CLI commands.
331
+~~~~
332
+pmd-cli pkg help
333
+~~~~
334
+## pkg count
335
+
336
+Get the total number of packages in all repos (including installed).
337
+~~~~
338
+pmd-cli pkg count
339
+~~~~
340
+## pkg distro-sync
341
+
342
+Synchronize installed packages to the latest available versions. If no packages are specified, then all available packages are synchronized.
343
+~~~~
344
+pmd-cli pkg distro-sync
345
+~~~~
346
+## pkg downgrade
347
+
348
+Downgrade the specified package(s). If no packages are specified, then all available packages are downgraded.
349
+~~~~
350
+pmd-cli pkg downgrade <package_name>
351
+~~~~
352
+## pkg erase
353
+
354
+Remove the specified package(s).
355
+~~~~
356
+pmd-cli pkg erase <package_name>
357
+~~~~
358
+## pkg info
359
+
360
+Get general information about the specified package(s),  such as name, version, release, repository, install size, and so on.
361
+~~~~
362
+pmd-cli pkg info <package_name>
363
+~~~~
364
+If no packages are specified, then this command returns information about all packages.
365
+~~~~
366
+## pkg install
367
+~~~~
368
+Install the specified package(s). Update the package if an update is available.
369
+~~~~
370
+pmd-cli pkg install <package_name>
371
+~~~~
372
+## pkg list
373
+
374
+Get a list of packages or groups of packages.
375
+~~~~
376
+pmd-cli pkg list
377
+~~~~
378
+You can filter by group: all, available, installed, extras, obsoletes, recent, and upgrades.
379
+~~~~
380
+pmd-cli pkg list upgrades
381
+~~~~
382
+You can also filter by wildcards.
383
+~~~~
384
+pmd-cli pkg list ph\*
385
+~~~~
386
+## pkg reinstall
387
+
388
+Reinstall the specified package(s).
389
+~~~~
390
+pmd-cli pkg reinstall <package_name>
391
+~~~~
392
+## pkg repolist
393
+
394
+Get a list of the configured software repositories.
395
+~~~~
396
+pmd-cli pkg repolist
397
+~~~~
398
+This command returns a list of the configured software repositories, including the repository ID, repitory name, and status.
399
+
400
+## pkg update
401
+
402
+Update the specified package(s).
403
+~~~~
404
+pmd-cli pkg update <package_name>
405
+~~~~
406
+If no parameters are specified, then all available packages are updated.
407
+
408
+## pkg updateinfo
409
+
410
+Get the update information on all enabled repositories (status = enabled). If this command returns nothing, then the update information may not exist on the server.
411
+~~~~
412
+pmd-cli pkg updateinfo
413
+~~~~
414
+# User Management
415
+
416
+The Photon Management Daemon provides CLI commands to help you manage users and user groups.
417
+
418
+## Syntax
419
+~~~~
420
+pmd-cli [connection options] usr <command> [command options]
421
+~~~~
422
+## usr help
423
+
424
+Display help text for user commands.
425
+~~~~
426
+pmd-cli usr users
427
+~~~~
428
+## usr users
429
+
430
+Get a list of users. This command returns information about each user, including their user name, user ID, user group (if applicable), home directory, and default shell.
431
+~~~~
432
+pmd-cli usr users
433
+~~~~
434
+## usr useradd
435
+
436
+Add a new user. Specify the username.
437
+~~~~
438
+pmd-cli usr useradd <username>
439
+~~~~
440
+The system assigns a user ID, home directory, and default shell to the new user. The user group is unspecified.
441
+
442
+## usr userdel
443
+
444
+Delete the specified user.
445
+~~~~
446
+pmd-cli usr userdel <username>
447
+~~~~
448
+## usr userid
449
+
450
+Get the user ID of the specified user (by name). Used to determine whether the specified user exists.
451
+~~~~
452
+pmd-cli usr userid <username>
453
+~~~~
454
+## usr groups
455
+
456
+Get a list of user groups. This command returns the following information about each user group: user group name and user group ID.
457
+~~~~
458
+pmd-cli usr groups
459
+~~~~
460
+## usr groupadd
461
+
462
+Add a new user group.
463
+~~~~
464
+pmd-cli usr groupadd <user_group_name>
465
+~~~~
466
+The system assigns a group ID to the new user group.
467
+
468
+## usr groupdel
469
+
470
+Delete the specified user group.
471
+~~~~
472
+pmd-cli usr groupdel <user_group_name>
473
+~~~~
474
+## usr groupid
475
+
476
+Get the group ID for the specified user group (by name). Used to determine whether the specified user group exists.
477
+~~~~
478
+pmd-cli usr groupid <user_group_name>
479
+~~~~
480
+## usr version
481
+
482
+Get the version of the usermgmt component at the server.
483
+~~~~
484
+pmd-cli usr version
485
+~~~~
... ...
@@ -6,10 +6,32 @@ Photon OS is available in the following pre-packaged, binary formats.
6 6
 
7 7
 ## Download Formats ####
8 8
 
9
-| Format | Description |
10
-| --- | --- |
11
-| ISO Image | Contains everything needed to install either the minimal or full installation of Photon OS. The bootable ISO has a manual installer or can be used with PXE/kickstart environments for automated installations. |
12
-| OVA | Pre-installed minimal environment, customized for VMware hypervisor environments. These customizations include a highly sanitized and optimized kernel to give improved boot and runtime performance for containers and Linux applications. Since an OVA is a complete virtual machine definition, we've made available a Photon OS OVA that has virtual hardware version 11; this will allow for compatibility with several versions of VMware platforms or allow for the latest and greatest virtual hardware enhancements. |
13
-| Amazon AMI | Pre-packaged and tested version of Photon OS made ready to deploy in your Amazon EC2 cloud environment. Previously, we'd published documentation on how to create an Amazon compatible instance, but, now we've done the work for you. |
14
-| Google GCE Image | Pre-packaged and tested Google GCE image that is ready to deploy in your Google Compute Engine Environment, with all modifications and package requirements for running Photon OS in GCE. | 
15
-| Azure VHD | Pre-packaged and tested Azure HD image that is ready to deploy in your Microsoft Azure Cloud, with all modifications and package requirements for running Photon OS in Azure. |
16 9
\ No newline at end of file
10
+<table style="height: 170px;" border="1" cellspacing="0" cellpadding="10">
11
+<tbody>
12
+<tr>
13
+<td> Format </td><td> Description </td>
14
+</tr>
15
+<tr>
16
+<td> ISO Image </td>
17
+<td> Contains everything needed to install either the minimal or full installation of Photon OS. The bootable ISO has a manual installer or can be used with PXE/kickstart environments for automated installations. </td>
18
+</tr>
19
+<tr>
20
+<td> OVA </td>
21
+<td> Pre-installed minimal environment, customized for VMware hypervisor environments. These customizations include a highly sanitized and optimized kernel to give improved boot and runtime performance for containers and Linux applications. Since an OVA is a complete virtual machine definition, we've made available a Photon OS OVA that has virtual hardware version 11; this will allow for compatibility with several versions of VMware platforms or allow for the latest and greatest virtual hardware enhancements. </td>
22
+</tr>
23
+<tr>
24
+<td> Amazon AMI </td>
25
+<td> Pre-packaged and tested version of Photon OS made ready to deploy in your Amazon EC2 cloud environment. Previously, we'd published documentation on how to create an Amazon compatible instance, but, now we've done the work for you. </td>
26
+</tr>
27
+<tr>
28
+<td> Google GCE Image </td><td> Pre-packaged and tested Google GCE image that is ready to deploy in your Google Compute Engine Environment, with all modifications and package requirements for running Photon OS in GCE. </td>
29
+</tr>
30
+<tr>
31
+<td> Azure VHD </td>
32
+<td> Pre-packaged and tested Azure HD image that is ready to deploy in your Microsoft Azure Cloud, with all modifications and package requirements for running Photon OS in Azure. </td>
33
+</tr>
34
+</tbody>
35
+</table>
36
+
37
+
38
+For cloud-ready images of Photon OS, see [Compatible Cloud Images](cloud-images.md).
17 39
\ No newline at end of file
... ...
@@ -15,29 +15,29 @@
15 15
         * [Use Cached Sources](use_cached_sources.md)
16 16
         * [View Build Logs](view_build_logs.md)
17 17
     - [Running Photon OS on vSphere](Running-Photon-OS-on-vSphere.md)
18
-        - [Prerequisites](photon_os_vsphere_prerequisites.md)
18
+        - [Prerequisites for Running Photon OS on vSphere](photon_os_vsphere_prerequisites.md)
19 19
         - [Importing the OVA for Photon OS 3.0](importing_ova_for_photon_os_3.0.md)
20 20
         - [Installing the ISO Image for Photon OS 3.0](installing-the-iso-image-for-photon-os-30.md)
21 21
     - [Running Photon OS on Fusion](Running-Project-Photon-on-Fusion.md)
22
-        - [Prerequisites](photon_os_fusion_prerequisites.md)
23
-        - [Importing the OVA for Photon OS 3.0](importing-the-ova-for-photon-os-3.0-fusion.md)
22
+        - [Prerequisites for Running Photon OS on Fusion](photon_os_fusion_prerequisites.md)
23
+        - [Importing the OVA for Photon OS 3.0](importing-ova-for-photon-os-3.0-fusion.md)
24 24
         - [Installing the ISO Image for Photon OS 3.0](installing-the-iso-image-for-photon-os-30-fusion.md)
25 25
     - [Running Photon OS on Workstation](Running-Photon-OS-on-Workstation.md)
26
-        - [Prerequisites](photon_os_workstation_prerequisites.md)
26
+        - [Prerequisites for Running Photon OS on Workstation](photon_os_workstation_prerequisites.md)
27 27
         - [Importing the OVA for Photon OS 3.0](importing_ova_for_photon_os_3.0-workstation.md)
28 28
         - [Installing the ISO Image for Photon OS 2.0](installing-the-iso-image-for-photon-os-30-workstation.md)
29 29
     - [Running Photon OS on AWS EC2](Running-Photon-OS-on-Amazon-Elastic-Cloud-Compute.md)
30
-        - [Prerequisites](photon_os_ecc_prerequisites.md)
30
+        - [Prerequisites for Running Photon OS on AWS EC2](photon_os_ecc_prerequisites.md)
31 31
         - [Set Up Photon OS on EC2](set-up-PhotonOS-on-ec2.md)
32 32
         - [Deploy a Containerized Application in Photon OS using SSH](deploying-a-containerized-application-in-photon-os-ssh.md)
33 33
         - [Launch the Web Server with Cloud-Init](launch-web-server-with-cloud-init.md)
34 34
         - [Terminate the AMI Instance](terminate-the-ami-instance.md)
35 35
     - [Running Photon OS on Microsoft Azure](Running-Photon-OS-on-Microsoft-Azure.md)
36
-        - [Prerequisites](photon-os-azure-prerequisites.md)
36
+        - [Prerequisites for Running Photon OS on Azure](photon-os-azure-prerequisites.md)
37 37
         - [Set Up Azure Storage and Uploading the VHD](setting-up-azure-storage-and-uploading-the-vhd.md)
38 38
         - [Remove Photon OS From Azure](remove-photon-os-from-azure.md)
39 39
     - [Running Photon OS on Google Compute Engine](Running-Photon-OS-on-Google-Compute-Engine.md)
40
-        - [Prerequisites for Photon OS on GCE](photon-os-gce-prerequisites.md)
40
+        - [Prerequisites for running Photon OS on GCE](photon-os-gce-prerequisites.md)
41 41
         - [Installing Photon OS on Google Compute Engine](installing-photon-os-on-google-compute-engine.md)
42 42
     - [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os.md)
43 43
     - [Installing and Using Lightwave on Photon OS](Installing-and-Using-Lightwave-on-Photon-OS.md)
... ...
@@ -48,7 +48,4 @@
48 48
         - [Remotely Upgrade Multiple Photon OS Machines With Lightwave Client and Photon Management Daemon Installed](Remotely-Upgrade-Photon-OS-Machine-With-Lightwave-Client-and-Photon-Management-Daemon-Installed.md)
49 49
     - [Photon Management Daemon](using-the-photon-management-daemon.md)
50 50
         - [Installing the pmd Package](installing_pmd_package.md)
51
-        - [Available APIs](available_apis.md)
52
-    - [Command-line Interfaces](command-line_interfaces.md)
53
-        - [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md)
54
-        - [Photon Network Manager Command-line Interface (netmgr)](netmgr-cli.md)
55 51
\ No newline at end of file
52
+        - [Available APIs](available_apis.md)
56 53
\ No newline at end of file
57 54
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+# Upgrading the Kernel Version Requires Grub Changes for AWS and GCE Images
1
+
2
+If you upgrade the Photon OS Linux kernel with `tdnf upgrade linux`, you must modify the `/boot/grub2/grub.cfg` file to reflect the correct kernel version so that it works with AWS and GCE images. For example, if you install Photon OS 1.0 with kernel 4.4.8 and then upgrade the Linux kernel to 4.4.26, you must edit the /boot/grub2/grub.cfg file to replace the line containing `linux /boot/vmlinuz-4.4.8` with `linux /boot/vmlinuz-4.4.26`.
0 3
\ No newline at end of file
... ...
@@ -1,6 +1,6 @@
1 1
 # Build an ISO from the Source Code for Photon OS
2 2
 
3
-You can build an ISO from the source code for Photon OS. This section describes how to build the ISO, use the cached toolchain and RPMS, and cached sources.
3
+You can build an ISO from the source code for Photon OS. This section describes how to build the ISO, use the cached toolchain and RPMS, and cached sources. You can use this method as an alternative to downloading a pre-built version.
4 4
 
5 5
 * [Folder Layout](folder_layout.md)
6 6
 * [Build Prerequisites](build_prerequisites.md)
7 7
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# Building the ISO
1
+
2
+Perform the following steps to install the packages on Ubuntu: 
3
+
4
+1. Install the packages: 
5
+
6
+    ```
7
+    sudo apt-get -y install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests libfuse-dev libssl-dev uuid-dev libreadline-dev kpartx git bc
8
+    ```
9
+
10
+
11
+1. Get Docker:
12
+
13
+    ```
14
+    wget -qO- https://get.docker.com/ | sh
15
+    ```
16
+
17
+1. Make the ISO. The example below assumes that you checked out the workspace under `$HOME/workspaces/photon`:
18
+    ```
19
+    cd $HOME/workspaces/photon
20
+    sudo make iso
21
+    ```
22
+    
23
+**Result**
24
+
25
+The ISO is created at `$HOME/workspaces/photon/stage/photon.iso`.
0 26
\ No newline at end of file
1 27
deleted file mode 100644
... ...
@@ -1,26 +0,0 @@
1
-# Building the ISO
2
-
3
-Perform the following steps to install the packages on Ubuntu: 
4
-
5
-1. Install the packages: 
6
-
7
-    ```
8
-    sudo apt-get -y install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests libfuse-dev libssl-dev uuid-dev libreadline-dev kpartx git bc
9
-    ```
10
-
11
-
12
-1. Get Docker:
13
-
14
-    ```
15
-    wget -qO- https://get.docker.com/ | sh
16
-    ```
17
-
18
-1. Make the ISO. The example below assumes that you checked out the workspace under `$HOME/workspaces/photon`:
19
-    ```
20
-    cd $HOME/workspaces/photon
21
-    sudo make iso
22
-    ```
23
-    
24
-**Result**
25
-
26
-The ISO is created at `$HOME/workspaces/photon/stage/photon.iso`.
27 1
\ No newline at end of file
28 2
new file mode 100644
... ...
@@ -0,0 +1,132 @@
0
+# Compatible Cloud Images
1
+
2
+The [Bintray website](https://bintray.com/vmware/photon/) contains the following cloud-ready images of Photon OS: 
3
+
4
+1. GCE - Google Compute Engine
5
+
6
+1. AMI - Amazon Machine Image
7
+
8
+1. OVA
9
+
10
+Because the cloud-ready images of Photon OS are built to be compatible with their corresponding cloud platform or format, you typically do not need to build a cloud image--just go to Bintray and download the image for the platform that you are working on. 
11
+
12
+If, however, you want to build your own cloud image, perhaps because you seek to customize the code, see the next section on how to build cloud images.
13
+
14
+## How to build cloud images
15
+
16
+	sudo make cloud-image IMG_NAME=image-name
17
+
18
+	image-name: gce/ami/azure/ova
19
+
20
+The output of the build process produces the following file formats:
21
+
22
+GCE - A tar file consisting of disk.raw as the raw disk file 
23
+
24
+AMI - A raw disk file
25
+
26
+<!-- Azure - A vhd file -->
27
+
28
+OVA - An ova file (vmdk + ovf)
29
+
30
+If you want, you can build all the cloud images by running the following command: 
31
+
32
+	sudo make cloud-image-all 
33
+
34
+<!-- ###How to build Photon bosh-stemcell
35
+
36
+Please follow the link to [build](https://github.com/cloudfoundry/bosh/blob/develop/bosh-stemcell/README.md) Photon bosh-stemcell
37
+-->
38
+
39
+## How to create running instances in the cloud
40
+
41
+The following sections contain some high-level instructions on how to create instances of Photon OS in the Google Compute Engine (GCE) and Amazon Elastic Cloud Compute (EC2). For more information, see the Amazon or Google cloud documentation. 
42
+
43
+### GCE
44
+
45
+The tar file can be uploaded to Google's cloud storage and an instance can be created after creating an image from the tar file. You will need the Google Cloud SDK on your host machine to upload the image and create instances.
46
+
47
+####Install Google cloud SDK on host machine
48
+
49
+	curl https://sdk.cloud.google.com | bash
50
+
51
+####Upload the tar file
52
+
53
+	gsutil cp photon-gce.tar.gz gs://bucket-name
54
+
55
+####Create image
56
+
57
+	gcloud compute --project project-id images create image-name --description description --source-uri https://storage.googleapis.com/bucket-name/photon-gce.tar.gz
58
+
59
+####Create instance of GCE
60
+
61
+	gcloud compute --project project-id instances create instance-name --zone "us-central1-f" --machine-type "n1-standard-1" other-options
62
+
63
+(You can also create instances from the Google developer console.)
64
+
65
+For more information, see [Running a Photon OS Machine on GCE](photon-admin-guide.md#running-a-photon-os-machine-on-gce). 
66
+
67
+### AWS EC2
68
+
69
+Install the [AWS CLI](http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-bundle-other-os) and [EC2 CLI](http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/set-up-ec2-cli-linux.html) tools. 
70
+
71
+####Bundle the image
72
+
73
+	ec2-bundle-image -c cert.pem -k private-key.pem -u $AWS_USER_ID --arch x86_64 --image photon-ami.raw --destination directory-name
74
+
75
+####Upload the bundle
76
+
77
+	ec2-upload-bundle --manifest directory-name/photon-ami.raw.manifest.xml --bucket bucket-name --access-key $AWS_ACCESS_KEY --secret-key $AWS_SECRET_KEY
78
+
79
+####Register the AMI
80
+
81
+	ec2-register bucket-name/photon-ami.raw.manifest.xml --name name --architecture x86_64 --virtualization-type hvm
82
+
83
+You can now launch instances using the AWS console.
84
+
85
+For more information, see [Customizing a Photon OS Machine on EC2](photon-admin-guide.md#customizing-a-photon-os-machine-on-ec2).
86
+
87
+
88
+<!--
89
+##AZURE
90
+
91
+Install the [Azure CLI] (https://www.npmjs.com/package/azure)
92
+
93
+Install [QEMU](https://en.wikibooks.org/wiki/QEMU/Installing_QEMU)
94
+
95
+####Create the image
96
+azure vm image create image_name path_to_vhd -l "West US" -o linux
97
+
98
+Create running VM instances using Azure management portal
99
+-->
100
+
101
+###OVA
102
+
103
+The OVA image uses an optimized version of the 4.4.8 Linux kernel. Two ova files are generated from the build: photon-ova.ova, which is the full version of Photon OS, and photon-custom.ova, which is the minimal version of Photon OS. The password for photon-ova.ova should be changed using guest customization options when you upload it to VMware vCenter. Photon-custom.ova comes with the default password set to `changeme`; you must change it the first time you log in.
104
+
105
+#### OVA Prerequisites
106
+
107
+[VDDK 6.0](https://developercenter.vmware.com/web/sdk/60/vddk)
108
+
109
+To utilize the VDDK libraries the following procedure may be used, this extracts the libraries and temporarily exports them to the LD_LIBRARY_PATH for the *current session*.  (tested on Ubuntu 1404 & 1604)  If you wish to make this permenant and system-wide then you may want to create a config file in /etc/ld.so.conf.d/.
110
+
111
+    tar -zxf VMware-vix-disklib-6.0.2-3566099.x86_64.tar.gz
112
+    cp -r vmware-vix-disklib-distrib/include/* /usr/include/
113
+    mkdir /usr/lib/vmware
114
+    cp -a ~/vmware-vix-disklib-distrib/lib64/* /usr/lib/vmware/
115
+    rm /usr/lib/vmware/libstdc++.so.6
116
+    export LD_LIBRARY_PATH=/usr/lib/vmware
117
+
118
+[OVFTOOL](https://my.vmware.com/group/vmware/details?downloadGroup=OVFTOOL410&productId=491)
119
+
120
+OVF Tool should be downloaded and installed on the host.
121
+
122
+    sh VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle --eulas-agreed --required
123
+
124
+<!-- 
125
+##Photon Bosh
126
+
127
+Please refer [bosh docs] (http://bosh.io/docs) to deploy BOSH on Photon 
128
+-->
129
+
130
+
131
+
0 132
deleted file mode 100644
... ...
@@ -1,6 +0,0 @@
1
-# Command-line Interfaces
2
-
3
-Photon OS includes the following command-line utilities:
4
-
5
-- [Photon Management Daemon Command-line Interface (pmd-cli)](pmd-cli.md). The pmd-cli utility enables Photon customers to invoke API requests securely on local and remote servers. 
6
-- [Photon Network Manager Command-line Interface (netmgr)](netmgr-cli.md). A command line interface to manage network configuration of the system.
7 1
deleted file mode 100644
8 2
Binary files a/docs/photon_installation/images/grub-edit-menu-changepw.png and /dev/null differ
9 3
deleted file mode 100644
10 4
Binary files a/docs/photon_installation/images/grub-edit-menu-orig.png and /dev/null differ
11 5
new file mode 100644
... ...
@@ -0,0 +1,72 @@
0
+# Importing the OVA for Photon OS 3.0
1
+
2
+Using the OVA is a fast and easy way to create a Photon OS VM on Fusion.
3
+
4
+After you have downloaded the Photon OS OVA image (OVA with Hardware Version 11) into a folder of your choice, open VMware Fusion and perform the following steps:
5
+
6
+1. Start the Import Process
7
+
8
+    From the File menu, choose **Import …**. Fusion prompts you to choose an existing virtual machine.
9
+
10
+    ![Import process](images/fs-ova-import.png)
11
+
12
+    Choose the **Choose File …**  button to locate and select the Photon OS OVA, then choose **Continue**.
13
+
14
+    ![Select OVA ](images/fs-ova-selected.png)
15
+
16
+1. Specify the Name and Storage Location
17
+
18
+    Provide the name and storage location for your Photon OS VM, then choose **Save**.
19
+    
20
+    ![Name and storage location](images/fs-ova-name.png)
21
+    
22
+    Review the Photon OS License Agreement, then choose **Accept** to start the import process.
23
+    
24
+    ![License](images/fs-ova-license.png)
25
+
26
+1. Configure VM Settings
27
+
28
+    After the OVA is imported, Fusion displays a confirmation that the import has completed and a summary of the settings for your Photon OS VM. The following screen shot is an example (your settings may vary).
29
+    
30
+    ![VM settings](images/fs-ova-finish.png)
31
+    
32
+    **Important:** Choose **Customize Settings**  to change the operating system (as recognized by the hypervisor) for the newly imported VM.
33
+    
34
+    ![Custom settings](images/fs-ova-settings.png)
35
+    
36
+    Choose **General**.
37
+    
38
+    Click the selection box next to **OS**, select **Linux** , and then select **VMware Photon 64-bit**.
39
+    
40
+    ![Operating system](images/fs-ova-os.png)
41
+    
42
+    Close the settings window. Fusion prompts you to verify that you want to change the operating system.
43
+    
44
+    ![Confirm settings](images/fs-ova-os-confirm.png)
45
+    
46
+    Click **Change**. Your Photon OS VM is ready to power on.
47
+
48
+1. Power on the VM
49
+
50
+    Power on the Photon OS VM. Fusion may ask you whether you want to upgrade this VM.
51
+    
52
+    ![Upgrade VM](images/fs-ova-upgrade.png)
53
+    
54
+    How you respond depends on which hardware version (13 or 11) that you want to use. Upgrade if you need to use devices supported only in hardware version 13. Don't upgrade if you want to be compatible with older tools that are supported in hardware version 11.
55
+
56
+1. Update Login Credentials
57
+
58
+    ![Splash screen](images/fs-ova-splash.png)
59
+    
60
+    After the VM is booted, Fusion prompts you to log in.
61
+    
62
+    **Note** : Because of limitations within OVA support on Fusion, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
63
+    
64
+    - Username: ``root``
65
+    - Password: ``changeme``
66
+    
67
+    After you provide these credentials, Fusion prompts you to create a new password and type it a second time to verify it. For security, Photon OS forbids common dictionary words for the root password. Once logged in, you will see the shell prompt.
68
+    
69
+    ![Login](images/fs-ova-login.png)
70
+    
71
+Once complete, proceed to [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os-fusion.md).
0 72
\ No newline at end of file
1 73
deleted file mode 100644
... ...
@@ -1,74 +0,0 @@
1
-# Importing the OVA for Photon OS 3.0
2
-
3
-Using the OVA is a fast and easy way to create a Photon OS VM on Fusion.
4
-
5
-After you have downloaded the Photon OS OVA image (OVA with Hardware Version 11) into a folder of your choice, open VMware Fusion and perform the following steps:
6
-
7
-1. Start the Import Process
8
-
9
-    From the File menu, choose **Import …**. Fusion prompts you to choose an existing virtual machine.
10
-
11
-    ![Import process](images/fs-ova-import.png)
12
-
13
-    Choose the **Choose File …**  button to locate and select the Photon OS OVA, then choose **Continue**.
14
-
15
-    ![Select OVA ](images/fs-ova-selected.png)
16
-
17
-1. Specify the Name and Storage Location
18
-
19
-    Provide the name and storage location for your Photon OS VM, then choose **Save**.
20
-    
21
-    ![Name and storage location](images/fs-ova-name.png)
22
-    
23
-    Review the Photon OS License Agreement, then choose **Accept** to start the import process.
24
-    
25
-    ![License](images/fs-ova-license.png)
26
-
27
-1. Configure VM Settings
28
-
29
-    After the OVA is imported, Fusion displays a confirmation that the import has completed and a summary of the settings for your Photon OS VM. The following screen shot is an example (your settings may vary).
30
-    
31
-    ![VM settings](images/fs-ova-finish.png)
32
-    
33
-    **Important:** Choose **Customize Settings**  to change the operating system (as recognized by the hypervisor) for the newly imported VM.
34
-    
35
-    ![Custom settings](images/fs-ova-settings.png)
36
-    
37
-    Choose **General**.
38
-    
39
-    Click the selection box next to **OS**, select **Linux** , and then select **VMware Photon 64-bit**.
40
-    
41
-    ![Operating system](images/fs-ova-os.png)
42
-    
43
-    Close the settings window. Fusion prompts you to verify that you want to change the operating system.
44
-    
45
-    ![Confirm settings](images/fs-ova-os-confirm.png)
46
-    
47
-    Click **Change**. Your Photon OS VM is ready to power on.
48
-
49
-1. Power on the VM
50
-
51
-    Power on the Photon OS VM. Fusion may ask you whether you want to upgrade this VM.
52
-    
53
-    ![Upgrade VM](images/fs-ova-upgrade.png)
54
-    
55
-    How you respond depends on which hardware version (13 or 11) that you want to use. Upgrade if you need to use devices supported only in hardware version 13. Don't upgrade if you want to be compatible with older tools that are supported in hardware version 11.
56
-
57
-1. Update Login Credentials
58
-
59
-    ![Splash screen](images/fs-ova-splash.png)
60
-    
61
-    After the VM is booted, Fusion prompts you to log in.
62
-    
63
-    **Note** : Because of limitations within OVA support on Fusion, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
64
-    
65
-    | **Setting** | **Value** |
66
-    | --- | --- |
67
-    | Username | ``root`` |
68
-    | Password | ``changeme`` |
69
-    
70
-    After you provide these credentials, Fusion prompts you to create a new password and type it a second time to verify it. For security, Photon OS forbids common dictionary words for the root password. Once logged in, you will see the shell prompt.
71
-    
72
-    ![Login](images/fs-ova-login.png)
73
-    
74
-Once complete, proceed to [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os-fusion.md).
75 1
\ No newline at end of file
... ...
@@ -61,10 +61,8 @@ After you have downloaded the the OVA file (OVA with Hardware Version 11), perfo
61 61
 
62 62
     **Note** : Because of limitations within OVA support on Workstation, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA will require an immediate password change upon login. The default account credentials are:
63 63
     
64
-    | **Setting** | **Value** |
65
-    | --- | --- |
66
-    | Username | ``root`` |
67
-    | Password | ``changeme`` |
64
+    - Username: ``root``
65
+    - Password: ``changeme``
68 66
     
69 67
     After you provide these credentials, Workstation prompts you to create a new password and type it a second time to verify it. For security, Photon OS forbids common dictionary words for the root password. Once logged in, you will see the shell prompt.
70 68
     
... ...
@@ -51,36 +51,34 @@ After you have downloaded the OVA, log in to your vSphere environment and perfor
51 51
 1. Verify Deployment Settings
52 52
 
53 53
         
54
-    ![Deployment settings](images/vs-ova-settings.png)
55
-    
56
-    Click **Finish**. vSphere uploads and validates your OVA. Depending on bandwidth, this operation might take a while.
57
-    
58
-    When finished, vShield powers up a new VM based on your selections.
54
+	![Deployment settings](images/vs-ova-settings.png)
55
+        
56
+	Click **Finish**. vSphere uploads and validates your OVA. Depending on bandwidth, this operation might take a while.
57
+        
58
+	When finished, vShield powers up a new VM based on your selections.
59 59
 
60
-1. Change Login Settings
60
+7. Change Login Settings
61 61
 
62
-    ![Login settings](images/vs-ova-splash.png)
63
-    
64
-    After the VM is booted, open the command window. vSphere prompts you to log in.
65
-    
66
-    **Note**: Because of limitations within OVA support on vSphere, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA require an immediate password change upon login. The default account credentials are:
67
-    
68
-    | **Setting** | **Value** |
69
-    | --- | --- |
70
-    | Username | ``root`` |
71
-    | Password | ``changeme`` |
72
-
73
-    After you provide these credentials, vSphere prompts you to create a new password and type it a second time to verify it.
74
-    
75
-    **Note:** For security, Photon OS forbids common dictionary words for the root password.  
76
-    
77
-    Once logged in, you will see the shell prompt.
78
-    
79
-    ![Shell prompt](images/vs-ova-login.png)
62
+	![Login settings](images/vs-ova-splash.png)
63
+        
64
+	After the VM is booted, open the command window. vSphere prompts you to log in.
65
+        
66
+	**Note**: Because of limitations within OVA support on vSphere, it was necessary to specify a default password for the OVA option. However, all Photon OS instances that are created by importing the OVA require an immediate password change upon login. The default account credentials are:
67
+        
68
+        - Username: ``root``
69
+        - Password: ``changeme``
80 70
     
81
-    Once complete, proceed to [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os.md).
71
+	After you provide these credentials, vSphere prompts you to create a new password and type it a second time to verify it.
72
+        
73
+	**Note:** For security, Photon OS forbids common dictionary words for the root password.  
74
+        
75
+	Once logged in, you will see the shell prompt.
76
+        
77
+	![Shell prompt](images/vs-ova-login.png)
78
+        
79
+	Once complete, proceed to [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os.md).
82 80
 
83
-1. Export the VM as a Template (Optional)
81
+8. Export the VM as a Template (Optional)
84 82
 
85 83
     Consider converting this imported VM into a template (from the Actions menu, choose **Export** ) so that you have a master Photon OS instance that can be combined with vSphere Guest Customization to enable rapid provisioning of Photon OS instances.
86 84
     
... ...
@@ -6,40 +6,40 @@ Perform the following steps:
6 6
 
7 7
 1. Create a New Bucket
8 8
 
9
-Create a new bucket to store your Photon OS image for GCE.
10
-
11
-![gce1](images/gce1.jpg)
9
+    Create a new bucket to store your Photon OS image for GCE.
10
+    
11
+    ![gce1](images/gce1.jpg)
12 12
 
13 13
 1. Upload the Photon OS Image
14 14
 
15
-While viewing the bucket that created, click the `Upload files` button, navigate to your Photon OS image and click the `Choose` button. 
16
-
17
-When the upload finishes, you can see the Photon OS compressed image in the file list for the bucket that you created.
18
-
19
-![gce2](images/gce2.jpg)
15
+    While viewing the bucket that created, click the `Upload files` button, navigate to your Photon OS image and click the `Choose` button. 
16
+    
17
+    When the upload finishes, you can see the Photon OS compressed image in the file list for the bucket that you created.
18
+    
19
+    ![gce2](images/gce2.jpg)
20 20
 
21 21
 1. Create a New Image
22 22
 
23
-To create a new image, click on `Images` in the `Compute` category in the left panel and then click on the `New Image` button. 
24
-
25
-Enter a name for the image in the `Name` field and change the `Source` to `Cloud Storage file` using the pull-down menu. Then, in the `Cloud Storage file` field, enter the bucket name and filename as the path to the Photon OS image for GCE. In this example, where the bucket was named `photon_storage,` the path is as follows:
26
- 
27
-	`photon_storage/photon-gce-2.0-tar.gz`
28
-
29
-The new image form autopopulates the `gs://` file path prefix.*
30
-
31
-Click the `Create` button to create your image. You must be able to see the Images catalog and your Photon OS image at the top of the list. 
23
+    To create a new image, click on `Images` in the `Compute` category in the left panel and then click on the `New Image` button. 
24
+    
25
+    Enter a name for the image in the `Name` field and change the `Source` to `Cloud Storage file` using the pull-down menu. Then, in the `Cloud Storage file` field, enter the bucket name and filename as the path to the Photon OS image for GCE. In this example, where the bucket was named `photon_storage,` the path is as follows:
26
+     
27
+    	`photon_storage/photon-gce-2.0-tar.gz`
28
+    
29
+    The new image form autopopulates the `gs://` file path prefix.*
30
+    
31
+    Click the `Create` button to create your image. You must be able to see the Images catalog and your Photon OS image at the top of the list. 
32 32
 
33 33
 1. Create a New Instance
34 34
 
35
-To create an instance, check the box next to the Photon OS image and click the `Create Instance` button. 
36
-
37
-On the `Create a new instance` form, provide a name for this instance, confirm the zone into which this instance is to be deployed and, before clicking `Create,` check the `Allow HTTP traffic` and `Allow HTTPS traffic` options. 
38
-
39
-**Note**: The firewall rules in this example are optional. You can configure the ports according to your requirements. 
40
-
41
-![gce4](images/gce4.jpg)
42
-
43
-When the instance is created you will be returned to your list of VM instances. If you click on the instance, the status page for the instance will allow you to SSH into your Photon OS environment using the SSH button at the top of the panel. 
44
-
45
-At this point, your instance is running and you are ready to start the Docker engine and run a container workload. For more information, see [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os.md).
46 35
\ No newline at end of file
36
+    To create an instance, check the box next to the Photon OS image and click the `Create Instance` button. 
37
+    
38
+    On the `Create a new instance` form, provide a name for this instance, confirm the zone into which this instance is to be deployed and, before clicking `Create,` check the `Allow HTTP traffic` and `Allow HTTPS traffic` options. 
39
+    
40
+    **Note**: The firewall rules in this example are optional. You can configure the ports according to your requirements. 
41
+    
42
+    ![gce4](images/gce4.jpg)
43
+    
44
+    When the instance is created you will be returned to your list of VM instances. If you click on the instance, the status page for the instance will allow you to SSH into your Photon OS environment using the SSH button at the top of the panel. 
45
+    
46
+    At this point, your instance is running and you are ready to start the Docker engine and run a container workload. For more information, see [Deploying a Containerized Application in Photon OS](deploying-a-containerized-application-in-photon-os.md).
47 47
\ No newline at end of file
... ...
@@ -130,11 +130,26 @@ After you have downloaded the latest Photon OS ISO image into a folder of your c
130 130
     
131 131
     Each install option provides a different run-time environment. Select the option that best meets your requirements.
132 132
     
133
-    | **Option** | **Description** |
134
-    | --- | --- |
135
-    | **Photon Minimal** | Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. |
136
-    | **Photon Full** | Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. |
137
-    | **Photon OSTree Server** | This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts. |
133
+    <table style="height: 170px;" border="1" cellspacing="0" cellpadding="10">
134
+	<tbody>
135
+	<tr>
136
+	<td><b>Option</b></td>
137
+	<td><b>Description</b></td>
138
+	</tr>
139
+	<tr>
140
+	<td><b>Photon Minimal</b></td>
141
+	<td>Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime.</p></td>
142
+	</tr>
143
+	<tr>
144
+	<td><b>Photon Full</b></td>
145
+	<td>Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers.</td>
146
+	</tr>
147
+	<tr>
148
+	<td><b>Photon OSTree Server<b></td>
149
+	<td>This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts.</td>
150
+	</tr>
151
+	</tbody>
152
+	</table>
138 153
     
139 154
     **Note:** The option you choose determines the disk and memory resources required for your installation.
140 155
     
... ...
@@ -126,11 +126,26 @@ After you have downloaded the latest Photon OS ISO image into a folder of your c
126 126
     
127 127
     Each installation option provides a different run-time environment, depending on your requirements.
128 128
     
129
-    | **Option** | **Description** |
130
-    | --- | --- |
131
-    | **Photon Minimal** | Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. |
132
-    | **Photon Full** | Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. |
133
-    | **Photon OSTree Server** | This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts. |
129
+    <table style="height: 170px;" border="1" cellspacing="0" cellpadding="10">
130
+	<tbody>
131
+	<tr>
132
+	<td><b>Option</b></td>
133
+	<td><b>Description</b></td>
134
+	</tr>
135
+	<tr>
136
+	<td><b>Photon Minimal</b></td>
137
+	<td>Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime.</p></td>
138
+	</tr>
139
+	<tr>
140
+	<td><b>Photon Full</b></td>
141
+	<td>Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers.</td>
142
+	</tr>
143
+	<tr>
144
+	<td><b>Photon OSTree Server<b></td>
145
+	<td>This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts.</td>
146
+	</tr>
147
+	</tbody>
148
+	</table>
134 149
     
135 150
     **Note:**  The option you choose determines the disk and memory resources required for your installation.
136 151
     
... ...
@@ -111,7 +111,7 @@ After you download the Photon OS ISO image into a folder of your choice, complet
111 111
     
112 112
     Choose **Yes** and press the Enter key.
113 113
 
114
-    1. Select an Installation Option
114
+1. Select an Installation Option
115 115
     
116 116
     After partitioning the disk, the installer prompts you to select an installation option.
117 117
     
... ...
@@ -119,11 +119,26 @@ After you download the Photon OS ISO image into a folder of your choice, complet
119 119
     
120 120
     Each install option provides a different run-time environment, depending on your requirements.
121 121
     
122
-    | **Option** | **Description** |
123
-    | --- | --- |
124
-    | **Photon Minimal** | Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime. |
125
-    | **Photon Full** | Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers. |
126
-    | **Photon OSTree Server** | This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts. |
122
+	  <table style="height: 170px;" border="1" cellspacing="0" cellpadding="10">
123
+		<tbody>
124
+		<tr>
125
+		<td><b>Option</b></td>
126
+		<td><b>Description</b></td>
127
+		</tr>
128
+		<tr>
129
+		<td><b>Photon Minimal</b></td>
130
+		<td>Photon Minimum is a very lightweight version of the container host runtime that is best suited for container management and hosting. There is sufficient packaging and functionality to allow most common operations around modifying existing containers, as well as being a highly performant and full-featured runtime.</p></td>
131
+		</tr>
132
+		<tr>
133
+		<td><b>Photon Full</b></td>
134
+		<td>Photon Full includes several additional packages to enhance the authoring and packaging of containerized applications and/or system customization. For simply running containers, Photon Full will be overkill. Use Photon Full for developing and packaging the application that will be run as a container, as well as authoring the container, itself. For testing and validation purposes, Photon Full will include all components necessary to run containers.</td>
135
+		</tr>
136
+		<tr>
137
+		<td><b>Photon OSTree Server<b></td>
138
+		<td>This installation profile will create the server instance that will host the filesystem tree and managed definitions for rpm-ostree managed hosts created with the "Photon OSTree Host" installation profile. Most environments should need only one Photon OSTree Server instance to manage the state of the Photon OSTree Hosts. Use Photon OSTree Server when you are establishing a new repository and management node for Photon OS hosts.</td>
139
+		</tr>
140
+		</tbody>
141
+		</table>
127 142
     
128 143
     **Note:**  The option you choose determines the disk and memory resources required for your installation.
129 144
     
... ...
@@ -164,7 +179,7 @@ After you download the Photon OS ISO image into a folder of your choice, complet
164 164
     
165 165
     **Note:** If you have trouble with unintentional repeated characters in the Remote Console, follow VMware KB 196 ( [http://kb.vmware.com/kb/196](http://kb.vmware.com/kb/196)) for a setting to apply to the virtual machine.
166 166
     
167
-    Press the Enter key. The installer proceeds to install the software. Installation times will vary based on the system hardware and installation options you selected. Most installations complete in less than one minute.
167
+    Press the `Enter` key. The installer proceeds to install the software. Installation times will vary based on the system hardware and installation options you selected. Most installations complete in less than one minute.
168 168
 
169 169
 1. Reboot the VM and Log In
170 170
 
171 171
deleted file mode 100644
... ...
@@ -1,239 +0,0 @@
1
-# Photon Network Manager Command-line Interface (netmgr)
2
-
3
-For locally logged-on users, Photon OS provides a command line interface to manage network configuration of the system.
4
-
5
-- [Setup Steps](#setup-steps)
6
-- [Syntax](#syntax)
7
-- [Network Manager CLI](#network-manager-cli)
8
-
9
-# Setup Steps
10
-
11
-The netmgr tool is included with your Photon OS distribution. To make sure that you have the latest version, you can run:
12
-~~~~
13
-tdnf install netmgmt
14
-~~~~
15
-# Syntax
16
-The CLI is built on set, get, add, delete command model and uses the option-name - option-value model of specifying command parameters.
17
-~~~~
18
-netmgr <network object> <--get | --set | --add | --del> <command options>
19
-~~~~
20
-Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&quot;) as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether.
21
-
22
-## network object
23
-
24
-``<network object>`` is one of the following values:
25
-
26
-- ``link_info``
27
-- ``ip4_address``
28
-- ``ip6_address``
29
-- ``ip_route``
30
-- ``dns_servers``
31
-- ``dns_domains``
32
-- ``dhcp_duid``
33
-- ``if_iaid``
34
-- ``ntp_servers``
35
-- ``hostname``
36
-- ``wait_for_link``
37
-- ``wait_for_ip``
38
-- ``error_info``
39
-- ``net_info``
40
-
41
-# Network Manager CLI
42
-
43
-## link_info
44
-
45
-Get the mac address, MTU, link state, and link mode for the (optionally) specified interface.
46
-~~~~
47
-netmgr link_info --get --interface <ifname>
48
-~~~~
49
-Set the MAC address, link state (up or down), link mode (manual or auto), or MTU for the specified interface.
50
-~~~~
51
-netmgr link_info --set --interface <ifname> --macaddr <mac_address>
52
-netmgr link_info --set --interface <ifname> --mode <manual|auto>
53
-netmgr link_info --set --interface <ifname> --state <up|down>
54
-netmgr link_info --set --interface <ifname> --mtu <mtu>
55
-~~~~
56
-## ip4_address
57
-
58
-Get the IPv4 address for the specified interface.
59
-~~~~
60
-netmgr ip4_address --get --interface <ifname>
61
-~~~~
62
-Set the IPv4 address (dot-decimal/prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
63
-~~~~
64
-netmgr ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <ipv4_address/prefix> --gateway <gateway_address>
65
-~~~~
66
-## ip6_address
67
-
68
-Get IPv6 addresses for the specified interface.
69
-~~~~
70
-netmgr ip6_address --get --interface <ifname>
71
-~~~~
72
-Add one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) to the specified interface.
73
-~~~~
74
-netmgr ip6_address --add --interface <ifname> --addrlist <ipv6_addr1/prefix,ipv6_addr2/prefix,...>
75
-~~~~
76
-Delete one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) from the specified interface.
77
-~~~~
78
-netmgr ip6_address --del --interface <ifname> --addrlist <ipv6_addr1/prefix,ipv6_addr2/prefix,...>
79
-~~~~
80
-Set the IPv6 DHCP mode (1=enable, 0=disable) and IPv6 auto-configuration settings (1=enable, 0=disable) for the specified interface.
81
-~~~~
82
-netmgr ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0>
83
-~~~~
84
-## ip_route
85
-
86
-Get the static IP route for the specified interface.
87
-~~~~
88
-netmgr ip_route --get --interface <ifname>
89
-~~~~
90
-Add the static IP route (gateway IP, destination network, and metric) to the specified interface.
91
-~~~~
92
-netmgr ip_route --add --interface <ifname> --gateway <gateway_address> --destination <destination_network/prefix> --metric <N>
93
-~~~~
94
-Delete the specified static IP route from the specified interface.
95
-~~~~
96
-netmgr ip_route --del --interface <ifname> --destination <destination_network/prefix>
97
-~~~~
98
-## dns_servers
99
-
100
-Get the list of DNS servers.
101
-~~~~
102
-netmgr dns_servers --get
103
-~~~~
104
-Set the DNS mode (DHCP or static) for one or more DNS servers (comma-separated list).
105
-~~~~
106
-netmgr dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
107
-~~~~
108
-Add a DNS server to the list of DNS servers.
109
-~~~~
110
-netmgr dns_servers --add --servers <server>
111
-~~~~
112
-Remove the specified DNS server from the list of DNS servers.
113
-~~~~
114
-netmgr dns_servers --del --servers <server>
115
-~~~~
116
-## dns_domains
117
-
118
-Get the list of DNS domains.
119
-~~~~
120
-netmgr dns_domains --get
121
-~~~~
122
-Set the list of DNS domains (one or more DNS domains in a comma-separated list).
123
-~~~~
124
-netmgr dns_domains --set --domains <domain1,domain2,...>
125
-~~~~
126
-Add a DNS domain to the list of DNS domains.
127
-~~~~
128
-netmgr dns_domains --add --domains <domain>
129
-~~~~
130
-Delete a DNS domain from the list of DNS domains.
131
-~~~~
132
-netmgr dns_domains --del --domains <domain>
133
-~~~~
134
-## dhcp_duid
135
-
136
-Get the DHCP DUID (optionally interface-specific DUID) for the system.
137
-~~~~
138
-netmgr dhcp_duid --get
139
-~~~~
140
-Set the DHCP DUID for the system, optionally per-interface if the interface is specified.
141
-~~~~
142
-netmgr dhcp_duid --set --duid <duid>
143
-~~~~
144
-## if_iaid
145
-
146
-Get the IAID for the specified interface.
147
-~~~~
148
-netmgr if_iaid --get --interface <ifname>
149
-~~~~
150
-Set the IAID for the specified interface.
151
-~~~~
152
-netmgr if_iaid --set --interface <ifname> --iaid <iaid>
153
-~~~~
154
-## ntp_servers
155
-
156
-Get the NTP servers list.
157
-~~~~
158
-netmgr ntp_servers --get
159
-~~~~
160
-Set the NTP servers list.
161
-~~~~
162
-netmgr ntp_servers --set --servers <server1,server2,...>
163
-~~~~
164
-Add the specified server to the NTP servers list.
165
-~~~~
166
-netmgr ntp_servers --add --servers <server>
167
-~~~~
168
-Delete the specified server from the NTP servers list.
169
-~~~~
170
-netmgr ntp_servers --del --servers <server>
171
-~~~~
172
-## hostname
173
-
174
-Get the system hostname.
175
-~~~~
176
-netmgr hostname --get
177
-~~~~
178
-Set the system hostname.
179
-~~~~
180
-netmgr hostname --set --name <hostname>
181
-~~~~
182
-## wait_for_link
183
-
184
-Wait for the specified network interface to be up and usable (it can send and receive packets).
185
-~~~~
186
-netmgr wait_for_link --interface <ifname> --timeout <timeout>
187
-~~~~
188
-The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
189
-
190
-**Note:** You might need to use wait_for_ip to wait until you can send and receive IP packets.
191
-
192
-## wait_for_ip
193
-
194
-Wait for the specified interface to acquire a valid IP address for the specified address type.
195
-~~~~
196
-netmgr wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6>
197
-~~~~
198
-The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
199
-
200
-## error_info
201
-
202
-Get error information about the specified error code.
203
-~~~~
204
-netmgr error_info --errcode <error_code>
205
-~~~~
206
-Here is a list of error codes:
207
-
208
-- 4097 - invalid parameter
209
-- 4098 - not supported
210
-- 4099 - out of memory
211
-- 4100 - value not found
212
-- 4101 - value exists
213
-- 4102 - invalid interface
214
-- 4103 - invalid mode
215
-- 4104 - bad configuration file
216
-- 4105 - write failed
217
-- 4106 - timeout
218
-- 4107 - DCHP timeout
219
-
220
-## net_info
221
-
222
-Get the specified network configuration parameter for the specified object.
223
-~~~~
224
-netmgr net_info --get --object <ifname or filename> --paramname <param_name>
225
-~~~~
226
-**Note:** The object can be an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf).
227
-
228
-Set the value of the specified network configuration parameter for the specified object (interface or file).
229
-~~~~
230
-netmgr net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value>
231
-~~~~
232
-**Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -.
233
-
234
-For example, in order to add static IPv4 address "10.10.10.1/24" to eth0 interface, the following command adds this **Address** to the **Network** section of the **eth0** network configuration file.
235
-~~~~
236
-netmgr net_info --set --object eth0 --paramname +Network_Address --paramvalue "10.10.10.1/24"
237
-~~~~
238
-
239
-
... ...
@@ -1,4 +1,4 @@
1
-# Prerequisites
1
+# Prerequisites for Running Photon OS on Azure
2 2
 
3 3
 Before you use Photon OS with Microsoft Azure, perform the following prerequisite tasks:
4 4
 
5 5
deleted file mode 100644
... ...
@@ -1,51 +0,0 @@
1
-# Prerequisites
2
-
3
-Before you use Photon OS within VMware Fusion, perform the following prerequisite tasks:
4
-
5
-1. Verify that you have the following resources:
6
-
7
-	<table style="height: 170px;" border="1" width="157" cellspacing="0" cellpadding="10">
8
-	<tbody>
9
-	<tr>
10
-	<td><b>Resource</b></td>
11
-	<td><b>Description</b></td>
12
-	</tr>
13
-	<tr>
14
-	<td> VMware Fusion</td>
15
-	<td>VMware Fusion (v7.0 or higher) must be installed. The latest version is recommended.</p></td>
16
-	</tr>
17
-	<tr>
18
-	<td>Memory</td>
19
-	<td> 2GB of free RAM (recommended) </td>
20
-	</tr>
21
-	<tr>
22
-	<td>Storage</td>
23
-	<td><b>Minimal Photon install</b>: 512MB of free space (minimum); <b>Full Photon install</b>: 4GB of free space (minimum); 8GB is recommended.</td>
24
-	</tr>
25
-	<tr>
26
-	<td>Distribution File</td>
27
-	<td>Photon OS ISO or OVA file downloaded from bintray (<a href="https://bintray.com/vmware/photon/">https://bintray.com/vmware/photon/</a>).</td>
28
-	</tr>
29
-	</tbody>
30
-	</table>
31
-
32
-	Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware vSphere and VMware Fusion), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
33
-    
34
-	 **Note:** The setup instructions in this guide use VMware Fusion Professional version 8.5.8, as per the following screenshot.
35
-
36
-	![Fusion version](images/fs_version.png)
37
-
38
-1. Decide whether to use the OVA or ISO distribution to set up Photon OS.
39
-
40
-    - **OVA import** : Because of the nature of an OVA, you're getting a pre-installed version of Photon OS. You can choose the hardware version you want (OVA with hardware version 13 or 11). The OVA benefits from a simple import process and some kernel tuning for VMware environments. However, because it's a pre-installed version, the set of packages that are installed are predetermined. Any additional packages that you need can be installed using tdnf.
41
-    - **ISO install** : The ISO, on the other hand, allows for a more complete installation or automated installation via kickstart.
42
-
43
-     To get Photon OS up and running quickly, use the OVA.
44
-    
45
-1. Download Photon OS. Go to the following Bintray URL and download the latest release of Photon OS:
46
-
47
-    [https://bintray.com/vmware/photon/](https://bintray.com/vmware/photon/)
48
-    
49
-    For instructions, see [Downloading Photon OS](Downloading-Photon-OS.md).
50
-    
51
-    **Note:** For ISO installation, you must upload to a datashare that is attached to the ESXi host, or mount the file share where the ISO resides as a data store.
... ...
@@ -1,4 +1,4 @@
1
-# Prerequisites
1
+# Prerequisites for Running Photon OS on GCE
2 2
 
3 3
 Before you use Photon OS within GCE, verify that you have the following resources:
4 4
 
... ...
@@ -35,6 +35,8 @@ Perform the following tasks to make Photon OS work on GCE:
35 35
  
36 36
  For more information see [Importing Boot Disk Images to Compute Engine](https://cloud.google.com/compute/docs/tutorials/building-images).
37 37
 
38
+For information about upgrading the Photon OS Linux kernel see [Upgrading the Kernel Version Requires Grub Changes for AWS and GCE Images](Upgrading-the-Kernel-Version-Requires-Grub-Changes-for-AWS-and-GCE-Images.md)
39
+
38 40
 ## Photon OS Image
39 41
 
40 42
 VMware recommends that administrators use the Photon OS image for Google Compute Engine (GCE) to create Photon OS instances on GCE. Photon OS bundles the Google startup scripts, daemon, and cloud SDK into a GCE-ready image that has been modified to meet the configuration requirements of GCE. You can download the Photon OS image for GCE from the following URL: 
... ...
@@ -140,7 +142,8 @@ Perform the following tasks:
140 140
     echo "nameserver 8.8.8.8" >> /etc/resolv.conf
141 141
     ```
142 142
 
143
-1. Remove ssh host keys and add script to regenerate them at boot time.
143
+1. Remove ssh host 
144
+2. keys and add script to regenerate them at boot time.
144 145
       
145 146
     ```
146 147
     rm /etc/ssh/ssh_host_*
... ...
@@ -181,27 +184,27 @@ Perform the following tasks:
181 181
 
182 182
 1. Pack and upload to GCE.
183 183
 
184
-Shut down the Photon VM and copy its disk to THE `tmp` folder.       
185
-         
186
-   ```
187
-   # You will need to install Google Cloud SDK on host machine to upload the image and play with GCE.
188
-         cp Virtual\ Machines.localized/photon.vmwarevm/Virtual\ Disk.vmdk /tmp/disk.vmdk
189
-         cd /tmp
190
-         # GCE needs disk to be named as disk.raw with raw format.
191
-         qemu-img convert -f vmdk -O raw disk.vmdk disk.raw
192
-         
193
-         # ONLY GNU tar will work to create acceptable tar.gz file for GCE. MAC's default tar is BSDTar which will not work. 
194
-         # On Mac OS X ensure that you have gtar "GNU Tar" installed. exmaple: gtar -Szcf photon.tar.gz disk.raw 
195
-   
196
-         gtar -Szcf photon.tar.gz disk.raw 
197
-         
198
-         # Upload
199
-         gsutil cp photon.tar.gz gs://photon-bucket
200
-         
201
-         # Create image
202
-         gcloud compute --project "<project name>" images create "photon-beta-vYYYYMMDD" --description "Photon Beta" --source-uri https://storage.googleapis.com/photon-bucket/photon032315.tar.gz
203
-         
204
-         # Create instance on GCE of photon image
205
-         gcloud compute --project "photon" instances create "photon" --zone "us-central1-f" --machine-type "n1-standard-1" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/devstorage.read_only" "https://www.googleapis.com/auth/logging.write" --image "https://www.googleapis.com/compute/v1/projects/photon/global/images/photon" --boot-disk-type "pd-standard" --boot-disk-device-name "photon"
206
-   
207
-   ```
184
+    Shut down the Photon VM and copy its disk to THE `tmp` folder.       
185
+             
186
+       ```
187
+       # You will need to install Google Cloud SDK on host machine to upload the image and play with GCE.
188
+             cp Virtual\ Machines.localized/photon.vmwarevm/Virtual\ Disk.vmdk /tmp/disk.vmdk
189
+             cd /tmp
190
+             # GCE needs disk to be named as disk.raw with raw format.
191
+             qemu-img convert -f vmdk -O raw disk.vmdk disk.raw
192
+             
193
+             # ONLY GNU tar will work to create acceptable tar.gz file for GCE. MAC's default tar is BSDTar which will not work. 
194
+             # On Mac OS X ensure that you have gtar "GNU Tar" installed. exmaple: gtar -Szcf photon.tar.gz disk.raw 
195
+       
196
+             gtar -Szcf photon.tar.gz disk.raw 
197
+             
198
+             # Upload
199
+             gsutil cp photon.tar.gz gs://photon-bucket
200
+             
201
+             # Create image
202
+             gcloud compute --project "<project name>" images create "photon-beta-vYYYYMMDD" --description "Photon Beta" --source-uri https://storage.googleapis.com/photon-bucket/photon032315.tar.gz
203
+             
204
+             # Create instance on GCE of photon image
205
+             gcloud compute --project "photon" instances create "photon" --zone "us-central1-f" --machine-type "n1-standard-1" --network "default" --maintenance-policy "MIGRATE" --scopes "https://www.googleapis.com/auth/devstorage.read_only" "https://www.googleapis.com/auth/logging.write" --image "https://www.googleapis.com/compute/v1/projects/photon/global/images/photon" --boot-disk-type "pd-standard" --boot-disk-device-name "photon"
206
+       
207
+       ```
... ...
@@ -1,6 +1,6 @@
1
-# Prerequisites
1
+# Prerequisites for Running Photon OS on AWS EC2
2 2
 
3
-Before you use Photon OS with Amazon Elastic Cloud Compute, perform the following prerequisite tasks:
3
+Before you use Photon OS with Amazon Elastic Cloud Compute(AWS EC2), perform the following prerequisite tasks:
4 4
 
5 5
 1. Verify that you have the following resources:
6 6
     
... ...
@@ -1,4 +1,4 @@
1
-# Prerequisites
1
+# Prerequisites for Running Photon OS on Fusion
2 2
 
3 3
 Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware Fusion and VMware vSphere), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
4 4
 
... ...
@@ -31,10 +31,9 @@ Before you use Photon OS within Fusion, perform the following prerequisite tasks
31 31
 	</tbody>
32 32
 	</table>
33 33
 
34
+	**Note:** The setup instructions in this guide use VMware Fusion Professional version 8.5.8, as per the following screenshot.
34 35
 
35
-    **Note:** The setup instructions in this guide use VMware Fusion Professional version 8.5.8, as per the following screenshot.
36
-
37
-    ![Fusion version](images/fs-version.png)
36
+	![Fusion version](images/fs-version.png)
38 37
 
39 38
 2. Decide whether to use the OVA or ISO distribution to set up Photon OS.
40 39
 
... ...
@@ -1,4 +1,4 @@
1
-# Prerequisites
1
+# Prerequisites for Running Photon OS on vSphere
2 2
 
3 3
 Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware vSphere and VMware Fusion), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
4 4
 
... ...
@@ -1,4 +1,4 @@
1
-# Prerequisites
1
+# Prerequisites for Running Photon OS on Workstation
2 2
 
3 3
 Before you use Photon OS within Workstation, perform the following prerequisite tasks:
4 4
 
... ...
@@ -29,12 +29,11 @@ Before you use Photon OS within Workstation, perform the following prerequisite
29 29
 	</tbody>
30 30
 	</table>
31 31
 
32
-
33 32
 	Resource requirements and recommendations vary depending on several factors, including the host environment (for example, VMware Workstation and VMware vSphere), the distribution file used (ISO or OVA), and the selected installation settings (for example, full or basic installation).
34 33
 
35 34
 	**Note:**  The setup instructions in this guide use VMware Workstation Professional version 12.5.7.
36 35
 
37
-    ![Workstation version](images/ws_version.png)
36
+	![Workstation version](images/ws_version.png)
38 37
 
39 38
 1. Decide whether to use the OVA or ISO distribution to set up Photon OS.
40 39
 
41 40
deleted file mode 100644
... ...
@@ -1,486 +0,0 @@
1
-# Photon Management Daemon Command-line Interface (pmd-cli)
2
-
3
-Photon OS 2.0 provides the Photon Management Daemon command line interface (pmd-cli).
4
-
5
-- [Setup Steps](#setup-steps)
6
-- [Syntax](#syntax)
7
-- [Firewall Management](#firewall-management)
8
-- [Network Management](#network-management)
9
-- [Package Management](#package-management)
10
-- [User Management](#user-management)
11
-
12
-# Setup Steps
13
-
14
-The pmd-cli utility is included with your Photon OS 2.0 distribution. To make sure that you have the latest version, you can run:
15
-~~~~
16
-tdnf install pmd-cli
17
-~~~~
18
-# Syntax
19
-~~~~
20
-pmd-cli [connection_auth_options] <component> <command> [command_options]
21
-~~~~
22
-Passed-in parameter values can be enclosed in single (&#39;) or double-quotes (&quot;) as long as you use matching characters to denote the beginning and end of the value. Unless a parameter value contains special characters or spaces, you can also omit quotes altogether.
23
-
24
-## Connection / Authorization Options
25
-
26
-### Local Connections
27
-
28
-For local connections, you omit the connection and authorization options:
29
-~~~~
30
-pmd-cli <component> <cmd> <options>
31
-~~~~
32
-Permissions for the currently logged-in user apply when executing commands. This is the same as specifying --servername localhost.
33
-
34
-### Remote Connections
35
-
36
-For connecting to a remote server (a server other than the local server), you specify two connection / authorization options:
37
-
38
-- ``--servername``: name of the server
39
-- ``--user``: username of a user account on the server
40
-
41
-**Note:**  For authentication, you can specify the username (–user &lt;username&gt;) on the command line, but never the password. For security reasons, the system must prompt you for the password.
42
-
43
-What follows are three options for remote connections.
44
-
45
-**System User**
46
-~~~~
47
-pmd-cli --servername <server> --user <username>
48
-~~~~
49
-**Lightwave User**
50
-
51
-Before using this method, the pmd server must be joined or should be part of embedded Lightwave.
52
-~~~~
53
-pmd-cli --servername <server> --user <username> --domain <lightwave_domain>
54
-~~~~
55
-**Kerberos spn**
56
-
57
-Before using this method, the client must run kinit successfully.
58
-~~~~
59
-pmd-cli --servername <server> --spn <service_principal_name>
60
-~~~~
61
-## Component
62
-
63
-``<component>`` is one of the following values:
64
-
65
-- ``firewall``
66
-- ``net``
67
-- ``pkg``
68
-- ``usr``
69
-
70
-# Firewall Management
71
-
72
-The Photon Management Daemon provides CLI commands to help you get information about the firewall.
73
-
74
-## Syntax
75
-~~~~
76
-pmd-cli [connection_auth_options] firewall <command> [command_options]
77
-~~~~
78
-## firewall help
79
-
80
-Get help for firewall CLI commands.
81
-~~~~
82
-pmd-cli firewall help
83
-~~~~
84
-## firewall rules
85
-
86
-Get a list of the current persistent firewall rules.
87
-~~~~
88
-pmd-cli firewall rules [command-options]
89
-~~~~
90
-This command returns information about each firewall rule, such as the chain to which it belongs, the policy to enforce, the table to manipulate, and so on.
91
-
92
-Add a new firewall rule.
93
-~~~~
94
-pmd-cli firewall rules --chain <chain_name> --add <rule_specification>
95
-~~~~
96
-Example:
97
-~~~~
98
-pmd-cli firewall rules --chain INPUT --add "-p tcp -m tcp --dport 21 -j ACCEPT"
99
-~~~~
100
-**Note:** To confirm that the firewall rule was added, run iptables -S. Running pmd-cli firewall rules lists only persistent rules.
101
-
102
-Delete a new firewall rule.
103
-~~~~
104
-pmd-cli firewall rules --chain <chain_name> --delete <rule_specification>
105
-~~~~
106
-**Note:**  To confirm that the firewall rule was removed, run iptables -S. Running pmd-cli firewall rules lists only persistent rules.
107
-
108
-Make firewall rule changes peristent (add --persist flag)
109
-~~~~
110
-pmd-cli firewall rules --chain <chain_name> --add <rule_specification> --persist
111
-~~~~
112
-
113
-## firewall version
114
-
115
-Get the version number of the fwmgmt component on the server.
116
-~~~~
117
-pmd-cli firewall version
118
-~~~~
119
-# Network Management
120
-
121
-The Photon Management Daemon provides CLI commands to help you manage network interfaces.
122
-
123
-## Syntax
124
-~~~~
125
-pmd-cli [connection_auth_options] net <command> [command_options]
126
-~~~~
127
-Many of these commands require the interface name (–interface &lt;ifname&gt;). Command options are described below.
128
-
129
-## net link_info
130
-
131
-Get the mac address, mtu, link state, and link mode for the specified interface.
132
-~~~~
133
-pmd-cli net link_info --get --interface <ifname>
134
-~~~~
135
-Set the MAC address, mode (manual or auto), link state (up or down), link mode (manual or auto), and MTU for the specified interface.
136
-~~~~
137
-pmd-cli net link_info --set --interface <ifname> --macaddr <mac_address> --mode <manual|auto> --state <up|down> --mtu <mtu>
138
-~~~~
139
-## net ip4_address
140
-
141
-Get the IPv4 address for the specified interface.
142
-~~~~
143
-pmd-cli net ip4_address --get --interface <ifname>
144
-~~~~
145
-Set the IPv4 address (dot-decimal/prefix notation), mode (dhcp, static, or none), and (optionally) the default gateway for the specified interface.
146
-~~~~
147
-pmd-cli net ip4_address --set --interface <ifname> --mode <dhcp|static|none> --addr <IPv4Address/prefix> --gateway <gateway_address>
148
-~~~~
149
-## net ip6_address
150
-
151
-Get IPv6 address(es) for the specified interface.
152
-~~~~
153
-pmd-cli net ip6_address --get --interface <ifname>
154
-~~~~
155
-Add one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) to the specified interface.
156
-~~~~
157
-pmd-cli net ip6_address --add --interface <ifname> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...>
158
-~~~~
159
-Delete one or more IPv6 addresses (comma-separated list in colon-separated/prefix notation) from the specified interface.
160
-~~~~
161
-pmd-cli net ip6_address --del --interface <ifname> --addrlist <IPv6Addr1/prefix,IPv6Addr2/prefix,...>
162
-~~~~
163
-Set the DHCP mode (1=enable, 0=disable) and autoconfigure settings (1=enable, 0=disable) for the specified interface.
164
-~~~~
165
-pmd-cli net ip6_address --set --interface <ifname> --dhcp <1|0> --autoconf <1|0>
166
-~~~~
167
-## net ip_route
168
-
169
-Get the static IP route for the specified interface.
170
-~~~~
171
-pmd-cli net ip_route --get --interface <ifname>
172
-~~~~
173
-Add the static IP route (gateway IP, destination network, and metric) to the specified interface.
174
-~~~~
175
-pmd-cli net ip_route --add --interface <ifname> --gateway <GatewayIP> --destination <DestinationNetwork/prefix> --metric <N>
176
-~~~~
177
-Delete the specified static IP route from the specified interface.
178
-~~~~
179
-pmd-cli net ip_route --del --interface <ifname> --destination <DestinationNetwork/prefix>
180
-~~~~
181
-## net dns_servers
182
-
183
-Get the list of DNS servers.
184
-~~~~
185
-pmd-cli net dns_servers --get
186
-~~~~
187
-Set the DNS mode (dhcp or static) for one or more DNS servers (comma-separated list).
188
-~~~~
189
-pmd-cli net dns_servers --set --mode <dhcp|static> --servers <server1,server2,...>
190
-~~~~
191
-Add a DNS server to the list of DNS servers.
192
-~~~~
193
-pmd-cli net dns_servers --add --servers <server>
194
-~~~~
195
-Remove the specified DNS server from the list of DNS servers.
196
-~~~~
197
-pmd-cli net dns_servers --del --servers <server>
198
-~~~~
199
-## net dns_domains
200
-
201
-Get the list of DNS domains.
202
-~~~~
203
-pmd-cli net dns_domains --get
204
-~~~~
205
-Set the list of DNS domains (one or more DNS domains in a comma-separated list).
206
-~~~~
207
-pmd-cli net dns_domains --set --domains <domain1,domain2,...>
208
-~~~~
209
-Add a DNS domain to the list of DNS domains.
210
-~~~~
211
-pmd-cli net dns_domains --add --domains <domain1>
212
-~~~~
213
-Delete a DNS domain from the list of DNS domains.
214
-~~~~
215
-pmd-cli net dns_domains --del --domains <domain1>
216
-~~~~
217
-## net dhcp_duid
218
-
219
-Get the DHCP DUID (optionally interface-specific DUID) for the system.
220
-~~~~
221
-pmd-cli net dhcp_duid --get
222
-~~~~
223
-Set the DHCP DUID for the system, optionally per-interface if the interface is specified.
224
-~~~~
225
-pmd-cli net dhcp_duid --set --duid <duid>
226
-~~~~
227
-## net if_iaid
228
-
229
-Get the IAID for the specified interface.
230
-~~~~
231
-pmd-cli net if_iaid --get --interface <ifname>
232
-~~~~
233
-Set the IAID for the specified interface.
234
-~~~~
235
-pmd-cli net if_iaid --set --interface <ifname> --iaid <iaid>
236
-~~~~
237
-## net ntp_servers
238
-
239
-Get the NTP servers list.
240
-~~~~
241
-pmd-cli net ntp_servers --get
242
-~~~~
243
-Set the NTP servers list.
244
-~~~~
245
-pmd-cli net ntp_servers --set --servers <server1,server2,...>
246
-~~~~
247
-Add the specified server to the NTP servers list.
248
-~~~~
249
-pmd-cli net ntp_servers --add --servers <server>
250
-~~~~
251
-Delete the specified server from the NTP servers list.
252
-~~~~
253
-pmd-cli net ntp_servers --del --servers <server>
254
-~~~~
255
-## net hostname
256
-
257
-Get the system hostname.
258
-~~~~
259
-pmd-cli net hostname --get
260
-~~~~
261
-Set the system hostname.
262
-~~~~
263
-pmd-cli net hostname --set --name <hostname>
264
-~~~~
265
-## net wait_for_link
266
-
267
-Wait for the specified network interface to be up and usable (it can send and receive packets).
268
-~~~~
269
-pmd-cli net wait_for_link --interface <ifname> --timeout <timeout>
270
-~~~~
271
-The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
272
-
273
-**Note:** You might need to use net wait_for_ip to wait until you can send and receive IP packets.
274
-
275
-## net wait_for_ip
276
-
277
-Wait for the specified interface to acquire a valid IP address for the specified address type.
278
-~~~~
279
-pmd-cli net wait_for_ip --interface <ifname> --timeout <timeout> --addrtype <ipv4,ipv6,static_ipv4,static_ipv6,dhcp_ipv4,dhcp_ipv6,auto_ipv6,link_local_ipv6>
280
-~~~~
281
-The timeout (in seconds) specifies the maximum time to wait. Specify 0 for no timeout (wait indefinitely).
282
-
283
-## net error_info
284
-
285
-Get error information about the specified error code.
286
-~~~~
287
-pmd-cli net error_info --errcode <error_code>
288
-~~~~
289
-Here is a list of error codes:
290
-
291
-- 4097 - invalid parameter
292
-- 4098 - not supported
293
-- 4099 - out of memory
294
-- 4100 - value not found
295
-- 4101 - value exists
296
-- 4102 - invalid interface
297
-- 4103 - invalid mode
298
-- 4104 - bad configuration file
299
-- 4105 - write failed
300
-- 4106 - timout
301
-- 4107 - DCHP timeout
302
-
303
-## net net_info
304
-
305
-Get the specified network configuration parameter for the specified object.
306
-~~~~
307
-pmd-cli net net_info --get --object <ifname or filename> --paramname <param_name>
308
-~~~~
309
-**Note:** The object can be an interface name (for example, &quot;eth0&quot;) or a file name (for example, /etc/systemd/resolved.conf).
310
-
311
-Set the value of the specified network configuration parameter for the specified object (interface or file).
312
-~~~~
313
-pmd-cli net net_info --set --object <ifname or filename> --paramname <param_name> --paramvalue <param_value>
314
-~~~~
315
-**Note** : You can add (+) or remove (-) a parameter by prepending the parameter name with + or -.
316
-
317
-# Package Management
318
-
319
-The Photon Management Daemon provides CLI commands to help you manage packages and repositories.
320
-
321
-## Syntax
322
-~~~~
323
-pmd-cli [connection options] pkg <command> [command options]
324
-~~~~
325
-If a command allows for multiple package names, simply specify on the command line, separated by spaces.
326
-~~~~
327
-pmd-cli pkg info <package_name_1> <package_name_2> <package_name_3> ...
328
-~~~~
329
-## pkg help
330
-
331
-Get help text for pkg CLI commands.
332
-~~~~
333
-pmd-cli pkg help
334
-~~~~
335
-## pkg count
336
-
337
-Get the total number of packages in all repos (including installed).
338
-~~~~
339
-pmd-cli pkg count
340
-~~~~
341
-## pkg distro-sync
342
-
343
-Synchronize installed packages to the latest available versions. If no packages are specified, then all available packages are synchronized.
344
-~~~~
345
-pmd-cli pkg distro-sync
346
-~~~~
347
-## pkg downgrade
348
-
349
-Downgrade the specified package(s). If no packages are specified, then all available packages are downgraded.
350
-~~~~
351
-pmd-cli pkg downgrade <package_name>
352
-~~~~
353
-## pkg erase
354
-
355
-Remove the specified package(s).
356
-~~~~
357
-pmd-cli pkg erase <package_name>
358
-~~~~
359
-## pkg info
360
-
361
-Get general information about the specified package(s),  such as name, version, release, repository, install size, and so on.
362
-~~~~
363
-pmd-cli pkg info <package_name>
364
-~~~~
365
-If no packages are specified, then this command returns information about all packages.
366
-~~~~
367
-## pkg install
368
-~~~~
369
-Install the specified package(s). Update the package if an update is available.
370
-~~~~
371
-pmd-cli pkg install <package_name>
372
-~~~~
373
-## pkg list
374
-
375
-Get a list of packages or groups of packages.
376
-~~~~
377
-pmd-cli pkg list
378
-~~~~
379
-You can filter by group: all, available, installed, extras, obsoletes, recent, and upgrades.
380
-~~~~
381
-pmd-cli pkg list upgrades
382
-~~~~
383
-You can also filter by wildcards.
384
-~~~~
385
-pmd-cli pkg list ph\*
386
-~~~~
387
-## pkg reinstall
388
-
389
-Reinstall the specified package(s).
390
-~~~~
391
-pmd-cli pkg reinstall <package_name>
392
-~~~~
393
-## pkg repolist
394
-
395
-Get a list of the configured software repositories.
396
-~~~~
397
-pmd-cli pkg repolist
398
-~~~~
399
-This command returns a list of the configured software repositories, including the repository ID, repitory name, and status.
400
-
401
-## pkg update
402
-
403
-Update the specified package(s).
404
-~~~~
405
-pmd-cli pkg update <package_name>
406
-~~~~
407
-If no parameters are specified, then all available packages are updated.
408
-
409
-## pkg updateinfo
410
-
411
-Get the update information on all enabled repositories (status = enabled). If this command returns nothing, then the update information may not exist on the server.
412
-~~~~
413
-pmd-cli pkg updateinfo
414
-~~~~
415
-# User Management
416
-
417
-The Photon Management Daemon provides CLI commands to help you manage users and user groups.
418
-
419
-## Syntax
420
-~~~~
421
-pmd-cli [connection options] usr <command> [command options]
422
-~~~~
423
-## usr help
424
-
425
-Display help text for user commands.
426
-~~~~
427
-pmd-cli usr users
428
-~~~~
429
-## usr users
430
-
431
-Get a list of users. This command returns information about each user, including their user name, user ID, user group (if applicable), home directory, and default shell.
432
-~~~~
433
-pmd-cli usr users
434
-~~~~
435
-## usr useradd
436
-
437
-Add a new user. Specify the username.
438
-~~~~
439
-pmd-cli usr useradd <username>
440
-~~~~
441
-The system assigns a user ID, home directory, and default shell to the new user. The user group is unspecified.
442
-
443
-## usr userdel
444
-
445
-Delete the specified user.
446
-~~~~
447
-pmd-cli usr userdel <username>
448
-~~~~
449
-## usr userid
450
-
451
-Get the user ID of the specified user (by name). Used to determine whether the specified user exists.
452
-~~~~
453
-pmd-cli usr userid <username>
454
-~~~~
455
-## usr groups
456
-
457
-Get a list of user groups. This command returns the following information about each user group: user group name and user group ID.
458
-~~~~
459
-pmd-cli usr groups
460
-~~~~
461
-## usr groupadd
462
-
463
-Add a new user group.
464
-~~~~
465
-pmd-cli usr groupadd <user_group_name>
466
-~~~~
467
-The system assigns a group ID to the new user group.
468
-
469
-## usr groupdel
470
-
471
-Delete the specified user group.
472
-~~~~
473
-pmd-cli usr groupdel <user_group_name>
474
-~~~~
475
-## usr groupid
476
-
477
-Get the group ID for the specified user group (by name). Used to determine whether the specified user group exists.
478
-~~~~
479
-pmd-cli usr groupid <user_group_name>
480
-~~~~
481
-## usr version
482
-
483
-Get the version of the usermgmt component at the server.
484
-~~~~
485
-pmd-cli usr version
486
-~~~~
... ...
@@ -2,7 +2,7 @@
2 2
 
3 3
 The Photon Management Daemon (PMD) that ships with Photon OS 2.0 provides the remote management of a Photon instance via several APIs: a command line client (pmd-cli), a REST API, and a Python API. The PMD provides the ability to manage network interfaces, packages, firewalls, users, and user groups.
4 4
 
5
-- [Installing the pmd Package](installing_pmd_packages.md)
5
+- [Installing the pmd Package](installing_pmd_package.md)
6 6
 - [Available APIs](available_apis.md)
7 7
 
8 8
 
... ...
@@ -1,1683 +1,50 @@
1 1
 # Troubleshooting Guide
2 2
 
3 3
 - [Toubleshooting Guide](README.md)
4
-    -    [Introduction](#introduction)
5
-        -   [Systemd and TDNF](#systemd-and-tdnf)
6
-        -   [The Root Account and the `sudo` and `su`
7
-            Commands](#the-root-account-and-the-sudo-and-su-commands)
8
-        -   [Checking the Version and Build
9
-            Number](#checking-the-version-and-build-number)
10
-        -   [General Best Practices](#general-best-practices)
11
-        -   [Logs on Photon OS](#logs-on-photon-os)
12
-        -   [Troubleshooting Progression](#troubleshooting-progression)
13
-    -   [Solutions to Common Problems](#solutions-to-common-problems)
14
-        -   [Resetting a Lost Root
15
-            Password](#resetting-a-lost-root-password)
16
-        -   [Fixing Permissions on Network Config
17
-            Files](#fixing-permissions-on-network-config-files)
18
-        -   [Permitting Root Login with
19
-            SSH](#permitting-root-login-with-ssh)
20
-        -   [Fixing Sendmail If Installed Before an FQDN Was
21
-            Set](#fixing-sendmail-if-installed-before-an-fqdn-was-set)
22
-    -   [Common Troubleshooting Tools on Photon
23
-        OS](#common-troubleshooting-tools-on-photon-os)
24
-        -   [Top](#top)
25
-        -   [ps](#ps)
26
-        -   [netstat](#netstat)
27
-        -   [find](#find)
28
-        -   [Locate](#locate)
29
-        -   [df](#df)
30
-        -   [md5sum and sha256sum](#md5sum-and-sha256sum)
31
-        -   [strace](#strace)
32
-        -   [file](#file)
33
-        -   [stat](#stat)
34
-        -   [watch](#watch)
35
-        -   [vmstat and fdisk](#vmstat-and-fdisk)
36
-        -   [lsof](#lsof)
37
-        -   [fuser](#fuser)
38
-        -   [ldd](#ldd)
39
-        -   [gdb](#gdb)
40
-        -   [Other Troubleshooting Tools Installed by
41
-            Default](#other-troubleshooting-tools-installed-by-default)
42
-        -   [Installing More Tools from
43
-            Repositories](#installing-more-tools-from-repositories)
44
-        -   [Linux Troubleshooting Tools Not on Photon
45
-            OS](#linux-troubleshooting-tools-not-on-photon-os)
46
-    -   [Systemd](#systemd)
47
-        -   [Viewing Services](#viewing-services)
48
-        -   [Using Systemd Commands Instead of Init.d
49
-            Commands](#using-systemd-commands-instead-of-init.d-commands)
50
-        -   [Analyzing System Logs with
51
-            journalctl](#analyzing-system-logs-with-journalctl)
52
-        -   [Inspecting Services with
53
-            `systemd-analyze`](#inspecting-services-with-systemd-analyze)
54
-    -   [Networking](#networking)
55
-        -   [Managing the Network
56
-            Configuration](#managing-the-network-configuration)
57
-        -   [Use `ip` and `ss` Commands Instead of `ifconfig` and
58
-            `netstat`](#use-ip-and-ss-commands-instead-of-ifconfig-and-netstat)
59
-        -   [Inspecting the Status of Network Links with
60
-            `networkctl`](#inspecting-the-status-of-network-links-with-networkctl)
61
-        -   [Turning on Network
62
-            Debugging](#turning-on-network-debugging)
63
-        -   [Installing the Packages for tcpdump and netcat with
64
-            tdnf](#installing-the-packages-for-tcpdump-and-netcat-with-tdnf)
65
-        -   [Checking Firewall Rules](#checking-firewall-rules)
66
-        -   [Netmgr](#netmgr)
67
-    -   [File System](#file-system)
68
-        -   [Checking Disk Space](#checking-disk-space)
69
-        -   [Adding a Disk and Partitioning
70
-            It](#adding-a-disk-and-partitioning-it)
71
-        -   [Expanding Disk Partition](#expanding-disk-partition)
72
-        -   [fdisk](#fdisk)
73
-        -   [fsck](#fsck)
74
-        -   [Fixing File System Errors When fsck
75
-            Fails](#fixing-file-system-errors-when-fsck-fails)
76
-    -   [Packages](#packages)
77
-    -   [Kernel Problems and Boot and Login
78
-        Problems](#kernel-problems-and-boot-and-login-problems)
79
-        -   [Kernel Overview](#kernel-overview)
80
-        -   [Boot Process Overview](#boot-process-overview)
81
-        -   [Blank Screen on Reboot](#blank-screen-on-reboot)
82
-        -   [Investigating Strange
83
-            Behavior](#investigating-strange-behavior)
84
-        -   [Investigating the Guest Kernel When You Cannot Log
85
-            On](#investigating-the-guest-kernel-when-you-cannot-log-on)
86
-        -   [Kernel Log Replication with
87
-            VProbes](#kernel-log-replication-with-vprobes)
88
-    -   [Performance Issues](#performance-issues)
89
-
90
-
91
-
92
-## Introduction 
93
-
94
-This guide describes the fundamentals of troubleshooting problems on Photon OS. An open-source minimalist Linux operating system from VMware, Photon OS is optimized for cloud computing platforms, VMware vSphere deployments, virtual appliances, and applications native to the cloud.
95
-
96
-This guide covers the basics of troubleshooting systemd, packages, network interfaces, services such as SSH and Sendmail, the file system, and the Linux kernel. The guide includes a quick tour of the tools that you can use for troubleshooting and provides examples along the way. The guide also demonstrates how to access the system's log files. 
97
-
98
-For information on how to install and manage Photon OS, see the [Photon OS Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md).
99
-
100
-### Systemd and TDNF
101
-
102
-Two characteristics of Photon OS stand out: It manages services with systemd, and it manages packages with its own open source, yum-compatible package manager called tdnf, for Tiny DNF. 
103
-
104
-By using systemd, Photon OS adopts a contemporary Linux standard to bootstrap the user space and concurrently start services--an architecture that differs from traditional Linux systems such as SUSE Linux Enterprise Server 11.
105
-
106
-<!-- [[Image:photon-logo.png|right]] --> 
107
-
108
-A traditional Linux system contains an initialization system called SysVinit. With SLES 11, for instance, SysVinit-style init programs control how the system starts up and shuts down. Init implements system runlevels. A SysVinit runlevel defines a state in which a process or service runs. In contrast to a SysVinit system, systemd defines no such runlevels. Instead, systemd uses a dependency tree of _targets_ to determine which services to start when.
109
-
110
-Because the systemd commands differ from those of an init.d-based Linux system, a section later in this guide illustrates how to troubleshoot by using systemctl commands instead of init.d-style commands. 
111
-
112
-Tdnf keeps the operating system as small as possible while preserving yum's robust package-management capabilities. On Photon OS, tdnf is the default package manager for installing new packages. Since troubleshooting with tdnf differs from using yum, a later section of this guide describes how to solve problems with packages and repositories by using tdnf commands.
113
-
114
-### The Root Account and the `sudo` and `su` Commands
115
-
116
-This guide assumes that you are logged in to Photon OS with the root account and running commands as root. The sudo program comes with the full version of Photon OS. On the minimal version, you must install sudo with tdnf if you want to use it. As an alternative to installing sudo on the minimal version, you can switch users as needed with the `su` command to run commands that require root privileges.
117
-
118
-### Checking the Version and Build Number
119
-
120
-To check the version and build number of Photon OS, concatenate `/etc/photon-release`. Example: 
121
-
122
-	cat /etc/photon-release
123
-	VMware Photon Linux 1.0
124
-	PHOTON_BUILD_NUMBER=a6f0f63
125
-
126
-The build number in the results maps to the commit number on the VMware Photon OS GitHub [commits page](https://github.com/vmware/photon/commits/master).
127
-
128
-### General Best Practices
129
-
130
-When troubleshooting, you should follow some general best practices:
131
-
132
-* **Take a snapshot.** Before you do anything to a virtual machine running Photon OS, take a snapshot of the VM so that you can restore it if need be. 
133
-
134
-* **Make a backup copy.** Before you change a configuration file, make a copy of the original in case you need to restore it later; example: `cp /etc/tdnf/tdnf.conf /etc/tdnf/tdnf.conf.orig`
135
-
136
-* **Collect logs.** Save the log files associated with a Photon OS problem; you or others might need them later. Include not only the log files on the guest but also the `vmware.log` file on the host; `vmware.log` is in the host's directory that contains the VM.
137
-
138
-* **Know what's in your toolbox.** Glance at the man page for a tool before you use it so that you know what your options are. The options can help focus the command's output on the problem you're trying to solve.
139
-
140
-* **Understand the system.** The more you know about the operating system and how it works, the better you can troubleshoot.
141
-
142
-### Logs on Photon OS
143
-
144
-On Photon OS, all the system logs except the installation log and the cloud-init log are written into the systemd journal. The `journalctl` command queries the contents of the systemd journal.
145
-
146
-The installation log files and the cloud-init log files reside in `/var/log`. If Photon OS is running on a virtual machine in a VMware hypervisor, the log file for the VMware tools (vmware-vmsvc.log) also resides in `/var/log`. 
147
-
148
-### Troubleshooting Progression
149
-
150
-If you encounter a problem running an application or appliance on Photon OS and you suspect it involves the operating system, you can troubleshoot by proceeding as follows. 
151
-
152
-First, check the services running on Photon OS:
153
-
154
-	systemctl status
155
-
156
-Second, check your application's log files for clues. (For VMware applications, see [Location of Log Files for VMware Products](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021806).)
157
-
158
-Third, check the service controller or service monitor for your application or appliance. 
159
-
160
-Fourth, check the network interfaces and other aspects of the network service with `systemd-network` commands.
161
-
162
-Fifth, check the operating system's log files: 
163
-
164
-	journalctl
165
-
166
-Next, run the following commands to view all services according to the order in which they were started:
167
-
168
-	systemd-analyze critical-chain 
169
-
170
-Finally, if the previous steps have not revealed enough information to isolate the problem, turn to the troubleshooting tool that you think is most likely to help with the issue at hand. You could, for example, use `strace` to identify the location of the failure. See the list of troubleshooting tools on Photon OS in a later section. 
171
-
172
-## Solutions to Common Problems
173
-
174
-This section describes solutions to problems that you're likely to encounter.
175
-
176
-### Resetting a Lost Root Password
177
-
178
-Here's how to reset a lost root password. 
179
-
180
-First, restart the Photon OS machine or the virtual machine running Photon OS. When the Photon OS splash screen appears as it restarts, type the letter `e` to go to the GNU GRUB edit menu. Be quick about it: Because Photon OS reboots so quickly, you won't have much time to type `e`. Remember that in vSphere and Workstation, you might have to give the console focus by clicking in its window before it will register input from the keyboard. 
181
-
182
-Second, in the GNU GRUB edit menu, go to the end of the line that starts with `linux`, add a space, and then add the following code exactly as it appears below:
183
-
184
-	rw init=/bin/bash
185
-
186
-After you add this code, the GNU GRUB edit menu should look exactly like this:
187
-
188
-![The modified GNU GRUB edit menu](images/grub-edit-menu-changepw.png) 
189
-
190
-Now type `F10`.
191
-
192
-At the command prompt, type `passwd` and then type (and re-enter) a new root password that conforms to the password complexity rules of Photon OS. Remember the password. 
193
-
194
-Next, type the following command:
195
-
196
-	umount /
197
-
198
-Finally, type the following command. You must include the `-f` option to force a reboot; otherwise, the kernel enters a state of panic.
199
-
200
-	reboot -f
201
-
202
-This sequence of commands should look like this:
203
-
204
-![The series of commands to reset the root password](images/resetpw.png)
205
-
206
-After the Photon OS machine reboots, log in with the new root password. 
207
-
208
-### Fixing Permissions on Network Config Files
209
-
210
-If you, as the root user, create a new network configuration file on Photon OS, the network service might be unable to process it until you set the file's mode bits to `644`.
211
-
212
-If you query the journal with `journalctl -u systemd-networkd`, you might see the following error message along with an indication that the network service did not start: 
213
-
214
-	could not load configuration files. permission denied
215
-
216
-The permissions on the network files are the likely cause of this problem. Without the correct permissions, networkd-systemd cannot parse and apply the settings, and the network configuration that you created will not be loaded. 
217
-
218
-After you create a network configuration file with a `.network` extension, you must run the `chmod` command to set the new file's mode bits to `644`. Example: 
219
-
220
-    chmod 644 10-static-en.network
221
-
222
-For Photon OS to apply the new configuration, you must restart the `systemd-networkd` service by running the following command: 
223
-
224
-	systemctl restart systemd-networkd
225
-
226
-###	Permitting Root Login with SSH
227
-
228
-The full version of Photon OS prevents root login with SSH by default. To permit root login over SSH, open `/etc/ssh/sshd_config` with the vim text editor and set `PermitRootLogin` to `yes`. 
229
-
230
-Vim is the default text editor available in both the full and minimal versions of Photon OS. (Nano is also in the full version.) After you modify the SSH daemon's configuration file, you must restart the sshd daemon for the changes to take effect. Example: 
231
-
232
-	vim /etc/ssh/sshd_config
233
-
234
-	# override default of no subsystems
235
-	Subsystem       sftp    /usr/libexec/sftp-server
236
-
237
-	# Example of overriding settings on a per-user basis
238
-	#Match User anoncvs
239
-	#       X11Forwarding no
240
-	#       AllowTcpForwarding no
241
-	#       PermitTTY no
242
-	#       ForceCommand cvs server
243
-	PermitRootLogin yes
244
-	UsePAM yes
245
-
246
-Save your changes in vim and then restart the sshd daemon: 
247
-
248
-	systemctl restart sshd
249
-
250
-You can then connect to the Photon OS machine with the root account over SSH:
251
-
252
-	steve@ubuntu:~$ ssh root@198.51.100.131
253
-
254
-### Fixing Sendmail If Installed Before an FQDN Was Set
255
-
256
-If Sendmail is behaving improperly or if it hangs during installation, it is likely that an FQDN is not set. Take the following corrective action. 
257
-
258
-First, set an FQDN for your Photon OS machine. 
259
-
260
-Then, run the following commands in the order below: 
261
-
262
-    echo $(hostname -f) > /etc/mail/local-host-names
263
-    
264
-    cat > /etc/mail/aliases << "EOF"
265
-        postmaster: root
266
-        MAILER-DAEMON: root
267
-        EOF
268
-
269
-    /bin/newaliases
270
-
271
-    cd /etc/mail
272
-
273
-    m4 m4/cf.m4 sendmail.mc > sendmail.cf
274
-
275
-    chmod 700 /var/spool/clientmqueue
276
-
277
-    chown smmsp:smmsp /var/spool/clientmqueue
278
-
279
-## Common Troubleshooting Tools on Photon OS
280
-
281
-This section describes tools that can help troubleshoot problems. These tools are installed by default on the full version of Photon OS. On the minimal version of Photon OS, you may have to install a tool before you can use it. 
282
-
283
-There is a manual, or man page, on Photon OS for all the tools covered in this section. The man pages provide more information about each tool's commands, options, and output. To view a tool's man page, on the Photon OS command line, type `man` and then the name of the tool. Example: 
284
-
285
-	man strace
286
-
287
-Some of the examples in this section are marked as abridged with ellipsis (`...`).
288
-
289
-### Top
290
-
291
-Photon OS includes the Top tool to monitor system resources, workloads, and performance. It can unmask problems caused by processes or applications overconsuming CPUs, time, or RAM. 
292
-
293
-To view a textual display of resource consumption, run the `top` command: 
294
-
295
-	top
296
-
297
-In Top, you can kill a runaway or stalled process by typing `k` followed by its process ID (PID). 
298
-
299
-![Top on Photon OS](images/top-in-photon-os.png)
300
-
301
-If the percent of CPU utilization is consistently high with little idle time, there might be a runaway process overconsuming CPUs. Restarting the service might solve the problem. 
302
-
303
-A handy trick while troubleshooting an unknown issue is to run Top in the background by using batch mode to write its output to a file in order to collect data about performance:
304
-
305
-	top d 120 b >> top120second.output
306
-
307
-For a list of options that filter top output and other information, see the man page for Top.
308
-
309
-### ps
310
-
311
-The `ps` tool shows the processes running on the machine. The `ps` tool derives flexibility and power from its options, all of which are covered in the tool's Photon OS man page:
312
-
313
-	man ps
314
-
315
-Here are several popular invocations of `ps` for troubleshooting. 
316
-
317
-Show processes by user: 
318
-
319
-	ps aux
320
-
321
-Show processes and child processes by user: 
322
-
323
-	ps auxf
324
-
325
-Show processes containing the string `ssh`:
326
-
327
-	ps aux | grep ssh
328
-
329
-Show processes and the command and options with which they were started: 
330
-
331
-	ps auxww
332
-
333
-Example abridged output: 
334
-
335
-	ps auxww
336
-	USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
337
-	root          1  0.0  0.9  32724  3300 ?        Ss   07:51   0:32 /lib/systemd/systemd --switched-root --system --deserialize 22
338
-
339
-### netstat
340
-
341
-The `netstat` command can identify bottlenecks causing  performance issues. It lists network connections, listening sockets, port information, and interface statistics for different protocols. Examples: 
342
-
343
-	netstat --statistics
344
-	netstat --listening
345
-
346
-### find
347
-
348
-The `find` command can be a useful starting point to troubleshoot a Photon OS machine that has stopped working. The following command, for example, lists the files in the root directory that have changed in the past day: 
349
-
350
-		find / -mtime -1 
351
-
352
-See the `find` [manual](See https://www.gnu.org/software/findutils/manual/find.html). Take note of the security considerations listed in the `find` manual if you are using `find` to troubleshoot an appliance running on Photon OS. 
353
-
354
-### Locate
355
-
356
-The `locate` command is a fast way to find files and directories when all you have is a keyword. Similar to `find` and part of the same `findutils` package preinstalled on the full version of Photon OS by default, the `locate` command finds file names in the file names database. Before you can use `locate` accurately, you should update its database: 
357
-
358
-	updatedb
359
-
360
-Then you can run `locate` to quickly find a file, such as any file name containing `.network`, which can be helpful to see all the system's `.network` configuration files; abridged example: 
361
-
362
-	locate .network
363
-	/etc/dbus-1/system.d/org.freedesktop.network1.conf
364
-	/etc/systemd/network/10-dhcp-en.network
365
-	/usr/lib/systemd/network/80-container-host0.network
366
-	/usr/lib/systemd/network/80-container-ve.network
367
-	/usr/lib/systemd/system/busnames.target.wants/org.freedesktop.network1.busname
368
-	/usr/lib/systemd/system/dbus-org.freedesktop.network1.service
369
-	/usr/lib/systemd/system/org.freedesktop.network1.busnname
370
-	/usr/share/dbus-1/system-services/org.freedesktop.network1.service
371
-
372
-The `locate` command is also a quick way to see whether a troubleshooting tool is installed on Photon OS. Examples: 
373
-
374
-	locate strace
375
-	/usr/bin/strace
376
-	/usr/bin/strace-graph
377
-	/usr/bin/strace-log-merge
378
-	/usr/share/man/man1/strace.1.gz
379
-	/usr/share/vim/vim74/syntax/strace.vim
380
-
381
-	locate traceroute
382
-
383
-The `strace` tool is there but `traceroute` is not. You can, however, quickly install `traceroute` from the Photon OS repository: 
384
-
385
-	tdnf install traceroute
386
-
387
-
388
-### df
389
-
390
-The `df` command reports the disk space available on the file system. Because running out of disk space can lead an application to fail, a quick check of the available space makes sense as an early troubleshooting step: 
391
-
392
-	df -h
393
-
394
-The `-h` option prints out the available and used space in human-readable sizes. After checking the space, you should also check the number of available inodes. Too few available inodes can lead to difficult-to-diagnose problems:
395
-
396
-	df -i
397
-
398
-### md5sum and sha256sum
399
-
400
-`md5sum` calculates 128-bit MD5 hashes--a message digest, or digital signature, of a file--to uniquely identify a file and verify its integrity after file transfers, downloads, or disk errors when the security of the file is not in question. Photon OS also includes `sha256sum`, which is the preferred method of calculating the authenticity of a file to prevent tampering when security is a concern. Photon OS also includes `shasum`, `sha1sum`, `sha384sum`, and `sha512sum`. See the man pages for  `md3sum`, `sha256sum`, and the other SHA utilities. 
401
-
402
-`md5sum` can help troubleshooting installation issues by verifying that the version of Photon OS being installed matches the version on the Bintray download page. If, for instance, bytes were dropped during the download, the checksums will not match. Try downloading it again. 
403
-
404
-### strace
405
-
406
-The `strace` utility follows system calls and signals as they are executed so that you can see what an application, command, or process is doing. `strace` can trace failed commands, identify where a process obtains its configuration, monitor file activity, and find the location of a crash. 
407
-
408
-By tracing system calls, `strace` can help troubleshoot a broad range of problems, including issues with input-output, memory, interprocess communication, network usage, and application performance. 
409
-
410
-For troubleshooting a problem that gives off few or no clues, the following command displays every system call: 
411
-
412
-	strace ls -al
413
-
414
-With strace commands, you can route the output to a file to make it easier to analyze: 
415
-
416
-	strace -o output.txt ls -al
417
-
418
-`strace` can reveal the files that an application is trying to open with the `-eopen` option. This combination can help troubleshoot an application that is failing because it is missing files or being denied access to a file it needs. If, for example, you see "No such file or directory" in the results of `strace -eopen`, something might be wrong: 
419
-
420
-	strace -eopen sshd
421
-	open("/usr/lib/x86_64/libpam.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
422
-	open("/usr/lib/libpam.so.0", O_RDONLY|O_CLOEXEC) = 3
423
-
424
-In the results above, it's OK that the first file is missing because it is found in the next line. In other cases, the application might be unable to open one of its configuration files or reading the wrong one. If the results say "permission denied" for one of the files, check the permissions of the file with `ls -l` or `stat`.   
425
-
426
-When troubleshooting with `strace`, you can include the process ID in its commands. Here's an example of how to find a process ID: 
427
-
428
-	ps -ef | grep apache
429
-
430
-And you can then use `strace` to examine the file a process is working with: 
431
-
432
-	strace -e trace=file -p 1719
433
-
434
-A similar command can trace network traffic: 
435
-
436
-	strace -p 812 -e trace=network
437
-
438
-If an application is crashing, use `strace` to trace the application and then analyze what happens right before the application crashes.
439
-
440
-You can also trace the child processes that an application spawns with the fork system call, and you can do so with systemctl commands that start a process to identify why an application crashes immediately or fails to start: 
441
-
442
-	strace -f -o output.txt systemctl start httpd
443
-
444
-Here's another example. If journalctl is showing that networkd is failing, you can run strace to help determine why: 
445
-
446
-	strace -o output.txt systemctl restart systemd-networkd
447
-
448
-And then grep inside the results for something, such as _exit_ or _error_: 
449
-
450
-	grep exit output.txt
451
-
452
-Maybe the results indicate systemd-resolved is going wrong, and you can then strace it, too: 
453
-
454
-	strace -f -o output.txt systemctl restart systemd-resolved
455
-
456
-### file
457
-
458
-The `file` command determines the file type, which can help troubleshoot problems when an application mistakes one type of file for another, leading it to misbehave. Example: 
459
-
460
-	file /usr/sbin/sshd
461
-	/usr/sbin/sshd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped
462
-
463
-### stat
464
-
465
-The `stat` command can help troubleshoot problems with files or the file system by showing the last date it was modified and other information. Example:  
466
-
467
-	stat /dev/sda1
468
-	File: '/dev/sda1'
469
-	Size: 0               Blocks: 0          IO Block: 4096   block special file
470
-	Device: 6h/6d   Inode: 6614        Links: 1     Device type: 8,1
471
-	Access: (0660/brw-rw----)  Uid: (    0/    root)   Gid: (    8/    disk)
472
-	Access: 2016-09-02 12:23:56.135999936 +0000
473
-	Modify: 2016-09-02 12:23:52.879999981 +0000
474
-	Change: 2016-09-02 12:23:52.879999981 +0000
475
-	Birth: -
476
-
477
-On Photon OS, `stat` is handy to show permissions for a file or directory in both their absolute octal notation and their read-write-execute abbreviation; truncated example: 
478
-
479
-	chmod 777 tester.md
480
-	stat tester.md
481
-	  File: 'tester.md'
482
-	  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
483
-	Device: 801h/2049d      Inode: 316385      Links: 1
484
-	Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
485
-
486
-### watch
487
-
488
-The `watch` utility runs a command at regular intervals so you can observe how its output changes over time. `watch` can help dynamically monitor network links, routes, and other information when you are troubleshooting networking or performance issues. Examples: 
489
-
490
-	watch -n0 --differences ss
491
-	watch -n1 --differences ip route
492
-	
493
-Here's another example with a screenshot of the command's output. This command monitors the traffic on your network links. The highlighted numbers are updated every second so you can see the traffic fluctuating: 
494
-
495
-	watch -n1 --differences ip -s link show up
496
-
497
-![The dynamic output of the watch utility](images/watchcmd.png)  
498
-
499
-### vmstat and fdisk
500
-
501
-The `vmstat` tool displays statistics about virtual memory, processes, block input-output, disks, and CPU activity. This tool can help diagnose performance problems, especially system bottlenecks.  
502
-
503
-Its output on a Photon OS virtual machine running in VMware Workstation 12 Pro without a heavy load looks like this: 
504
-
505
-	vmstat
506
-	procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
507
-	 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
508
-	 0  0      0   5980  72084 172488    0    0    27    44  106  294  1  0 98  1  0
509
-
510
-What do all these codes mean? They are explained in the vmstat man page. 
511
-
512
-If `r`, the number of runnable processes, is higher than 10, the machine is under stress; consider intervening to reduce the number of processes or to distribute some of the processes to other machines. In other words, the machine has a bottleneck in executing processes.
513
-
514
-If `cs`, the number of context switches per second, is really high, there may be too many jobs running on the machine. 
515
-
516
-If `in`, the number of interrupts per second, is relatively high, there might be a bottleneck for network or disk IO. 
517
-
518
-You can investigate disk IO further by using vmstat's `-d` option to report disk statistics; abridged example on a machine with little load: 
519
-
520
-	vmstat -d
521
-	disk- ------------reads------------ ------------writes----------- -----IO------
522
-	       total merged sectors      ms  total merged sectors      ms    cur    sec
523
-	ram0       0      0       0       0      0      0       0       0      0      0
524
-	ram1       0      0       0       0      0      0       0       0      0      0
525
-	loop0      0      0       0       0      0      0       0       0      0      0
526
-	loop1      0      0       0       0      0      0       0       0      0      0
527
-	sr0        0      0       0       0      0      0       0       0      0      0
528
-	sda    22744    676  470604   12908  72888  24949  805224  127692      0    130
529
-
530
-The `-D` option summarizes disk statistics:
531
-
532
-	vmstat -D
533
-	           26 disks
534
-	            2 partitions
535
-	        22744 total reads
536
-	          676 merged reads
537
-	       470604 read sectors
538
-	        12908 milli reading
539
-	        73040 writes
540
-	        25001 merged writes
541
-	       806872 written sectors
542
-	       127808 milli writing
543
-	            0 inprogress IO
544
-	          130 milli spent IO
545
-
546
-You can also get statistics about a partition. First, run the `fdisk -l` command to list the machine's devices. Then run `vmstat -p` with the name of a device to view its stats: 
547
-
548
-
549
-	fdisk -l
550
-	Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
551
-	Units: sectors of 1 * 512 = 512 bytes
552
-	Sector size (logical/physical): 512 bytes / 4096 bytes
553
-	I/O size (minimum/optimal): 4096 bytes / 4096 bytes
554
-	...
555
-	Device        Start      End  Sectors Size Type
556
-	/dev/sda1      2048 16771071 16769024   8G Linux filesystem
557
-	/dev/sda2  16771072 16777182     6111   3M BIOS boot
558
-
559
-	vmstat -p /dev/sda1
560
-	sda1          reads   read sectors  writes    requested writes
561
-	               22579     473306      78510     866088
562
-
563
-See the vmstat man page for more options. 
564
-
565
-### lsof
566
-
567
-The `lsof` command lists open files. And this tool's definition of an open file is quite broad--directories, libraries, streams, domain sockets, and Internet sockets are all considered files, making `lsof` broadly applicable as a mid-level troubleshooting tool to identify the files a process is using. Because a Linux system like Photon OS uses files to do its work, you can run `lsof` as root to see how the system is using them and to see how an application works. 
568
-
569
-If, for example, you cannot unmount a disk because it is in use, you can run `lsof` to identify the files on the disk that are being used. Here's an example showing what's using the root directory: 
570
-
571
-	lsof /root
572
-	COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
573
-	bash       879 root  cwd    DIR    8,1     4096 262159 /root
574
-	bash      1265 root  cwd    DIR    8,1     4096 262159 /root
575
-	sftp-serv 1326 root  cwd    DIR    8,1     4096 262159 /root
576
-	gdb       1351 root  cwd    DIR    8,1     4096 262159 /root
577
-	bash      1395 root  cwd    DIR    8,1     4096 262159 /root
578
-	lsof      1730 root  cwd    DIR    8,1     4096 262159 /root
579
-
580
-You can do the same with an application or virtual appliance by running `lsof` with the user name or process ID of the app. Here's an example that lists the open files used by the Apache HTTP Server:  
581
-
582
-	lsof -u apache
583
-
584
-Running the command with the `-i` option lists all the open network and Internet files, which can help troubleshoot network problems: 
585
-
586
-	lsof -i
587
-
588
-See the Unix socket addresses of a user like _zookeeper_: 
589
-
590
-	lsof -u zookeeper -U
591
-
592
-And here's an example that shows the processes running on Ports 1 through 80:
593
-
594
-	lsof -i TCP:1-80
595
-	COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
596
-	httpd    403   root    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
597
-	httpd    407 apache    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
598
-	httpd    408 apache    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
599
-	httpd    409 apache    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
600
-	sshd     820   root    3u  IPv4  11336      0t0  TCP *:ssh (LISTEN)
601
-	sshd     820   root    4u  IPv6  11343      0t0  TCP *:ssh (LISTEN)
602
-	sshd    1258   root    3u  IPv4  48040      0t0  TCP 198.51.100.143:ssh->198.51.100.1:49759 (ESTABLISHED)
603
-	sshd    1319   root    3u  IPv4  50866      0t0  TCP 198.51.100.143:ssh->198.51.100.1:51054 (ESTABLISHED)
604
-	sshd    1388   root    3u  IPv4  56438      0t0  TCP 198.51.100.143:ssh->198.51.100.1:60335 (ESTABLISHED)
605
-
606
-You can also inspect the files opened by a process ID. Here's a truncated example that queries the files open by the systemd network service: 
607
-
608
-	lsof -p 1917
609
-	COMMAND    PID            USER   FD      TYPE             DEVICE SIZE/OFF   NODE NAME
610
-	systemd-n 1917 systemd-network  cwd       DIR                8,1     4096      2 /
611
-	systemd-n 1917 systemd-network  txt       REG                8,1   887896 272389 /usr/lib/systemd/systemd-networkd
612
-	systemd-n 1917 systemd-network  mem       REG                8,1   270680 262267 /usr/lib/libnss_files-2.22.so
613
-	systemd-n 1917 systemd-network    0r      CHR                1,3      0t0   5959 /dev/null
614
-	systemd-n 1917 systemd-network    1u     unix 0x0000000000000000      0t0  45734 type=STREAM
615
-	systemd-n 1917 systemd-network    3u  netlink                         0t0   6867 ROUTE
616
-	systemd-n 1917 systemd-network    4u     unix 0x0000000000000000      0t0  45744 type=DGRAM
617
-	systemd-n 1917 systemd-network    9u  netlink                         0t0  45754 KOBJECT_UEVENT
618
-	systemd-n 1917 systemd-network   12u  a_inode               0,11        0   5955 [timerfd]
619
-	systemd-n 1917 systemd-network   13u     IPv4             104292      0t0    UDP 198.51.100.143:bootpc
620
-
621
-### fuser
622
-
623
-The `fuser` command identifies the process IDs of processes using files or sockets. The term _process_ is, in this case, synonymous with _user_. To identify the process ID of a process using a socket, run `fuser` with its namespace option and specify `tcp` or `udp` and the name of the process or port. Examples: 
624
-
625
-	fuser -n tcp ssh
626
-	ssh/tcp:               940  1308
627
-	fuser -n tcp http
628
-	http/tcp:              592   594   595   596
629
-	fuser -n tcp 80
630
-	80/tcp:                592   594   595   596
631
-
632
-
633
-### ldd
634
-
635
-By revealing the shared libraries that a program depends on, `ldd` can help troubleshoot an application that is missing a library or finding the wrong one.
636
-
637
-If, for example, you find output that says "file not found," check the path to the library.  
638
-
639
-	ldd /usr/sbin/sshd
640
-    linux-vdso.so.1 (0x00007ffc0e3e3000)
641
-    libpam.so.0 => (file not found)
642
-    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f624e570000)
643
-
644
-You can also use the `objdump` command to show dependencies for a program's object files; example:
645
-
646
-	objdump -p /usr/sbin/sshd | grep NEEDED
647
-
648
-### gdb
649
-
650
-The gdb tool is the GNU debugger. It lets you peer inside a program while it executes or when it crashes so that you can catch bugs on the fly. The gdb tool is typically used to debug programs written in C and C++. On Photon OS, gdb can help you determine why an application crashed. See the man page for gdb for instructions on how to run it. For an extensive example on how to use gdb to troubleshoot Photon OS running on a VM when you cannot login to Photon OS, see the section on troubleshooting boot and logon problems. 
651
-
652
-### Other Troubleshooting Tools Installed by Default
653
-
654
-The following troubleshooting tools are included in the full version of Photon OS: 
655
-
656
-* `grep` searches files for patterns. 
657
-* `ping` tests network connectivity. 
658
-* `strings` displays the characters in a file to identify its contents.
659
-* `lsmod` lists loaded modules.
660
-* `ipcs` shows data about the inter-process communication (IPC) resources to which a process has read access--typically, shared memory segments, message queues, and semaphore arrays.
661
-* `nm` lists symbols from object files. 
662
-* `diff` compares files side by side. Useful to compare two configuration files when one version works and the other doesn't. 
663
-
664
-### Installing More Tools from Repositories
665
-
666
-You can install several troubleshooting tools from the Photon OS repositories by using the default package management system, `tdnf`. 
667
-
668
-If a tool you need is not installed, the first thing you should do is search the repositories to see whether it's available. The traceroute tool, for example, is not installed by default. Here's how to search for it in the repositories:  
669
-
670
-	tdnf search traceroute
671
-	traceroute : Traces the route taken by packets over an IPv4/IPv6 network
672
-
673
-The results of the above command show that traceroute exists in the repository. You install it with `tdnf`: 
674
-
675
-	tdnf install traceroute
676
-
677
-Additional tools are not installed by default but are in the repository for instant installation with `tdnf`: 
678
-
679
-* `net-tools`: networking tools.
680
-* `ltrace`: tool for intercepting and recording dynamic library calls. It can identify the function an application was calling when it crashed, making it useful for debugging.
681
-* `nfs-utils`: client tools for the kernel Network File System, or NFS, including showmount; installed by default in the full version of Photon OS but not in the minimal version. 
682
-* `pcstat`: A tool that inspects which pages of a file or files are being cached by the Linux kernel.
683
-* `sysstat` and `sar`: Utilities to monitor system performance and usage activity. Installing sysstat also installs sar.
684
-* `systemtap` and `crash`: The systemtap utility is a programmable instrumentation system for diagnosing problems of performance or function. Installing systemtap also installs crash, which is a kernel crash analysis utility for live systems and dump files.
685
-* `dstat`: versatile tool for viewing and analyzing statistics about system resources.
686
-
687
-The `dstat` tool, for example, can help troubleshoot system performance. The tool shows a live, running list of statistics about system resources: 
688
-
689
-	dstat
690
-	You did not select any stats, using -cdngy by default.
691
-	----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
692
-	usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
693
-	  1   0  98   1   0   0|4036B   42k|   0     0 |   0     0 |  95   276
694
-	  1   0  98   1   0   0|   0    64k|  60B  940B|   0     0 | 142   320
695
-	  1   1  98   0   0   0|   0    52k|  60B  476B|   0     0 | 149   385
696
-
697
-
698
-### Linux Troubleshooting Tools Not on Photon OS
699
-
700
-The following Linux troubleshoot tools are neither installed on Photon OS by default nor available in the Photon OS repositories: 
701
-
702
-* iostat
703
-* telnet (use SSH instead)
704
-* Iprm
705
-* hdparm
706
-* syslog (use journalctl instead)
707
-* ddd
708
-* ksysmoops
709
-* xev
710
-* GUI tools (because Photon OS has no GUI)
711
-
712
-## Systemd
713
-
714
-Photon OS manages services with systemd and its command-line utility for inspecting and controlling the system, `systemctl`, not the deprecated commands of init.d. For example, instead of running the /etc/init.d/ssh script to stop and start the OpenSSH server on a init.d-based Linux system, you control the service by running the following systemctl commands on Photon OS: 
715
-
716
-	systemctl stop sshd
717
-	systemctl start sshd
718
-
719
-For an overview of systemd, see [systemd System and Service Manager](https://www.freedesktop.org/wiki/Software/systemd/) and the [man page for systemd](https://www.freedesktop.org/software/systemd/man/systemd.html). The systemd man pages are listed at [https://www.freedesktop.org/software/systemd/man/](https://www.freedesktop.org/software/systemd/man/).
720
-
721
-### Viewing Services 
722
-
723
-To view a description of all the active, loaded units, execute the systemctl command without any options or arguments: 
724
-
725
-	systemctl
726
-
727
-To see all the loaded, active, and inactive units and their description, run this command: 
728
-
729
-	systemctl --all
730
-
731
-To see all the unit files and their current status but no description, run this command: 
732
-
733
-	systemctl list-unit-files
734
-
735
-The `grep` command filters the services by a search term, a helpful tactic to recall the exact name of a unit file without looking through a long list of names. Example: 
736
-
737
-	systemctl list-unit-files | grep network
738
-	org.freedesktop.network1.busname           static
739
-	dbus-org.freedesktop.network1.service      enabled
740
-	systemd-networkd-wait-online.service       enabled
741
-	systemd-networkd.service                   enabled
742
-	systemd-networkd.socket                    enabled
743
-	network-online.target                      static
744
-	network-pre.target                         static
745
-	network.target  
746
-
747
-### Using Systemd Commands Instead of Init.d Commands
748
-
749
-Basic system administration commands on Photon OS differ from those on operating systems that use SysVinit. Since Photon OS uses systemd instead of SysVinit, you must use systemd commands to manage services. 
750
-
751
-For example, to list all the services that you can manage on Photon OS, you run the following command instead of `ls /etc/rc.d/init.d/`: 
752
-
753
-	systemctl list-unit-files --type=service
754
-
755
-Similarly, to check whether the `sshd` service is enabled, on Photon OS you run the following command instead of `chkconfig sshd`:
756
-
757
-	systemctl is-enabled sshd
758
-
759
-The `chkconfig --list` command that shows which services are enabled for which runlevel on a SysVinit computer becomes substantially different on Photon OS because there are no runlevels, only targets: 
760
-
761
-	ls /etc/systemd/system/*.wants
762
-
763
-You can also display similar information with the following command: 
764
-
765
-	systemctl list-unit-files --type=service
766
-
767
-Here is a list of some of the systemd commands that take the place of SysVinit commands on Photon OS: 
768
-
769
-	USE THIS SYSTEMD COMMAND 	INSTEAD OF THIS SYSVINIT COMMAND
770
-	systemctl start sshd 		service sshd start
771
-	systemctl stop sshd 		service sshd stop
772
-	systemctl restart sshd 		service sshd restart
773
-	systemctl reload sshd 		service sshd reload
774
-	systemctl condrestart sshd 	service sshd condrestart
775
-	systemctl status sshd 		service sshd status
776
-	systemctl enable sshd 		chkconfig sshd on
777
-	systemctl disable sshd 		chkconfig sshd off
778
-	systemctl daemon-reload		chkconfig sshd --add
779
-
780
-### Analyzing System Logs with journalctl
781
-
782
-The journalctl tool queries the contents of the systemd journal. On Photon OS, all the system logs except the installation log and the cloud-init log are written into the systemd journal. 
783
-
784
-If called without parameters, the `journalctl` command shows all the contents of the journal, beginning with the oldest entry. To display the output in reverse order with new entries first, include the `-r` option in the command:
785
-
786
-	journalctl -r
787
-
788
-The `journalctl` command includes many options to filter its output. For help troubleshooting systemd, two journalctl queries are particularly useful: showing the log entries for the last boot and showing the log entries for a systemd service unit. This command displays the messages that systemd generated during the last time the machine started: 
789
-
790
-	journalctl -b
791
-
792
-This command reveals the messages for only the systemd service unit specified by the `-u` option, which in the following example is the auditing service: 
793
-
794
-	journalctl -u auditd
795
-
796
-You can look at the messages for systemd itself or for the network service:
797
-
798
-	journalctl -u systemd
799
-	journalctl -u systemd-networkd
800
-
801
-Example:  
802
-
803
-	root@photon-1a0375a0392e [ ~ ]# journalctl -u systemd-networkd
804
-	-- Logs begin at Tue 2016-08-23 14:35:50 UTC, end at Tue 2016-08-23 23:45:44 UTC. --
805
-	Aug 23 14:35:52 photon-1a0375a0392e systemd[1]: Starting Network Service...
806
-	Aug 23 14:35:52 photon-1a0375a0392e systemd-networkd[458]: Enumeration completed
807
-	Aug 23 14:35:52 photon-1a0375a0392e systemd[1]: Started Network Service.
808
-	Aug 23 14:35:52 photon-1a0375a0392e systemd-networkd[458]: eth0: Gained carrier
809
-	Aug 23 14:35:53 photon-1a0375a0392e systemd-networkd[458]: eth0: DHCPv4 address 198.51.100.1
810
-	Aug 23 14:35:54 photon-1a0375a0392e systemd-networkd[458]: eth0: Gained IPv6LL
811
-	Aug 23 14:35:54 photon-1a0375a0392e systemd-networkd[458]: eth0: Configured
812
-
813
-
814
-For more information, see [journalctl](https://www.freedesktop.org/software/systemd/man/journalctl.html) or the journalctl man page by running this command: `man journalctl`
815
-
816
-### Inspecting Services with `systemd-analyze`
817
-
818
-The `systemd-analyze` command reveals performance statistics for boot times, traces system services, and verifies unit files. It can help troubleshoot slow system boots and incorrect unit files. See the man page for a list of options. Examples:
819
-
820
-	systemd-analyze blame
821
-
822
-	systemd-analyze dump
823
-
824
-## Networking
825
-
826
-### Managing the Network Configuration
827
-
828
-The network service, which is enabled by default, starts when the system boots. You manage the network service by using systemd commands, such as systemd-networkd, systemd-resolvd, and networkctl. You can check its status of the network service by running the following command: 
829
-
830
-	systemctl status systemd-networkd
831
-
832
-Here is a healthy result of the command: 
833
-
834
-	* systemd-networkd.service - Network Service
835
-	   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
836
-	   Active: active (running) since Fri 2016-04-29 15:08:51 UTC; 6 days ago
837
-	     Docs: man:systemd-networkd.service(8)
838
-	 Main PID: 291 (systemd-network)
839
-	   Status: "Processing requests..."
840
-	   CGroup: /system.slice/systemd-networkd.service
841
-	           `-291 /lib/systemd/systemd-networkd
842
-
843
-Because Photon OS relies on systemd to manage services, you should employ the systemd suite of commands, not deprecated init.d commands or other deprecated commands, to manage networking. 
844
-
845
-### Use `ip` and `ss` Commands Instead of `ifconfig` and `netstat`
846
-
847
-Although the `ifconfig` command and the `netstat` command work on Photon OS, VMware recommends that you use the `ip` or `ss` commands. The `ifconfig` and `netstat` commands are deprecated. 
848
-
849
-For example, instead of running `netstat` to display a list of network interfaces, consider running the `ss` command. Similarly, to display information for IP addresses, instead of running `ifconfig -a`, run the `ip addr` command. Examples:
850
-
851
-	USE THIS IPROUTE COMMAND 	INSTEAD OF THIS NET-TOOL COMMAND
852
-	ip addr 					ifconfig -a
853
-	ss 							netstat
854
-	ip route 					route
855
-	ip maddr 					netstat -g
856
-	ip link set eth0 up 		ifconfig eth0 up
857
-	ip -s neigh					arp -v
858
-	ip link set eth0 mtu 9000	ifconfig eth0 mtu 9000
859
-
860
-Using the `ip route` version of a command instead of the net-tools version often provides more complete, accurate information on Photon OS, as the following example demonstrates: 
861
-
862
-	ip neigh
863
-	198.51.100.2 dev eth0 lladdr 00:50:56:e2:02:0f STALE
864
-	198.51.100.254 dev eth0 lladdr 00:50:56:e7:13:d9 STALE
865
-	198.51.100.1 dev eth0 lladdr 00:50:56:c0:00:08 DELAY
866
-
867
-	arp -a
868
-	? (198.51.100.2) at 00:50:56:e2:02:0f [ether] on eth0
869
-	? (198.51.100.254) at 00:50:56:e7:13:d9 [ether] on eth0
870
-	? (198.51.100.1) at 00:50:56:c0:00:08 [ether] on eth0
871
-
872
-**Important:** If you modify an IPv6 configuration or add an IPv6 interface, you must restart `systemd-networkd`. Traditional methods of using `ifconfig` commands will be inadequate to register the changes. Run the following command instead: 
873
-
874
-	systemctl restart systemd-networkd
875
-
876
-
877
-### Inspecting the Status of Network Links with `networkctl`
878
-
879
-The `networkctl` command shows information about network connections that helps you configure networking services and troubleshoot networking problems. You can, for example, progressively add options and arguments to the `networkctl` command to move from general information about network connections to specific information about a network connection. 
880
-
881
-Running `networkctl` without options defaults to the list command:  
882
-
883
-	networkctl
884
-	IDX LINK             TYPE               OPERATIONAL SETUP
885
-	  1 lo               loopback           carrier     unmanaged
886
-	  2 eth0             ether              routable    configured
887
-	  3 docker0          ether              routable    unmanaged
888
-	 11 vethb0aa7a6      ether              degraded    unmanaged
889
-	 4 links listed.
890
-
891
-Running `networkctl` with the status command displays information that looks like this; you can see there are active network links with IP addresses for not only the Ethernet connection but also a Docker container. 
892
-
893
-	root@photon-rc [ ~ ]# networkctl status
894
-	*      State: routable
895
-	     Address: 198.51.100.131 on eth0
896
-	              172.17.0.1 on docker0
897
-	              fe80::20c:29ff:fe55:3ca6 on eth0
898
-	              fe80::42:f0ff:fef7:bd81 on docker0
899
-	              fe80::4c84:caff:fe76:a23f on vethb0aa7a6
900
-	     Gateway: 198.51.100.2 on eth0
901
-	         DNS: 198.51.100.2
902
-
903
-You can then add a network link, such as the Ethernet connection, as the argument of the status command to show specific information about the link: 
904
-
905
-	root@photon-rc [ ~ ]# networkctl status eth0
906
-	* 2: eth0
907
-	       Link File: /usr/lib/systemd/network/99-default.link
908
-	    Network File: /etc/systemd/network/10-dhcp-en.network
909
-	            Type: ether
910
-	           State: routable (configured)
911
-	            Path: pci-0000:02:01.0
912
-	          Driver: e1000
913
-	      HW Address: 00:0c:29:55:3c:a6 (VMware, Inc.)
914
-	             MTU: 1500
915
-	         Address: 198.51.100.131
916
-	                  fe80::20c:29ff:fe55:3ca6
917
-	         Gateway: 198.51.100.2
918
-	             DNS: 198.51.100.2
919
-	        CLIENTID: ffb6220feb00020000ab116724f520a0a77337
920
-
921
-And you can do the same thing with the Docker container: 
922
-
923
-	networkctl status docker0
924
-	* 3: docker0
925
-	       Link File: /usr/lib/systemd/network/99-default.link
926
-	    Network File: n/a
927
-	            Type: ether
928
-	           State: routable (unmanaged)
929
-	          Driver: bridge
930
-	      HW Address: 02:42:f0:f7:bd:81
931
-	             MTU: 1500
932
-	         Address: 172.17.0.1
933
-	                  fe80::42:f0ff:fef7:bd81
934
-
935
-In the example above, it is OK that the state of the Docker container is unmanaged; Docker handles managing the networking for the containers without using systemd-resolved or systemd-networkd. Instead, Docker manages the container's connection by using its bridge drive.
936
-
937
-For more information about `networkctl` commands and options, see https://www.freedesktop.org/software/systemd/man/networkctl.html.
938
-
939
-### Turning on Network Debugging
940
-
941
-You can set `systemd-networkd` to work in debug mode so that you can analyze log files with debugging information to help troubleshoot networking problems. The following procedure turns on network debugging by adding a drop-in file in /etc/systemd to customize the default systemd configuration in /usr/lib/systemd. 
942
-
943
-First, run the following command as root to create a directory with this exact name, including the `.d` extension:
944
-
945
-	mkdir -p /etc/systemd/system/systemd-networkd.service.d/
946
-
947
-Second, run the following command as root to establish a systemd drop-in unit with a debugging configuration for the network service:
948
-
949
-	cat > /etc/systemd/system/systemd-networkd.service.d/10-loglevel-debug.conf << "EOF"
950
-	[Service]
951
-	Environment=SYSTEMD_LOG_LEVEL=debug
952
-	EOF
953
- 
954
-You must reload the systemctl daemon and restart the systemd-networkd service for the changes to take effect: 
955
-
956
-	systemctl daemon-reload
957
-	systemctl restart systemd-networkd
958
-
959
-Verify that your changes took effect:
960
-
961
-	systemd-delta --type=extended
962
-
963
-View the log files by running this command: 
964
-
965
-	journalctl -u systemd-networkd
966
-
967
-When you are finished debugging the network connections, turn debugging off by deleting the drop-in file: 
968
-
969
-	rm /etc/systemd/system/systemd-networkd.service.d/10-loglevel-debug.conf
970
-
971
-### Installing the Packages for tcpdump and netcat with tdnf
972
-
973
-The minimal version of Photon OS leaves out several useful networking tools to keep the operating system lean. Tcpdump, for example, is absent in the minimal version but available in the repository. The minimal version does, however, include the iproute2 tools by default. 
974
-
975
-Tcpdump captures and analyzes packets on a network interface. On Photon OS, you install tcpdump and its accompanying package libpcap, a C/C++ library for capturing network traffic, by using tdnf, Photon's command-line package manager: 
976
-
977
-	tdnf install tcpdump
978
-
979
-Netcat, a tool for sending data over network connections with TCP or UDP, appears in neither the minimal nor the full version of Photon OS. But since netcat furnishes powerful options for analyzing, troubleshooting, and debugging network connections, you might want to install it. To do so, run the following command: 
980
-
981
-	tdnf install netcat
982
-
983
-### Checking Firewall Rules
984
-
985
-The design of Photon OS emphasizes security. On the minimal and full versions of Photon OS, the default security policy turns on the firewall and drops packets from external interfaces and  applications. As a result, you might need to add rules to iptables to permit forwarding, allow protocols like HTTP, and open ports. In other words, you must configure the firewall for your applications and requirements. 
986
-
987
-The default iptables settings on the full version look like this:
988
-
989
-	iptables --list
990
-	Chain INPUT (policy DROP)
991
-	target     prot opt source               destination
992
-	ACCEPT     all  --  anywhere             anywhere
993
-	ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
994
-	ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
995
-
996
-	Chain FORWARD (policy DROP)
997
-	target     prot opt source               destination
998
-
999
-	Chain OUTPUT (policy DROP)
1000
-	target     prot opt source               destination
1001
-	ACCEPT     all  --  anywhere             anywhere
1002
-
1003
-
1004
-To find out how to adjust the settings, see the man page for iptables. 
1005
-
1006
-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).
1007
-
1008
-If you are unable to ping a Photon OS machine, one of the first things you should do is check the firewall rules. Do they allow connectivity for the port and protocol in question? You can supplement the `iptables` commands by using `lsof` to, for instance, see the processes listening on ports: 
1009
-
1010
-	lsof -i -P -n
1011
-
1012
-### Netmgr
1013
-
1014
-If you are running a VMware appliance on Photon OS and the VAMI module has problems or if there are networking issues, you can use the Photon OS `netmgr` utility to inspect the networking settings. Make sure, in particular, that the IP addresses for the DNS server and other infrastructure are correct. Use `tcpdump` to analyze the issues. 
1015
-
1016
-If you get an error code from netmgr, it is a standard Unix error code--enter it into a search engine to obtain more information.
1017
-
1018
-## File System
1019
-
1020
-This section covers troubleshooting the file system.
1021
-
1022
-### Checking Disk Space
1023
-
1024
-One of the first simple steps to take when you're troubleshooting is to check how much disk space is available by running the `df` command: 
1025
-
1026
-	df -h
1027
-
1028
-### Adding a Disk and Partitioning It
1029
-
1030
-If the `df` command shows that the file system is indeed nearing capacity, you can add a new disk on the fly and partition it to increase capacity. 
1031
-
1032
-First, add a new disk. You can, for example, add a new disk to a virtual machine by using the VMware vSphere Client. After adding a new disk, check for the new disk by using `fdisk`; see the section on `fdisk` below. In the following example, the new disk is named `/dev/sdb`:
1033
-
1034
-	fdisk -l
1035
-	Device        Start      End  Sectors Size Type
1036
-	/dev/sda1      2048 16771071 16769024   8G Linux filesystem
1037
-	/dev/sda2  16771072 16777182     6111   3M BIOS boot
1038
-	
1039
-	Disk /dev/sdb: 1 GiB, 1073741824 bytes, 2097152 sectors
1040
-	Units: sectors of 1 * 512 = 512 bytes
1041
-	Sector size (logical/physical): 512 bytes / 512 bytes
1042
-	I/O size (minimum/optimal): 512 bytes / 512 bytes
1043
-
1044
-After you confirm that Photon OS registers the new disk, you can partition it with the `parted` wizard. The command to partition the disk on Photon OS is as follows: 
1045
-
1046
-	parted /dev/sdb
1047
-
1048
-And then you use the parted wizard to create it (see the man page for `parted` for more information):
1049
-
1050
-	mklabel gpt
1051
-	mkpart ext3 1 1024
1052
-
1053
-Then you must create a file system on the partition:
1054
-
1055
-	mkfs -t ext3 /dev/sdb1
1056
-
1057
-Make a directory where you will mount the new file system: 
1058
-
1059
-	mkdir /newdata
1060
-
1061
-Finally, open `/etc/fstab` and add the new file system with the options that you want: 
1062
-
1063
-	#system mnt-pt  type    options dump    fsck
1064
-	/dev/sda1       /       ext4    defaults,barrier,noatime,noacl,data=ord$
1065
-	/dev/cdrom      /mnt/cdrom      iso9660 ro,noauto       0       0
1066
-	/dev/sdb1       /newdata        ext3    defaults        0		0
1067
-
1068
-Mount it for now: 
1069
-
1070
-	mount /newdata
1071
-
1072
-Check your work: 
1073
-
1074
-	df -h
1075
-	Filesystem      Size  Used Avail Use% Mounted on
1076
-	/dev/root       7.8G  4.4G  3.1G  59% /
1077
-	devtmpfs        172M     0  172M   0% /dev
1078
-	tmpfs           173M     0  173M   0% /dev/shm
1079
-	tmpfs           173M  664K  172M   1% /run
1080
-	tmpfs           173M     0  173M   0% /sys/fs/cgroup
1081
-	tmpfs           173M   36K  173M   1% /tmp
1082
-	tmpfs            35M     0   35M   0% /run/user/0
1083
-	/dev/sdb1       945M  1.3M  895M   1% /newdata
1084
-
1085
-### Expanding Disk Partition
1086
-
1087
-If you need more space, you can expand the last partition of your disk after resizing the disk. In the examples we are assuming `sda` as disk device.
1088
-
1089
-After the disk is resized in the virtual machine, it's necessary to tell the system to recognize the new disk ending boundary without rebooting:
1090
-
1091
-	echo 1 > /sys/class/block/sda/device/rescan
1092
-
1093
-You will need to install the parted package to resize the disk partition, which is not available by default. Just run the following command to install it: `tdnf install parted`.
1094
-
1095
-	# parted /dev/sda
1096
-	GNU Parted 3.2
1097
-	Using /dev/sda
1098
-	Welcome to GNU Parted! Type 'help' to view a list of commands.
1099
-
1100
-List all partitions available to fix the GPT and check the last partition number:
1101
-
1102
-	(parted) print
1103
-
1104
-	Warning: Not all of the space available to /dev/sda appears to be used, you can
1105
-	fix the GPT to use all of the space (an extra 4194304 blocks) or continue with
1106
-	the current setting? 
1107
-	Fix/Ignore?
1108
-
1109
-Press `f` to fix the GPT layout.
1110
-
1111
-	Model: VMware Virtual disk (scsi)
1112
-	Disk /dev/sda: 34.4GB
1113
-	Sector size (logical/physical): 512B/512B
1114
-	Partition Table: gpt
1115
-	Disk Flags: 
1116
-
1117
-	Number  Start   End     Size    File system  Name  Flags
1118
-	1      1049kB  3146kB  2097kB                     bios_grub
1119
-	2      3146kB  8590MB  8587MB  ext4
1120
-
1121
-In this case we have the partition `2` as last, then we extend the partition to 100% of the remaining size:
1122
-
1123
-	(parted) resizepart 2 100%
1124
-
1125
-Finally, expand the filesystem to the new size:
1126
-
1127
-	resize2fs /dev/sda2
1128
-	resize2fs 1.42.13 (17-May-2015)
1129
-	Filesystem at /dev/sda2 is mounted on /; on-line resizing required
1130
-	old_desc_blocks = 1, new_desc_blocks = 2
1131
-	The filesystem on /dev/sda2 is now 8387835 (4k) blocks long.
1132
-
1133
-The new space is already available in the system:
1134
-
1135
-	df -h
1136
-	Filesystem      Size  Used Avail Use% Mounted on
1137
-	/dev/root        32G  412M   30G   2% /
1138
-	devtmpfs       1001M     0 1001M   0% /dev
1139
-	tmpfs          1003M     0 1003M   0% /dev/shm
1140
-	tmpfs          1003M  252K 1003M   1% /run
1141
-	tmpfs          1003M     0 1003M   0% /sys/fs/cgroup
1142
-	tmpfs          1003M     0 1003M   0% /tmp
1143
-	tmpfs           201M     0  201M   0% /run/user/0
1144
-
1145
-### fdisk
1146
-
1147
-The `fdisk` command manipulates the disk partition table. You can, for example, use `fdisk` to list the disk partitions so that you can identify the root Linux file system. Here is an truncated example showing `/dev/sda1` to be the root Linux partition: 
1148
-
1149
-	fdisk -l
1150
-	Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
1151
-	Units: sectors of 1 * 512 = 512 bytes
1152
-	Sector size (logical/physical): 512 bytes / 4096 bytes
1153
-	I/O size (minimum/optimal): 4096 bytes / 4096 bytes
1154
-	...
1155
-	Disk /dev/sda: 8 GiB, 8589934592 bytes, 16777216 sectors
1156
-	Units: sectors of 1 * 512 = 512 bytes
1157
-	Sector size (logical/physical): 512 bytes / 512 bytes
1158
-	I/O size (minimum/optimal): 512 bytes / 512 bytes
1159
-	Disklabel type: gpt
1160
-	Disk identifier: 3CFA568B-2C89-4290-8B52-548732A3972D
1161
-
1162
-	Device        Start      End  Sectors Size Type
1163
-	/dev/sda1      2048 16771071 16769024   8G Linux filesystem
1164
-	/dev/sda2  16771072 16777182     6111   3M BIOS boot
1165
-
1166
-Remember the `fdisk -l` command--it will be used later in a section that demonstrates how to reset a lost root password. 
1167
-
1168
-### fsck
1169
-
1170
-The Photon OS file system includes btrfs and ext4. The default root file system is ext4, which you can see by looking at the file system configuration file, `/etc/fstab`: 
1171
-
1172
-	cat /etc/fstab
1173
-	#system mnt-pt  type    options dump    fsck
1174
-	/dev/sda1       /       ext4    defaults,barrier,noatime,noacl,data=ordered     1       1
1175
-	/dev/cdrom      /mnt/cdrom      iso9660 ro,noauto       0       0
1176
-
1177
-The `1` in the fifth column, under `fsck`, indicates that fsck checks the file system when the system boots.
1178
-
1179
-You can manually check the file system by using the file system consistency check tool, `fsck`, after you unmount the file system. You can also perform a read-only check without unmounting it:
1180
-
1181
-	fsck -nf /dev/sda1
1182
-	fsck from util-linux 2.27.1
1183
-	e2fsck 1.42.13 (17-May-2015)
1184
-	Warning!  /dev/sda1 is mounted.
1185
-	Warning: skipping journal recovery because doing a read-only filesystem check.
1186
-	Pass 1: Checking inodes, blocks, and sizes
1187
-	Pass 2: Checking directory structure
1188
-	Pass 3: Checking directory connectivity
1189
-	Pass 4: Checking reference counts
1190
-	Pass 5: Checking group summary information
1191
-	Free blocks count wrong (1439651, counted=1423942).
1192
-	Fix? no
1193
-	Free inodes count wrong (428404, counted=428397).
1194
-	Fix? no
1195
-	/dev/sda1: 95884/524288 files (0.3% non-contiguous), 656477/2096128 blocks
1196
-
1197
-The inodes count is probably off because the file system is mounted and in use. To fix problems, you must first unmount the file system and then run fsck again: 
1198
-
1199
-	umount /dev/sda1
1200
-	umount: /: target is busy
1201
-	        (In some cases useful info about processes that
1202
-	         use the device is found by lsof(8) or fuser(1).)
1203
-
1204
-So check it with `lsof`:
1205
-
1206
-	lsof | grep ^jbd2/sd
1207
-	jbd2/sda1   99                root  cwd       DIR                8,1     4096          2 /
1208
-	jbd2/sda1   99                root  rtd       DIR                8,1     4096          2 /
1209
-	jbd2/sda1   99                root  txt   unknown                                        /proc/99/exe
1210
-
1211
-The file system is indeed in use. What troubleshooting tool would you use next to further explore the applications or processes that are using the file system?  
1212
-
1213
-### Fixing File System Errors When fsck Fails
1214
-
1215
-A potential issue is that when `fsck` runs during startup, it finds a problem that prevents the system from fully booting until you fix the issue by running fsck manually. This kind of a problem can occur when Photon OS is the operating system for a VM running an appliance. 
1216
-
1217
-If fsck fails when the computer boots and an error message says to run fsck manually, you can troubleshoot by restarting the VM, altering the GRUB edit menu to enter emergency mode before Photon OS fully boots, and running fsck.
1218
-
1219
-1. Take a snapshot of the virtual machine. 
1220
-
1221
-1. Restart the virtual machine running Photon OS. 
1222
-
1223
-1. When the Photon OS splash screen appears as it restarts, type the letter `e` to go to the GNU GRUB edit menu. Be quick about it: Because Photon OS reboots so quickly, you won't have much time to type `e`. Remember that in VMware vSphere or VMware Workstation Pro, you might have to give the console focus by clicking in its window before it will register input from the keyboard. 
1224
-
1225
-1. In the GNU GRUB edit menu, go to the end of the line that starts with `linux`, add a space, and then add the following code exactly as it appears below:
1226
-
1227
-	`systemd.unit=emergency.target`
1228
-
1229
-1. Type `F10`.
1230
-
1231
-1. In the bash shell, run one of the following commands to fix the file system errors, depending on whether `sda1` or `sda2` represents the root file system: 
1232
-
1233
-	`e2fsck -y /dev/sda1`
1234
-
1235
-	or
1236
-
1237
-	`e2fsck -y /dev/sda2`
1238
-
1239
-1. Restart the virtual machine.
1240
-
1241
-
1242
-## Packages
1243
-
1244
-On Photon OS, tdnf is the default package manager. The standard syntax for `tdnf` commands is the same as that for DNF and Yum: 
1245
-
1246
-	tdnf [options] <command> [<arguments>...]
1247
-
1248
-The main configuration files reside in `/etc/tdnf/tdnf.conf`. The repositories appear in `/etc/yum.repos.d/` with `.repo` file extensions. For more information, see the [Photon OS Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md).
1249
-
1250
-The cache files for data and metadata reside in `/var/cache/tdnf`. The local cache is populated with data from the repository: 
1251
-
1252
-	ls -l /var/cache/tdnf/photon
1253
-	total 8
1254
-	drwxr-xr-x 2 root root 4096 May 18 22:52 repodata
1255
-	d-wxr----t 3 root root 4096 May  3 22:51 rpms
1256
-
1257
-You can clear the cache to help troubleshoot a problem, but keep in mind that doing so might slow the performance of tdnf until the cache becomes repopulated with data. Cleaning the cache can remove stale information. Here is how to clear the cache: 
1258
-
1259
-	tdnf clean all
1260
-	Cleaning repos: photon photon-extras photon-updates lightwave
1261
-	Cleaning up everything
1262
-
1263
-Some tdnf commands can help you troubleshoot problems with packages:
1264
-
1265
-`makecache`: This command updates the cached binary metadata for all known repositories. You can run it after you clean the cache to make sure you are working with the latest repository data as you troubleshoot. Example:
1266
-
1267
-	tdnf makecache
1268
-	Refreshing metadata for: 'VMware Lightwave 1.0(x86_64)'
1269
-	Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)Updates'
1270
-	Refreshing metadata for: 'VMware Photon Extras 1.0(x86_64)'
1271
-	Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)'
1272
-	Metadata cache created.
1273
-
1274
-`tdnf check-local`: This command resolves dependencies by using the local RPMs to help check RPMs for quality assurance before publishing them. To check RPMs with this command, you must create a local directory and place your RPMs in it. The command, which includes no options, takes the path to the local directory containing the RPMs as its argument. The command does not, however, recursively parse directories; it checks the RPMs only in the directory that you specify. For example, after creating a directory named `/tmp/myrpms` and placing your RPMs in it, you can run the following command to check them:  
1275
-
1276
-	tdnf check-local /tmp/myrpms
1277
-	Checking all packages from: /tmp/myrpms
1278
-	Found 10 packages
1279
-	Check completed without issues
1280
-
1281
-`tdnf provides`: This command finds the packages that provide the package that you supply as an argument. If you are used to a package name for another system, you can use `tdnf provides` to find the corresponding name of the package on Photon OS. Example: 
1282
-
1283
-	tdnf provides docker
1284
-	docker-1.11.0-1.ph1.x86_64 : Docker
1285
-	Repo     : photon
1286
-	docker-1.11.0-1.ph1.x86_64 : Docker
1287
-	Repo     : @System
1288
-
1289
-For a file, you must provide the full path. Here's an example: 
1290
-
1291
-	tdnf provides /usr/include/stdio.h
1292
-	glibc-devel-2.22-8.ph1.x86_64 : Header files for glibc
1293
-	Repo     : photon
1294
-	glibc-devel-2.22-8.ph1.x86_64 : Header files for glibc
1295
-	Repo     : @System
1296
-
1297
-Here's an example that shows you how to find the package that provides a pluggable authentication module, which you might need to find if the system is mishandling passwords. 
1298
-
1299
-	tdnf provides /etc/pam.d/system-account
1300
-	shadow-4.2.1-7.ph1.x86_64 : Programs for handling passwords in a secure way
1301
-	Repo     : photon
1302
-	shadow-4.2.1-8.ph1.x86_64 : Programs for handling passwords in a secure way
1303
-	Repo     : photon-updates
1304
-
1305
-Additional commands appear in the [Photon OS Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md).
1306
-
1307
-If you find a package that is installed but is not working, try re-installing it; example: 
1308
-
1309
-	tdnf reinstall shadow
1310
-	Reinstalling:
1311
-	shadow 	x86_64 	4.2.1-7.ph1   3.85 M
1312
-
1313
-## Kernel Problems and Boot and Login Problems
1314
-
1315
-### Kernel Overview
1316
-
1317
-Photon OS 1.0 uses Linux kernel version 4.4. Troubleshooting kernel problems starts with `dmesg`. The `dmesg` command prints messages from the kernel ring buffer. The following command, for example, presents kernel messages in a human-readable format: 
1318
-
1319
-	dmesg --human --kernel
1320
-
1321
-To examine kernel messages as you perform actions, such as reproducing a problem, in another terminal, you can run the command with the `--follow` option, which waits for new messages and prints them as they occur: 
1322
-
1323
-	dmesg --human --kernel --follow
1324
-
1325
-The kernel buffer is limited in memory size. As a result, the kernel cyclically overwrites the end of the information in the buffer from which dmesg pulls information. The systemd journal, however, saves the information from the buffer to a log file so that you can access older information. To view it, run the following command: 
1326
-
1327
-	journalctl -k
1328
-
1329
-If need be, you can check the modules that are loaded on your Photon OS machine by running the `lsmod` command; truncated example:  
1330
-
1331
-	lsmod
1332
-	Module                  Size  Used by
1333
-	vmw_vsock_vmci_transport    28672  1
1334
-	vsock                  36864  2 vmw_vsock_vmci_transport
1335
-	coretemp               16384  0
1336
-	hwmon                  16384  1 coretemp
1337
-	crc32c_intel           24576  0
1338
-	hid_generic            16384  0
1339
-	usbhid                 28672  0
1340
-	hid                   106496  2 hid_generic,usbhid
1341
-	xt_conntrack           16384  1
1342
-	iptable_nat            16384  0
1343
-	nf_conntrack_ipv4      16384  2
1344
-	nf_defrag_ipv4         16384  1 nf_conntrack_ipv4
1345
-	nf_nat_ipv4            16384  1 iptable_nat
1346
-	nf_nat                 24576  1 nf_nat_ipv4
1347
-	iptable_filter         16384  1
1348
-	ip_tables              24576  2 iptable_filter,iptable_nat
1349
-
1350
-
1351
-### Boot Process Overview
1352
-
1353
-When a Photon OS machine boots, the BIOS initializes the hardware and uses a boot loader to start the kernel. After the kernel starts, systemd takes over and boots the rest of the operating system. 
1354
-
1355
-More specifically, the BIOS checks the memory and initializes the keyboard, the screen, and other peripherals. When the BIOS finds the first hard disk, the boot loader--GNU GRUB 2.02--takes over. From the hard disk, GNU GRUB loads the master boot record (MBR) and initializes the root partition of the random-access memory by using initrd. The device manager, udev, provides initrd with the drivers it needs to access the device containing the root file system. Here's what the GNU GRUB edit menu looks like in Photon OS with its default commands to load the boot record and initialize the RAM disk: 
1356
-
1357
-![The GNU GRUB edit menu in the full and minimal versions of Photon OS](images/grub-edit-menu-orig.png)  
1358
-
1359
-At this point, the Linux kernel in Photon OS, which is kernel version 4.4.8, takes control. Systemd kicks in, initializes services in parallel, mounts the rest of the file system, and checks the file system for errors. 
1360
-
1361
-### Blank Screen on Reboot
1362
-
1363
-If the Photon OS kernel enters a state of panic during a reboot and all you see is a blank screen, note the name of the virtual machine running Photon OS and then power off the VM. 
1364
-
1365
-In the host, open the `vmware.log` file for the VM. When a kernel panics, the guest VM prints the entire kernel log in  `vmware.log` in the host's directory containing the VM. This log file contains the output of the `dmesg` command from the guest, and you can analyze it to help identify the cause of the boot problem. 
1366
-
1367
-Here's an example. After searching for `Guest:` in the following abridged `vmware.log`, this line appears, identifying the root cause of the reboot problem: 
1368
-
1369
-	2016-08-30T16:02:43.220-07:00| vcpu-0| I125: Guest: 
1370
-	<0>[1.125804] Kernel panic - not syncing: 
1371
-	VFS: Unable to mount root fs on unknown-block(0,0)
1372
-
1373
-Further inspection finds the following lines: 
1374
-
1375
-	2016-08-30T16:02:43.217-07:00| vcpu-0| I125: Guest: 
1376
-	<4>[    1.125782] VFS: Cannot open root device "sdc1" or unknown-block(0,0): error -6
1377
-	2016-08-30T16:02:43.217-07:00| vcpu-0| I125: Guest: 
1378
-	<4>[    1.125783] Please append a correct "root=" boot option; 
1379
-	here are the available partitions: 
1380
-	2016-08-30T16:02:43.217-07:00| vcpu-0| I125: Guest: 
1381
-	<4>[    1.125785] 0100            4096 ram0  (driver?)
1382
-	...
1383
-	0800         8388608 sda  driver: sd
1384
-	2016-08-30T16:02:43.220-07:00| vcpu-0| I125: Guest: 
1385
-	<4>[    1.125802]   0801         8384512 sda1 611e2d9a-a3da-4ac7-9eb9-8d09cb151a93
1386
-	2016-08-30T16:02:43.220-07:00| vcpu-0| I125: Guest: 
1387
-	<4>[    1.125803]   0802            3055 sda2 8159e59c-b382-40b9-9070-3c5586f3c7d6
1388
-
1389
-In this unlikely case, the GRUB configuration points to a root device named `sdc1` instead of the correct root device, `sda1`. You can fix the problem by restoring the GRUB GNU edit screen and the GRUB configuration file (`/boot/grub/grub.cfg`) to their original configurations. 
1390
-
1391
-### Investigating Strange Behavior
1392
-
1393
-If you rebooted to address strange behavior before the reboot of if you encountered strange behavior during the reboot but have reached the shell, you should analyze what happened since the previous boot. Start broad by running the following command to check the logs: 
1394
-
1395
-	journalctl
1396
-
1397
-Next, run the following command to look at what happened since the penultimate reboot: 
1398
-
1399
-	journalctl --boot=-1
1400
-
1401
-Then look at the log from the reboot: 
1402
-
1403
-	journalctl -b
1404
-
1405
-If need be, examine the logs for the kernel: 
1406
-
1407
-	journalctl -k
1408
-
1409
-Check which kernel is in use:
1410
-
1411
-	uname -r
1412
-
1413
-The kernel version of Photon OS in the full version is 4.4.8. The kernel version of in the OVA version is 4.4.8-esx. With the ESX version of the kernel, some services might not start. Run this command to check the overall status of services: 
1414
-
1415
-	systemctl status 
1416
-
1417
-If a service is in red, check it: 
1418
-
1419
-	systemctl status service-name
1420
-
1421
-Start it if need be: 
1422
-
1423
-	systemctl start service-name
1424
-
1425
-If looking at the journal and checking the status of services gets you nowhere, run the following `systemd-analyze` commands to examine the boot time and the speed with which services start.
1426
-
1427
-	systemd-analyze time
1428
-	systemd-analyze blame
1429
-	systemd-analyze critical-chain
1430
- 
1431
-Keep in mind that the output of these commands might be misleading because one service might just be waiting for another service to finish initializing.
1432
-
1433
-### Investigating the Guest Kernel When You Cannot Log On
1434
-
1435
-If a VM running Photon OS and an application or virtual appliance is behaving so oddly that, for example, you cannot log on to the machine, you can still troubleshoot by extracting the kernel logs from the guest's memory and analyzing them with `gdb`. 
1436
-
1437
-This advanced troubleshooting method works when you are running Photon OS as the operating system for an application or appliance on VMware Workstation, Fusion, or ESXi. This approach assumes that the virtual machine running Photon OS is functioning normally. 
1438
-
1439
-This troubleshooting method has the following requirements: 
1440
-
1441
-* Root access to a Linux machine other than the one you are troubleshooting. It can be another Photon OS machine, Ubuntu, or another Linux variant. 
1442
-* The `vmss2core` utility from VMware. It is installed by default in VMware Workstation and some other VMware products. If your system doesn't already contain it, you can download it for free from https://labs.vmware.com/flings/vmss2core.
1443
-* A local copy of the Photon OS ISO of the exact same version and release number as the Photon OS machine that you are troubleshooting. 
1444
-
1445
-The process to use this troubleshooting method varies by environment. The examples in this section assume that the troublesome Photon OS virtual machine is running in VMware Workstation 12 Pro on a Microsoft Windows 8 Enterprise host. The examples also use an additional, fully functional Photon OS virtual machine running in Workstation.
1446
-
1447
-You can, however, use other hosts, hypervisors, and operating systems--but you will have to adapt the example process below to them. Directory paths, file names, and other aspects might be different on other systems. 
1448
-
1449
-**Overview**   
1450
-
1451
-The process to apply this troubleshooting method goes like this: On a local computer, you open a file on the Photon OS ISO that contains Linux debugging information. Then you suspend the troublesome Photon OS VM and extract the kernel memory logs from the VMware hypervisor running Photon OS. 
1452
-
1453
-Next, you use the vmss2core tool to convert the memory logs into core dump files. The vmss2core utility converts VMware checkpoint state files into formats that third-party debugging tools understand. It can handle both suspend (.vmss) and snapshot (.vmsn) checkpoint state files (hereafter referred to as a _vmss file_) as well as monolithic and non-monolithic (separate .vmem file) encapsulation of checkpoint state data. See [Debugging Virtual Machines with the Checkpoint to Core Tool](http://www.vmware.com/pdf/snapshot2core_technote.pdf).
1454
-
1455
-Finally, you prepare to run the gdb tool by using the debug info file from the ISO to create a `.gdbinit` file, which you can then analyze with the gdb shell on your local Linux machine.
1456
-
1457
-All three components must be in the same directory on a Linux machine.  
1458
-
1459
-**Process**
1460
-
1461
-First, obtain a local copy of the Photon OS ISO of the exact same version and release number as the Photon OS machine that you are troubleshooting and mount the ISO on a Linux machine (or open it on a Windows machine):
1462
-
1463
-	mount /mnt/cdrom
1464
-
1465
-Second, locate the following file. (If you opened the Photon OS ISO on a Windows computer, copy the following file to the root folder of a Linux machine.)
1466
-
1467
-	/RPMS/x86_64/linux-debuginfo-4.4.8-6.ph1.x86_64.rpm
1468
-
1469
-Third, on a Linux machine, run the following `rpm2cpio` command to convert the RPM file to a cpio file and to extract the contents of the RPM to the current directory:
1470
-
1471
-	rpm2cpio /mnt/cdrom/RPMS/x86_64/linux-debuginfo-4.4.8-6.ph1.x86_64.rpm | cpio -idmv
1472
-
1473
-From the extracted files, copy the following file to your current directory: 
1474
-
1475
-	cp usr/lib/debug/lib/modules/4.4.8/vmlinux-4.4.8.debug .
1476
-
1477
-Run the following command to download the dmesg functions that will help extract the kernel log from the coredump: <!--	wget https://www.kernel.org/doc/Documentation/kdump/gdbmacros.txt
1478
-
1479
-	wget https://github.com/vmware/photon/blob/master/tools/scripts/gdbmacros-for-linux.txt
1480
-
1481
-Move the file as follows: 
1482
-
1483
-	mv gdbmacros-for-linux.txt .gdbinit
1484
-
1485
-Next, switch to your host machine so you can get the kernel memory files from the VM. Suspend the troublesome VM and locate the `.vmss` and `.vmem` files in the virtual machine's directory on the host. Example: 
1486
-
1487
-	C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit (7)>dir
1488
-	 Volume in drive C is Windows
1489
-	 Directory of C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit
1490
-	 (7)
1491
-	09/20/2016  12:22 PM    <DIR>          .
1492
-	09/20/2016  12:22 PM    <DIR>          ..
1493
-	09/19/2016  03:39 PM       402,653,184 VMware Photon 64-bit (7)-f6b070cd.vmem
1494
-	09/20/2016  12:11 PM         5,586,907 VMware Photon 64-bit (7)-f6b070cd.vmss
1495
-	09/20/2016  12:11 PM     1,561,001,984 VMware Photon 64-bit (7)-s001.vmdk
1496
-	...
1497
-	09/20/2016  12:11 PM           300,430 vmware.log
1498
-	...
1499
-
1500
-Now that you have located the `.vmss` and `.vmem` files, convert them to one or more core dump files by using the vmss2core tool that comes with Workstation. Here is an example of how to run the command. Be careful with your pathing, escaping, file names, and so forth--all of which might be different from this example on your Windows machine. 
1501
-
1502
-	C:\Users\shoenisch\Documents\Virtual Machines\VMware Photon 64-bit (7)>C:\"Program Files (x86)\VMware\VMware Workstation"\vmss2core.exe "VMware Photon 64-bit (7)-f6b070cd.vmss" "VMware Photon 64-bit (7)-f6b070cd.vmem"
1503
-
1504
-The result of this command is one or more files with a `.core` extension plus a digit. Truncated example: 
1505
-
1506
-	C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit (7)>dir
1507
-	 Directory of C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit(7)
1508
-	09/20/2016  12:22 PM       729,706,496 vmss.core0
1509
-
1510
-Copy the `.core` file or files to the your current directory on the Linux machine where you so that you can analyze it with gdb. 
1511
-
1512
-Run the following `gdb` command to enter the gdb shell attached to the memory core dump file. You might have to change the name of the `vmss.core` file in the example to match your `.core` file:
1513
-
1514
-	gdb vmlinux-4.4.8.debug vmss.core0
1515
-
1516
-	GNU gdb (GDB) 7.8.2
1517
-	Copyright (C) 2014 Free Software Foundation, Inc.
1518
-	License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
1519
-	This is free software: you are free to change and redistribute it. 
1520
-	There is NO WARRANTY, to the extent permitted by law. ...
1521
-	Type "show configuration" for configuration details.
1522
-	For bug reporting instructions, please see:
1523
-	<http://www.gnu.org/software/gdb/bugs/>.
1524
-	Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>.
1525
-	For help, type "help".
1526
-	Type "apropos word" to search for commands related to "word"...
1527
-	Reading symbols from vmlinux-4.4.8.debug...done.
1528
-	warning: core file may not match specified executable file.
1529
-	[New LWP 12345]
1530
-	Core was generated by `GuestVM'.
1531
-	Program terminated with signal SIGSEGV, Segmentation fault.
1532
-	#0  0xffffffff813df39a in insb (count=0, addr=0xffffc90000144000, port=<optimized out>)
1533
-	    at arch/x86/include/asm/io.h:316
1534
-	316     arch/x86/include/asm/io.h: No such file or directory.
1535
-	(gdb)
1536
-
1537
-In the results above, the _(gdb)_ of the last line is the prompt of the gdb shell. You can now analyze the core dump by using commands like `bt` (to perform a backtrace) and `dmesg` (to view the Photon OS kernel log and see Photon OS kernel error messages). 
1538
-
1539
-### Kernel Log Replication with VProbes
1540
-
1541
-Replicating the Photon OS kernel logs on the VMware ESXi host is an advanced but powerful method of troubleshooting a kernel problem. This method is applicable when the virtual machine running Photon OS is hanging or inaccessible because, for instance, the hard disk has failed.
1542
-
1543
-There is a prerequisite, however: You must have preemptively enabled the VMware VProbes facility on the VM before a problem rendered it inaccessible. You must also create a VProbes script on the ESXi host, but you can do that after the fact. 
1544
-
1545
-Although the foresight to implement these prerequisites might limit the application of this troubleshooting method for production systems, the method can be particularly useful in analyzing kernel issues when testing an application or appliance that is running on Photon OS.   
1546
-
1547
-There are two similar ways in which you can replicate the Photon OS kernel logs on ESXi by using VProbes. The first modifies the VProbes script so that it works only for the VM that you set; it uses a hard-coded address. The second uses an abstraction instead of a hard-coded address so that the same VProbes script can be used for any VM on an ESXi host that you have enabled for VProbe and copied its kernel symbol table (kallsyms) to ESXi.
1548
-
1549
-For more information on VMware VProbes, see [VProbes: Deep Observability Into the ESXi Hypervisor](https://labs.vmware.com/vmtj/vprobes-deep-observability-into-the-esxi-hypervisor) and the [VProbes Programming Reference](http://www.vmware.com/pdf/ws7_f3_vprobes_reference.pdf).
1550
-
1551
-**Using VProbes Script with a Hard-Coded Address**
1552
-
1553
-Here's how to set a VProbe for an individual VM: 
1554
-
1555
-First, power off the VM so that you can turn on the VProbe facility. Edit the `.vmx` configuration file for the VM. The file resides in the directory that contains the VM in the ESXi data store. Add the following line of code to the `.vmx` file and then power the VM on: 
1556
-
1557
-	vprobe.enable = "TRUE"
1558
-
1559
-When you edit the `.vmx` file to add the above line of code, you must first turn off the VM--otherwise, your changes will not persist. 
1560
-
1561
-Second, obtain the kernel log_store function address by connecting to the VM with SSH and running the following commands as root. (Photon OS uses the `kptr_restrict` setting to place restrictions on the kernel addresses exposed through `/proc` and other interfaces. This setting hides exposed kernel pointers to prevent attackers from exploiting kernel write vulnerabilities. When you are done using VProbes, you should return `kptr_restrict` to the original setting of `2` by rebooting.)
1562
-
1563
-	echo 0 > /proc/sys/kernel/kptr_restrict
1564
-	grep log_store /proc/kallsyms
1565
-
1566
-The output of the `grep` command will look similar to the following string. The first set of characters (without the `t`) is the log_store function address:
1567
-
1568
-	ffffffff810bb680 t log_store
1569
-
1570
-Third, connect to the ESXi host with SSH so that you can create a VProbes script. Here's the template for the script; `log_store` in the first line is a placeholder for the VM's log_store function address: 
1571
-
1572
-	GUEST:ENTER:log_store {
1573
-	   string dst;
1574
-	   getgueststr(dst, getguest(RSP+16) & 0xff, getguest(RSP+8));
1575
-	   printf("%s\n", dst);
1576
-	}
1577
-
1578
-On the ESXi host, create a new file, add the template to it, and then change `log_store` to the function address that was the output from the grep command on the VM. 
1579
-
1580
-You must add a `0x` prefix to the function address. In this example, the modified template looks like this: 
1581
-
1582
-	GUEST:ENTER:0xffffffff810bb680 {
1583
-	   string dst;
1584
-	   getgueststr(dst, getguest(RSP+16) & 0xff, getguest(RSP+8));
1585
-	   printf("%s\n", dst);
1586
-	}
1587
-
1588
-Save your VProbes script as `console.emt` in the `/tmp` directory. (The file extension for VProbe scripts is `.emt`.) 
1589
-
1590
-While still connected to the ESXi host with SSH, run the following command to obtain the ID of the virtual machine that you want to troubleshoot: 
1591
-
1592
-	vim-cmd vmsvc/getallvms
1593
-
1594
-This command lists all the VMs running on the ESXi host. Find the VM you want to troubleshoot in the list and make a note of its ID. 
1595
-
1596
-Finally, run the following command to print all the kernel messages from Photon OS in your SSH console; replace `<VM ID>` with the ID of your VM:  
1597
-
1598
-	vprobe -m <VM ID> /tmp/console.emt
1599
-
1600
-When you're done, type `Ctrl-C` to stop the loop. 
1601
-
1602
-**A Reusable VProbe Script Using the kallsyms File**
1603
-
1604
-Here's how to create one VProbe script and use for all the VMs on your ESXi host. 
1605
-
1606
-First, power off the VM and turn on the VProbe facility on each VM that you want to be able to analyze. Add `vprobe.enable = "TRUE"` to the VM's `.vmx` configuration file. See the instructions above. 
1607
-
1608
-Second, power on the VM, connect to it with SSH, and run the following command as root: 
1609
-
1610
-	echo 0 > /proc/sys/kernel/kptr_restrict
1611
-
1612
-Third, connect to the ESXi host with SSH to create the following VProbes script and save it as `/tmp/console.emt`:
1613
-
1614
-	GUEST:ENTER:log_store {
1615
-	   string dst;
1616
-	   getgueststr(dst, getguest(RSP+16) & 0xff, getguest(RSP+8));
1617
-	   printf("%s\n", dst);
1618
-	}
1619
-
1620
-Fourth, from the ESXi host, run the following command to copy the VM's `kallysms` file to the `tmp` directory on the ESXi host: 
1621
-
1622
-	scp root@<vm ip address>:/proc/kallsyms /tmp
1623
-
1624
-While still connected to the ESXi host with SSH, run the following command to obtain the ID of the virtual machine that you want to troubleshoot: 
1625
-
1626
-	vim-cmd vmsvc/getallvms
1627
-
1628
-This command lists all the VMs running on the ESXi host. Find the VM you want to troubleshoot in the list and make a note of its ID. 
1629
-
1630
-Finally, run the following command to print all the kernel messages from Photon OS in your SSH console; replace `<VM ID>` with the ID of your VM. When you're done, type `Ctrl-C` to stop the loop.  
1631
-
1632
-	vprobe -m <VM ID> -k /tmp/kallysyms /tmp/console.emt
1633
-
1634
-You can use a directory other than `tmp` if you want.
1635
-
1636
-<!--
1637
-### Deep Kernel Analysis with the Crash Utility
1638
-
1639
-
1640
-<!-- 
1641
-
1642
-### Go to the Debug Shell
1643
-
1644
-‘ panic=1 init=/bin/bash’
1645
-mount –o rw,remount /
1646
-cd /lib/systemd/system/multi-user.target.wants
1647
-ln –s ../debug-shell.service
1648
-umount /
1649
-sync
1650
-exit
1651
-
1652
-After reboot debug-shell will be available on tty9. No password required.
1653
-
1654
-
1655
-
1656
-## Performance Issues
1657
-
1658
-Performance issues can be difficult to troubleshoot because so many variables play a role in overall system performance. Interpreting performance data often depends on the context and the situation. To better identify and isolate variables and to gain insight into performance data, you can use the troubleshooting tools on Photon OS to diagnose the system.  
1659
-
1660
-If you have no indication what the cause of a performance degradation might be, start by getting a broad picture of the system's state. Then look for clues in the data that might point to a cause. The systemd journal is a useful place to start. 
1661
-
1662
-The `top` tool can unmask problems caused by processes or applications overconsuming CPUs, time, or RAM. If the percent of CPU utilization is consistently high with little idle time, for example, there might be a runaway process. Restart it. 
1663
-
1664
-The `netstat --statistics` command can identify bottlenecks causing performance issues. It lists interface statistics for different protocols. 
1665
-
1666
-If `top` and `netstat` reveal no clues, run the `strace ls -al` to view every system call.
1667
-
1668
-The following `watch` command can help dynamically monitor a command to help troubleshoot performance issues:
1669
-
1670
-	watch -n0 --differences <command>
1671
-
1672
-You can, for example, combine `watch` with the `vmstat` command to dig deeper into statistics about virtual memory, processes, block input-output, disks, and CPU activity. Are there any bottlenecks? 
1673
-
1674
-Another option is to use the `dstat` utility. It shows a live, running list of statistics about system resources. 
1675
-
1676
-In addition, `systemd-analyze`, which reveals performance statistics for boot times, can help troubleshoot slow system boots and incorrect unit files.
1677
-
1678
-The additional tools that you select depend on the clues that your initial investigation reveals. The following tools can also help troubleshoot performance: `sysstat`, `sar`, `systemtap`, and `crash`. 
1679
-
4
+    -    [Introduction](introduction.md)
5
+        - [Systemd and TDNF](systemd-and-tdnf.md)
6
+        - [The Root Account and the `sudo` and `su`
7
+            Commands](root-account-sudo-and-su-commands.md)
8
+        - [Checking the Version and Build
9
+            Number](checking-the-version-and-build-number.md)
10
+        - [General Best Practices](general-best-practices.md)
11
+        - [Photon OS Logs](photon-os-logs.md)
12
+        - [Troubleshooting Progression](troubleshooting-progression.md)
13
+    -   [Solutions to Common Problems](solutions-to-common-problems.md)
14
+        - [Resetting a Lost Root Password](resetting-a-lost-root-password.md)
15
+        - [Fixing Permissions on Network Configuration Files](network-config-files-permissions.md)
16
+        - [Permitting Root Login with SSH](permitting-root-login-with-ssh.md)
17
+        - [Fixing Sendmail](fixing-sendmail.md)
18
+    -   [Troubleshooting Tools on Photon OS](troubleshooting-tools.md)
19
+        - [Common Tools](common-tools.md)
20
+        - [Troubleshooting Tools Installed by Default](default-tools.md)
21
+        - [Installing Tools From Repositories](installing-tools.md)
22
+        - [Linux Troubleshooting Tools](linux-troubleshooting-tools.md)
23
+    -   [Troubleshooting With systemd](systemd.md)
24
+        -   [Troubleshooting Services with `systemctl`](troubleshooting-services.md)
25
+        -   [Analyzing System Logs with `journalctl`](analyzing-system-logs-with-journalctl.md)
26
+        -   [Inspecting Services with `systemd-analyze`](inspecting-services-with-systemd-analyze.md)
27
+    -   [Network Troubleshooting](networking.md)
28
+        - [Managing the Network Configuration](managing-the-network-configuration.md)
29
+        - [Inspecting IP Addresses](inspecting-ip-addresses.md)
30
+        - [Inspecting the Status of Network Links with `networkctl`](inspecting-network-links-with-networkctl.md)
31
+        - [Network Debugging](network-debugging.md)
32
+        - [Checking Firewall Rules](checking-firewall-rules.md)
33
+        - [Inspect Network Settings with `netmgr`](netmgr.md)
34
+    -   [File System Troubleshooting](file-system.md)
35
+        -   [Checking Disk Space](checking-disk-space.md)
36
+        -   [Adding a Disk and Partitioning It](adding-a-disk-and-partitioning-it.md)
37
+        -   [Expanding Disk Partition](expanding-disk-partition.md)
38
+        -   [List Disk Partitions](fdisk.md)
39
+        -   [File System Consistency Check Tool](fsck.md)
40
+        -   [Fixing File System Errors When fsck Fails](fixing-file-system-errors-when-fsck-fails.md)
41
+    -   [Troubleshooting Packages](packages.md)
42
+    -   [Kernel Problems and Boot and Login Problems](kernel-problems-and-boot-and-login-errors.md)
43
+        - [Kernel Overview](kernel-overview.md)
44
+        - [Boot Process Overview](boot-process-overview.md)
45
+        - [Blank Screen on Reboot](blank-screen-on-reboot.md)
46
+        - [Investigating Unexpected Behavior](investigating-strange-behavior.md)
47
+        - [Investigating the Guest Kernel](investigating-the-guest-kernel.md)
48
+        - [Kernel Log Replication with VProbes](kernel-log-replication-with-vprobes.md)
49
+    -   [Performance Issues](performance-issues.md)
1680 50
 
1681 51
new file mode 100644
... ...
@@ -0,0 +1,65 @@
0
+# Adding a Disk and Partitioning It
1
+
2
+If the `df` command shows that the file system is indeed nearing capacity, you can add a new disk on the fly and partition it to increase capacity. 
3
+
4
+1. Add a new disk. 
5
+    
6
+    For example, you can add a new disk to a virtual machine by using the VMware vSphere Client. After adding a new disk, check for the new disk by using `fdisk`. In the following example, the new disk is named `/dev/sdb`:
7
+    
8
+    	fdisk -l
9
+    	Device        Start      End  Sectors Size Type
10
+    	/dev/sda1      2048 16771071 16769024   8G Linux filesystem
11
+    	/dev/sda2  16771072 16777182     6111   3M BIOS boot
12
+    	
13
+    	Disk /dev/sdb: 1 GiB, 1073741824 bytes, 2097152 sectors
14
+    	Units: sectors of 1 * 512 = 512 bytes
15
+    	Sector size (logical/physical): 512 bytes / 512 bytes
16
+    	I/O size (minimum/optimal): 512 bytes / 512 bytes
17
+
18
+1. Partition it with the `parted` wizard. 
19
+    
20
+    The command to partition the disk on Photon OS is as follows:
21
+
22
+	parted /dev/sdb
23
+
24
+    Use the `parted` wizard to create it as follows:
25
+
26
+	mklabel gpt
27
+	mkpart ext3 1 1024
28
+
29
+1. Create a file system on the partition:
30
+
31
+	   mkfs -t ext3 /dev/sdb1
32
+
33
+1. Make a directory where you will mount the new file system: 
34
+
35
+	   mkdir /newdata
36
+
37
+1. Open `/etc/fstab` and add the new file system with the options that you require:
38
+
39
+    ```
40
+       	#system mnt-pt  type    options dump    fsck
41
+       	/dev/sda1       /       ext4    defaults,barrier,noatime,noacl,data=ord$
42
+       	/dev/cdrom      /mnt/cdrom      iso9660 ro,noauto       0       0
43
+       	/dev/sdb1       /newdata        ext3    defaults        0		0
44
+    ```
45
+
46
+1. Mount it using the following command: 
47
+
48
+	   `mount /newdata`
49
+
50
+    Verify the results: 
51
+	
52
+    ```
53
+df -h
54
+	Filesystem      Size  Used Avail Use% Mounted on
55
+	/dev/root       7.8G  4.4G  3.1G  59% /
56
+	devtmpfs        172M     0  172M   0% /dev
57
+	tmpfs           173M     0  173M   0% /dev/shm
58
+	tmpfs           173M  664K  172M   1% /run
59
+	tmpfs           173M     0  173M   0% /sys/fs/cgroup
60
+	tmpfs           173M   36K  173M   1% /tmp
61
+	tmpfs            35M     0   35M   0% /run/user/0
62
+	/dev/sdb1       945M  1.3M  895M   1% /newdata
63
+```
64
+
0 65
new file mode 100644
... ...
@@ -0,0 +1,43 @@
0
+# Analyzing System Logs with `journalctl`
1
+
2
+The journalctl tool queries the contents of the systemd journal. On Photon OS, all the system logs except the installation log and the cloud-init log are written into the systemd journal. 
3
+
4
+When you run the `journalctl` command without any parameters, it displays all the contents of the journal, beginning with the oldest entry. 
5
+
6
+To display the output in reverse order with new entries first, include the `-r` option in the command:
7
+
8
+	journalctl -r
9
+
10
+The `journalctl` command includes many options to filter its output. For help troubleshooting systemd, two journalctl queries are particularly useful: 
11
+
12
+- Showing the log entries for the last boot. 
13
+    
14
+    The following command displays the messages that systemd generated during the last time the machine started: 
15
+
16
+	journalctl -b
17
+
18
+- Showing the log entries for a systemd service unit.Item
19
+    
20
+    The following command reveals the messages for only the systemd service unit specified by the `-u` option, which in the following example is the auditing service: 
21
+
22
+	journalctl -u auditd
23
+
24
+You can look at the messages for systemd itself or for the network service:
25
+
26
+	journalctl -u systemd
27
+	journalctl -u systemd-networkd
28
+
29
+Example:  
30
+
31
+	root@photon-1a0375a0392e [ ~ ]# journalctl -u systemd-networkd
32
+	-- Logs begin at Tue 2016-08-23 14:35:50 UTC, end at Tue 2016-08-23 23:45:44 UTC. --
33
+	Aug 23 14:35:52 photon-1a0375a0392e systemd[1]: Starting Network Service...
34
+	Aug 23 14:35:52 photon-1a0375a0392e systemd-networkd[458]: Enumeration completed
35
+	Aug 23 14:35:52 photon-1a0375a0392e systemd[1]: Started Network Service.
36
+	Aug 23 14:35:52 photon-1a0375a0392e systemd-networkd[458]: eth0: Gained carrier
37
+	Aug 23 14:35:53 photon-1a0375a0392e systemd-networkd[458]: eth0: DHCPv4 address 198.51.100.1
38
+	Aug 23 14:35:54 photon-1a0375a0392e systemd-networkd[458]: eth0: Gained IPv6LL
39
+	Aug 23 14:35:54 photon-1a0375a0392e systemd-networkd[458]: eth0: Configured
40
+
41
+
42
+For more information, see [journalctl](https://www.freedesktop.org/software/systemd/man/journalctl.html) or the journalctl man page by running this command: `man journalctl`
0 43
\ No newline at end of file
1 44
new file mode 100644
... ...
@@ -0,0 +1,34 @@
0
+# Blank Screen on Reboot
1
+
2
+If the Photon OS kernel enters a state of panic during a reboot and all you see is a blank screen, note the name of the virtual machine running Photon OS and then power off the VM. 
3
+
4
+In the host, open the `vmware.log` file for the VM. When a kernel panics, the guest VM prints the entire kernel log in  `vmware.log` in the host directory containing the VM. This log file contains the output of the `dmesg` command from the guest, and you can analyze it to help identify the cause of the boot problem. 
5
+
6
+**Example**
7
+
8
+After searching for `Guest:` in the following abridged `vmware.log`, this line appears, identifying the root cause of the reboot problem: 
9
+
10
+    	
11
+    ```
12
+    2016-08-30T16:02:43.220-07:00| vcpu-0| I125: Guest: 
13
+    	<0>[1.125804] Kernel panic - not syncing: 
14
+    	VFS: Unable to mount root fs on unknown-block(0,0)
15
+    ```
16
+
17
+Further inspection finds the following lines: 
18
+
19
+	2016-08-30T16:02:43.217-07:00| vcpu-0| I125: Guest: 
20
+	<4>[    1.125782] VFS: Cannot open root device "sdc1" or unknown-block(0,0): error -6
21
+	2016-08-30T16:02:43.217-07:00| vcpu-0| I125: Guest: 
22
+	<4>[    1.125783] Please append a correct "root=" boot option; 
23
+	here are the available partitions: 
24
+	2016-08-30T16:02:43.217-07:00| vcpu-0| I125: Guest: 
25
+	<4>[    1.125785] 0100            4096 ram0  (driver?)
26
+	...
27
+	0800         8388608 sda  driver: sd
28
+	2016-08-30T16:02:43.220-07:00| vcpu-0| I125: Guest: 
29
+	<4>[    1.125802]   0801         8384512 sda1 611e2d9a-a3da-4ac7-9eb9-8d09cb151a93
30
+	2016-08-30T16:02:43.220-07:00| vcpu-0| I125: Guest: 
31
+	<4>[    1.125803]   0802            3055 sda2 8159e59c-b382-40b9-9070-3c5586f3c7d6
32
+
33
+In this unlikely case, the GRUB configuration points to a root device named `sdc1` instead of the correct root device, `sda1`. You can resolve the problem by restoring the GRUB GNU edit screen and the GRUB configuration file (`/boot/grub/grub.cfg`) to their original configurations. 
0 34
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+# Boot Process Overview
1
+
2
+When a Photon OS machine boots, the BIOS initializes the hardware and uses a boot loader to start the kernel. After the kernel starts, `systemd` takes over and boots the rest of the operating system. 
3
+
4
+The BIOS checks the memory and initializes the keyboard, the screen, and other peripherals. When the BIOS finds the first hard disk, the boot loader--GNU GRUB 2.02--takes over. From the hard disk, GNU GRUB loads the master boot record (MBR) and initializes the root partition of the random-access memory by using initrd. The device manager, udev, provides initrd with the drivers it needs to access the device containing the root file system. Here's what the GNU GRUB edit menu looks like in Photon OS with its default commands to load the boot record and initialize the RAM disk: 
5
+
6
+![The GNU GRUB edit menu in the full and minimal versions of Photon OS](images/grub-edit-menu-orig.png)  
7
+
8
+At this point, the Linux kernel in Photon OS, which is kernel version 4.4.8, takes control. Systemd kicks in, initializes services in parallel, mounts the rest of the file system, and checks the file system for errors. 
0 9
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+# Checking Disk Space
1
+
2
+One of the first simple steps to take while troubleshooting is to check how much disk space is available by running the `df` command: 
3
+
4
+	df -h
0 5
\ No newline at end of file
1 6
new file mode 100644
... ...
@@ -0,0 +1,30 @@
0
+# Checking Firewall Rules
1
+
2
+The design of Photon OS emphasizes security. On the minimal and full versions of Photon OS, the default security policy turns on the firewall and drops packets from external interfaces and  applications. As a result, you might need to add rules to iptables to permit forwarding, allow protocols like HTTP, and open ports. In other words, you must configure the firewall for your applications and requirements. 
3
+
4
+The default iptables settings on the full version look like this:
5
+
6
+	iptables --list
7
+	Chain INPUT (policy DROP)
8
+	target     prot opt source               destination
9
+	ACCEPT     all  --  anywhere             anywhere
10
+	ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
11
+	ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
12
+
13
+	Chain FORWARD (policy DROP)
14
+	target     prot opt source               destination
15
+
16
+	Chain OUTPUT (policy DROP)
17
+	target     prot opt source               destination
18
+	ACCEPT     all  --  anywhere             anywhere
19
+
20
+
21
+To find out how to adjust the settings, see the man page for iptables. 
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.md).
24
+
25
+If you are unable to ping a Photon OS machine, check the firewall rules. Verify if the rules allow connectivity for the port and protocol. 
26
+
27
+You can supplement the `iptables` commands by using `lsof` to, for instance, see the processes listening on ports: 
28
+
29
+	lsof -i -P -n
0 30
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# Checking the Version and Build Number
1
+
2
+To check the version and build number of Photon OS, concatenate `/etc/photon-release`. 
3
+
4
+Example: 
5
+
6
+	cat /etc/photon-release
7
+	VMware Photon Linux 1.0
8
+	PHOTON_BUILD_NUMBER=a6f0f63
9
+
10
+The build number in the results maps to the commit number on the VMware Photon OS GitHub [commits page](https://github.com/vmware/photon/commits/master).
0 11
\ No newline at end of file
1 12
new file mode 100644
... ...
@@ -0,0 +1,394 @@
0
+# Common Tools 
1
+
2
+The following are some tools that you can use to troubleshoot:
3
+
4
+-   [top](#top)
5
+-   [ps](#ps)
6
+-   [netstat](#netstat)
7
+-   [find](#find)
8
+-   [locate](#locate)
9
+-   [df](#df)
10
+-   [md5sum](#md5sum)
11
+-   [sha256sum](#sha256sum)
12
+-   [strace](#strace)
13
+-   [file](#file)
14
+-   [stat](#stat)
15
+-   [watch](#watch)
16
+-   [vmstat and fdisk](#vmstat-and-fdisk)
17
+-   [lsof](#lsof)
18
+-   [fuser](#fuser)
19
+-   [ldd](#ldd)
20
+-   [gdb](#gdb)
21
+
22
+**Note**: Some of the examples in this section are marked as abridged with ellipsis (`...`).
23
+
24
+## top
25
+
26
+The `top` tool monitors system resources, workloads, and performance. It can unmask problems caused by processes or applications overconsuming CPUs, time, or RAM. 
27
+
28
+To view a textual display of resource consumption, run the `top` command: 
29
+
30
+	top
31
+
32
+Use can use 'top' to kill a runaway or stalled process by typing `k` followed by its process ID (PID). 
33
+
34
+![Top on Photon OS](images/top-in-photon-os.png)
35
+
36
+If the percent of CPU utilization is consistently high with little idle time, there might be a runaway process overconsuming CPUs. Restarting the service might solve the problem. 
37
+
38
+To troubleshoot an unknown issue, run Top in the background in batch mode to write its output to a file and collect data about performance:
39
+
40
+	top d 120 b >> top120second.output
41
+
42
+For a list of options that filter top output and other information, see the man page for `top`.
43
+
44
+## ps
45
+
46
+The `ps` tool shows the processes running on the machine. The `ps` tool derives flexibility and power from its options, all of which are covered in the tool's Photon OS man page:
47
+
48
+	man ps
49
+
50
+You can use the following options of `ps` for troubleshooting: 
51
+
52
+- Show processes by user:
53
+    
54
+    `ps aux`
55
+
56
+- Show processes and child processes by user:
57
+    
58
+    `ps auxf`
59
+    
60
+- Show processes containing the string `ssh`:
61
+    `ps aux | grep ssh`
62
+    
63
+- Show processes and the command and options with which they were started:
64
+    `ps auxww`
65
+
66
+Example abridged output: 
67
+
68
+	ps auxww
69
+	USER        PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
70
+	root          1  0.0  0.9  32724  3300 ?        Ss   07:51   0:32 /lib/systemd/systemd --switched-root --system --deserialize 22
71
+
72
+## netstat
73
+
74
+The `netstat` command can identify bottlenecks causing  performance issues. It lists network connections, listening sockets, port information, and interface statistics for different protocols. Examples: 
75
+
76
+	netstat --statistics
77
+	netstat --listening
78
+
79
+## find
80
+
81
+Use the `find` command to troubleshoot a Photon OS machine that has stopped working. The following command lists the files in the root directory that have changed in the past day: 
82
+
83
+		find / -mtime -1 
84
+
85
+See the `find` [manual](See https://www.gnu.org/software/findutils/manual/find.html). Take note of the security considerations listed in the `find` manual if you are using `find` to troubleshoot an appliance running on Photon OS. 
86
+
87
+## locate
88
+
89
+The `locate` command is a fast way to find files and directories you onlay have a keyword. This command is similar to `find` and part of the same `findutils` package preinstalled on the full version of Photon OS by default. It finds file names in the file names database. 
90
+
91
+Before you can use `locate` accurately, update its database: 
92
+
93
+	updatedb
94
+
95
+Then run `locate` to quickly find a file, such as any file name containing `.network`, which can be helpful to see all the system's `.network` configuration files. The following is an abridged example: 
96
+
97
+	locate .network
98
+	/etc/dbus-1/system.d/org.freedesktop.network1.conf
99
+	/etc/systemd/network/10-dhcp-en.network
100
+	/usr/lib/systemd/network/80-container-host0.network
101
+	/usr/lib/systemd/network/80-container-ve.network
102
+	/usr/lib/systemd/system/busnames.target.wants/org.freedesktop.network1.busname
103
+	/usr/lib/systemd/system/dbus-org.freedesktop.network1.service
104
+	/usr/lib/systemd/system/org.freedesktop.network1.busnname
105
+	/usr/share/dbus-1/system-services/org.freedesktop.network1.service
106
+
107
+The `locate` command is also a quick way to see whether a troubleshooting tool is installed on Photon OS. Examples: 
108
+
109
+	locate strace
110
+	/usr/bin/strace
111
+	/usr/bin/strace-graph
112
+	/usr/bin/strace-log-merge
113
+	/usr/share/man/man1/strace.1.gz
114
+	/usr/share/vim/vim74/syntax/strace.vim
115
+
116
+	locate traceroute
117
+
118
+In this example, the `strace` tool is installed but `traceroute` is not. 
119
+
120
+You can install `traceroute` from the Photon OS repository: 
121
+
122
+	tdnf install traceroute
123
+
124
+## df
125
+
126
+The `df` command reports the disk space available on the file system. Running out of disk space can lead an application to fail and a quick check of the available space makes sense as an early troubleshooting step: 
127
+
128
+	df -h
129
+
130
+The `-h` option prints out the available and used space in human-readable sizes. After checking the space, you should also check the number of available inodes. Too few available inodes can lead to difficult-to-diagnose problems:
131
+
132
+	df -i
133
+
134
+## md5sum 
135
+
136
+The `md5sum` tool calculates 128-bit MD5 hashes--a message digest, or digital signature, of a file--to uniquely identify a file and verify its integrity after file transfers, downloads, or disk errors when the security of the file is not in question. 
137
+
138
+`md5sum` can help troubleshooting installation issues by verifying that the version of Photon OS being installed matches the version on the Bintray download page. If, for instance, bytes were dropped during the download, the checksums will not match. Try downloading it again.
139
+
140
+## sha256sum
141
+
142
+The `sha256sum` tool calculates the authenticity of a file to prevent tampering when security is a concern. Photon OS also includes `shasum`, `sha1sum`, `sha384sum`, and `sha512sum`. See the man pages for  `md3sum`, `sha256sum`, and the other SHA utilities. 
143
+
144
+## strace
145
+
146
+The `strace` utility follows system calls and signals as they are executed so that you can see what an application, command, or process is doing. `strace` can trace failed commands, identify where a process obtains its configuration, monitor file activity, and find the location of a crash. 
147
+
148
+By tracing system calls, `strace` can help troubleshoot a broad range of problems, including issues with input-output, memory, interprocess communication, network usage, and application performance. 
149
+
150
+For troubleshooting a problem that gives off few or no clues, the following command displays every system call: 
151
+
152
+	strace ls -al
153
+
154
+With strace commands, you can route the output to a file to make it easier to analyze: 
155
+
156
+	strace -o output.txt ls -al
157
+
158
+`strace` can reveal the files that an application tries to open with the `-eopen` option. This combination can help troubleshoot an application that is failing because it is missing files or being denied access to a file it needs. If, for example, you see "No such file or directory" in the results of `strace -eopen`, something might be wrong: 
159
+
160
+	strace -eopen sshd
161
+	open("/usr/lib/x86_64/libpam.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
162
+	open("/usr/lib/libpam.so.0", O_RDONLY|O_CLOEXEC) = 3
163
+
164
+The results above indicate that the first file is missing because it is found in the next line. In other cases, the application might be unable to open one of its configuration files or it might be reading the wrong one. If the results say "permission denied" for one of the files, check the permissions of the file with `ls -l` or `stat`.   
165
+
166
+When troubleshooting with `strace`, you can include the process ID in its commands. Here's an example of how to find a process ID: 
167
+
168
+	ps -ef | grep apache
169
+
170
+You can then use `strace` to examine the file a process is working with: 
171
+
172
+	strace -e trace=file -p 1719
173
+
174
+A similar command can trace network traffic: 
175
+
176
+	strace -p 812 -e trace=network
177
+
178
+If an application is crashing, use `strace` to trace the application and then analyze what happens right before the application crashes.
179
+
180
+You can also trace the child processes that an application spawns with the fork system call, and you can do so with `systemctl` commands that start a process to identify why an application crashes immediately or fails to start: 
181
+
182
+	strace -f -o output.txt systemctl start httpd
183
+
184
+Example: If `journalctl` is showing that networkd is failing, you can run strace to troubleshoot: 
185
+
186
+	strace -o output.txt systemctl restart systemd-networkd
187
+
188
+Then `grep` inside the results for something, such as _exit_ or _error_: 
189
+
190
+	grep exit output.txt
191
+
192
+If the results indicate `systemd-resolved` is going wrong, you can then strace it: 
193
+
194
+	strace -f -o output.txt systemctl restart systemd-resolved
195
+
196
+## file
197
+
198
+The `file` command determines the file type, which can help troubleshoot problems when an application mistakes one type of file for another, leading it to errors. Example: 
199
+
200
+	file /usr/sbin/sshd
201
+	/usr/sbin/sshd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, stripped
202
+
203
+## stat
204
+
205
+The `stat` command can help troubleshoot problems with files or the file system by showing the last date it was modified and other information. Example:  
206
+
207
+	stat /dev/sda1
208
+	File: '/dev/sda1'
209
+	Size: 0               Blocks: 0          IO Block: 4096   block special file
210
+	Device: 6h/6d   Inode: 6614        Links: 1     Device type: 8,1
211
+	Access: (0660/brw-rw----)  Uid: (    0/    root)   Gid: (    8/    disk)
212
+	Access: 2016-09-02 12:23:56.135999936 +0000
213
+	Modify: 2016-09-02 12:23:52.879999981 +0000
214
+	Change: 2016-09-02 12:23:52.879999981 +0000
215
+	Birth: -
216
+
217
+On Photon OS, `stat` is handy to show permissions for a file or directory in both their absolute octal notation and their read-write-execute abbreviation; truncated example: 
218
+
219
+	chmod 777 tester.md
220
+	stat tester.md
221
+	  File: 'tester.md'
222
+	  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
223
+	Device: 801h/2049d      Inode: 316385      Links: 1
224
+	Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
225
+
226
+## watch
227
+
228
+The `watch` utility runs a command at regular intervals so you can observe how its output changes over time. `watch` can help dynamically monitor network links, routes, and other information when you are troubleshooting networking or performance issues. Examples: 
229
+
230
+	watch -n0 --differences ss
231
+	watch -n1 --differences ip route
232
+	
233
+The following is an example with a screenshot of the output. This command monitors the traffic on your network links. The highlighted numbers are updated every second so you can see the traffic fluctuating: 
234
+
235
+	watch -n1 --differences ip -s link show up
236
+
237
+![The dynamic output of the watch utility](images/watchcmd.png)  
238
+
239
+## vmstat and fdisk
240
+
241
+The `vmstat` tool displays statistics about virtual memory, processes, block input-output, disks, and CPU activity. This tool can help diagnose performance problems, especially system bottlenecks.  
242
+
243
+Its output on a Photon OS virtual machine running in VMware Workstation 12 Pro without a heavy load looks like this: 
244
+
245
+	vmstat
246
+	procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
247
+	 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
248
+	 0  0      0   5980  72084 172488    0    0    27    44  106  294  1  0 98  1  0
249
+
250
+These codes are explained in the `vmstat` man page. 
251
+
252
+    - If `r`, the number of runnable processes, is higher than 10, the machine is under stress; consider intervening to reduce the number of processes or to distribute some of the processes to other machines. In other words, the machine has a bottleneck in executing processes.
253
+    - If `cs`, the number of context switches per second, is really high, there may be too many jobs running on the machine.
254
+    - If `in`, the number of interrupts per second, is relatively high, there might be a bottleneck for network or disk IO.
255
+
256
+You can investigate disk IO further by using vmstat's `-d` option to report disk statistics. The following is an abridged example on a machine with little load: 
257
+
258
+	vmstat -d
259
+	disk- ------------reads------------ ------------writes----------- -----IO------
260
+	       total merged sectors      ms  total merged sectors      ms    cur    sec
261
+	ram0       0      0       0       0      0      0       0       0      0      0
262
+	ram1       0      0       0       0      0      0       0       0      0      0
263
+	loop0      0      0       0       0      0      0       0       0      0      0
264
+	loop1      0      0       0       0      0      0       0       0      0      0
265
+	sr0        0      0       0       0      0      0       0       0      0      0
266
+	sda    22744    676  470604   12908  72888  24949  805224  127692      0    130
267
+
268
+The `-D` option summarizes disk statistics:
269
+
270
+	vmstat -D
271
+	           26 disks
272
+	            2 partitions
273
+	        22744 total reads
274
+	          676 merged reads
275
+	       470604 read sectors
276
+	        12908 milli reading
277
+	        73040 writes
278
+	        25001 merged writes
279
+	       806872 written sectors
280
+	       127808 milli writing
281
+	            0 inprogress IO
282
+	          130 milli spent IO
283
+
284
+You can also get statistics about a partition. First, run the `fdisk -l` command to list the machine's devices. Then run `vmstat -p` with the name of a device to view its stats: 
285
+
286
+
287
+	fdisk -l
288
+	Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
289
+	Units: sectors of 1 * 512 = 512 bytes
290
+	Sector size (logical/physical): 512 bytes / 4096 bytes
291
+	I/O size (minimum/optimal): 4096 bytes / 4096 bytes
292
+	...
293
+	Device        Start      End  Sectors Size Type
294
+	/dev/sda1      2048 16771071 16769024   8G Linux filesystem
295
+	/dev/sda2  16771072 16777182     6111   3M BIOS boot
296
+
297
+	vmstat -p /dev/sda1
298
+	sda1          reads   read sectors  writes    requested writes
299
+	               22579     473306      78510     866088
300
+
301
+See the `vmstat` man page for more options. 
302
+
303
+## lsof
304
+
305
+The `lsof` command lists open files. The tool's definition of an open file  includes directories, libraries, streams, domain sockets, and Internet sockets. THis enables it to identify the files a process is using. Because a Linux system like Photon OS uses files to do its work, you can run `lsof` as root to see how the system is using them and to see how an application works. 
306
+
307
+If you cannot unmount a disk because it is in use, you can run `lsof` to identify the files on the disk that are being used. 
308
+
309
+The following is an example that shows the processes that are using the root directory: 
310
+
311
+	lsof /root
312
+	COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
313
+	bash       879 root  cwd    DIR    8,1     4096 262159 /root
314
+	bash      1265 root  cwd    DIR    8,1     4096 262159 /root
315
+	sftp-serv 1326 root  cwd    DIR    8,1     4096 262159 /root
316
+	gdb       1351 root  cwd    DIR    8,1     4096 262159 /root
317
+	bash      1395 root  cwd    DIR    8,1     4096 262159 /root
318
+	lsof      1730 root  cwd    DIR    8,1     4096 262159 /root
319
+
320
+You can do the same with an application or virtual appliance by running `lsof` with the user name or process ID of the app. The following example lists the open files used by the Apache HTTP Server:  
321
+
322
+	lsof -u apache
323
+
324
+Running the command with the `-i` option lists all the open network and Internet files, which can help troubleshoot network problems: 
325
+
326
+	lsof -i
327
+
328
+See the Unix socket addresses of a user like _zookeeper_: 
329
+
330
+	lsof -u zookeeper -U
331
+
332
+The following example shows the processes running on Ports 1 through 80:
333
+
334
+	lsof -i TCP:1-80
335
+	COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
336
+	httpd    403   root    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
337
+	httpd    407 apache    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
338
+	httpd    408 apache    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
339
+	httpd    409 apache    3u  IPv6  10733      0t0  TCP *:http (LISTEN)
340
+	sshd     820   root    3u  IPv4  11336      0t0  TCP *:ssh (LISTEN)
341
+	sshd     820   root    4u  IPv6  11343      0t0  TCP *:ssh (LISTEN)
342
+	sshd    1258   root    3u  IPv4  48040      0t0  TCP 198.51.100.143:ssh->198.51.100.1:49759 (ESTABLISHED)
343
+	sshd    1319   root    3u  IPv4  50866      0t0  TCP 198.51.100.143:ssh->198.51.100.1:51054 (ESTABLISHED)
344
+	sshd    1388   root    3u  IPv4  56438      0t0  TCP 198.51.100.143:ssh->198.51.100.1:60335 (ESTABLISHED)
345
+
346
+You can also inspect the files opened by a process ID. The following example queries the files open by the systemd network service: 
347
+
348
+	lsof -p 1917
349
+	COMMAND    PID            USER   FD      TYPE             DEVICE SIZE/OFF   NODE NAME
350
+	systemd-n 1917 systemd-network  cwd       DIR                8,1     4096      2 /
351
+	systemd-n 1917 systemd-network  txt       REG                8,1   887896 272389 /usr/lib/systemd/systemd-networkd
352
+	systemd-n 1917 systemd-network  mem       REG                8,1   270680 262267 /usr/lib/libnss_files-2.22.so
353
+	systemd-n 1917 systemd-network    0r      CHR                1,3      0t0   5959 /dev/null
354
+	systemd-n 1917 systemd-network    1u     unix 0x0000000000000000      0t0  45734 type=STREAM
355
+	systemd-n 1917 systemd-network    3u  netlink                         0t0   6867 ROUTE
356
+	systemd-n 1917 systemd-network    4u     unix 0x0000000000000000      0t0  45744 type=DGRAM
357
+	systemd-n 1917 systemd-network    9u  netlink                         0t0  45754 KOBJECT_UEVENT
358
+	systemd-n 1917 systemd-network   12u  a_inode               0,11        0   5955 [timerfd]
359
+	systemd-n 1917 systemd-network   13u     IPv4             104292      0t0    UDP 198.51.100.143:bootpc
360
+
361
+## fuser
362
+
363
+The `fuser` command identifies the process IDs of processes using files or sockets. The term _process_ is, in this case, synonymous with _user_. To identify the process ID of a process using a socket, run `fuser` with its namespace option and specify `tcp` or `udp` and the name of the process or port. Examples: 
364
+
365
+	fuser -n tcp ssh
366
+	ssh/tcp:               940  1308
367
+	fuser -n tcp http
368
+	http/tcp:              592   594   595   596
369
+	fuser -n tcp 80
370
+	80/tcp:                592   594   595   596
371
+
372
+
373
+## ldd
374
+
375
+By revealing the shared libraries that a program depends on, `ldd` can help troubleshoot an application that is missing a library or finding the wrong one.
376
+
377
+For example, if you get a "file not found" output, check the path to the library.  
378
+
379
+	ldd /usr/sbin/sshd
380
+    linux-vdso.so.1 (0x00007ffc0e3e3000)
381
+    libpam.so.0 => (file not found)
382
+    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f624e570000)
383
+
384
+You can also use the `objdump` command to show dependencies for a program's object files; example:
385
+
386
+	objdump -p /usr/sbin/sshd | grep NEEDED
387
+
388
+## gdb
389
+
390
+The `gdb` tool is the GNU debugger. It lets you see inside a program while it executes or when it crashes so that you can catch errors as they occur. The `gdb` tool is typically used to debug programs written in C and C++. On Photon OS, `gdb` can help you determine why an application crashed. See the man page for `gdb` for instructions on how to run it. 
391
+
392
+For an extensive example on how to use `gdb` to troubleshoot Photon OS running on a VM when you cannot login to Photon OS, see the section on troubleshooting boot and logon problems. 
393
+
0 394
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# Troubleshooting Tools Installed by Default
1
+
2
+The following troubleshooting tools are included in the full version of Photon OS: 
3
+
4
+* `grep`. Searches files for patterns. 
5
+* `ping`. Tests network connectivity. 
6
+* `strings`. Displays the characters in a file to identify its contents.
7
+* `lsmod`. Lists loaded modules.
8
+* `ipcs`. Shows data about the inter-process communication (IPC) resources to which a process has read access. This data includes shared memory segments, message queues, and semaphore arrays.
9
+* `nm`. Lists symbols from object files. 
10
+* `diff`. Compares files side by side. This tool is useful to compare configuration files of two versions when one version works and the other does not.
0 11
\ No newline at end of file
1 12
new file mode 100644
... ...
@@ -0,0 +1,74 @@
0
+# Expanding Disk Partition
1
+
2
+If you require more space, you can expand the last partition of your disk after resizing the disk. 
3
+
4
+The commands in this section assume `sda` as disk device.
5
+
6
+1. After the disk is resized in the virtual machine, use the following command to enable the system to recognize the new disk ending boundary without rebooting:
7
+    
8
+    ```
9
+    echo 1 > /sys/class/block/sda/device/rescan
10
+    ```
11
+
12
+1. Install the `parted` package to resize the disk partition by running the following command to install it:
13
+      
14
+   ```
15
+    `tdnf install parted`.
16
+   
17
+   	# parted /dev/sda
18
+   	GNU Parted 3.2
19
+   	Using /dev/sda
20
+   	Welcome to GNU Parted! Type 'help' to view a list of commands.
21
+   ```
22
+
23
+1. List all partitions available to fix the GPT and check the last partition number:
24
+
25
+    ```
26
+   
27
+   (parted) print
28
+   
29
+   	Warning: Not all of the space available to /dev/sda appears to be used, you can
30
+   	fix the GPT to use all of the space (an extra 4194304 blocks) or continue with
31
+   	the current setting? 
32
+   	Fix/Ignore?
33
+   
34
+   Press `f` to fix the GPT layout.
35
+   
36
+   	Model: VMware Virtual disk (scsi)
37
+   	Disk /dev/sda: 34.4GB
38
+   	Sector size (logical/physical): 512B/512B
39
+   	Partition Table: gpt
40
+   	Disk Flags: 
41
+   
42
+   	Number  Start   End     Size    File system  Name  Flags
43
+   	1      1049kB  3146kB  2097kB                     bios_grub
44
+   	2      3146kB  8590MB  8587MB  ext4
45
+   
46
+   ```
47
+```
48
+
49
+    In this case we have the partition `2` as last, then we extend the partition to 100% of the remaining size:
50
+    
51
+    	(parted) resizepart 2 100%
52
+
53
+1. Expand the filesystem to the new size:
54
+	
55
+    ```
56
+    resize2fs /dev/sda2
57
+    	resize2fs 1.42.13 (17-May-2015)
58
+    	Filesystem at /dev/sda2 is mounted on /; on-line resizing required
59
+    	old_desc_blocks = 1, new_desc_blocks = 2
60
+    	The filesystem on /dev/sda2 is now 8387835 (4k) blocks long.
61
+    ```
62
+
63
+    The new space is already available in the system:
64
+    
65
+    	df -h
66
+    	Filesystem      Size  Used Avail Use% Mounted on
67
+    	/dev/root        32G  412M   30G   2% /
68
+    	devtmpfs       1001M     0 1001M   0% /dev
69
+    	tmpfs          1003M     0 1003M   0% /dev/shm
70
+    	tmpfs          1003M  252K 1003M   1% /run
71
+    	tmpfs          1003M     0 1003M   0% /sys/fs/cgroup
72
+    	tmpfs          1003M     0 1003M   0% /tmp
73
+    	tmpfs           201M     0  201M   0% /run/user/0
0 74
\ No newline at end of file
1 75
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+# List Disk Partitions with `fdisk`
1
+
2
+The `fdisk` command manipulates the disk partition table. You can, for example, use `fdisk` to list the disk partitions so that you can identify the root Linux file system. 
3
+
4
+The following example shows `/dev/sda1` to be the root Linux partition: 
5
+
6
+	fdisk -l
7
+	Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
8
+	Units: sectors of 1 * 512 = 512 bytes
9
+	Sector size (logical/physical): 512 bytes / 4096 bytes
10
+	I/O size (minimum/optimal): 4096 bytes / 4096 bytes
11
+	...
12
+	Disk /dev/sda: 8 GiB, 8589934592 bytes, 16777216 sectors
13
+	Units: sectors of 1 * 512 = 512 bytes
14
+	Sector size (logical/physical): 512 bytes / 512 bytes
15
+	I/O size (minimum/optimal): 512 bytes / 512 bytes
16
+	Disklabel type: gpt
17
+	Disk identifier: 3CFA568B-2C89-4290-8B52-548732A3972D
18
+
19
+	Device        Start      End  Sectors Size Type
20
+	/dev/sda1      2048 16771071 16769024   8G Linux filesystem
21
+	/dev/sda2  16771072 16777182     6111   3M BIOS boot
22
+
23
+
24
+
25
+
0 26
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# File System Troubleshooting
1
+
2
+Photon OS includes commands to check and troubleshoot file systems.
3
+
4
+-   [Checking Disk Space](checking-disk-space.md)
5
+-   [Adding a Disk and Partitioning It](adding-a-disk-and-partitioning-it.md)
6
+-   [Expanding Disk Partition](expanding-disk-partition.md)
7
+-   [List Disk Partitions](fdisk.md)
8
+-   [File System Consistency Check Tool](fsck.md)
9
+-   [Fixing File System Errors When fsck Fails](fixing-file-system-errors-when-fsck-fails.md)
10
+
0 11
new file mode 100644
... ...
@@ -0,0 +1,32 @@
0
+# Fixing File System Errors When fsck Fails
1
+
2
+Sometimes when `fsck` runs during startup, it encounters an error that prevents the system from fully booting until you fix the issue by running `fsck` manually. This error might occur when Photon OS is the operating system for a VM running an appliance. 
3
+
4
+If `fsck` fails when the computer boots and an error message says to run fsck manually, you can troubleshoot by restarting the VM, altering the GRUB edit menu to enter emergency mode before Photon OS fully boots, and running `fsck`.
5
+
6
+Perform the following steps:
7
+
8
+1. Take a snapshot of the virtual machine. 
9
+
10
+1. Restart the virtual machine running Photon OS. 
11
+
12
+    When the Photon OS splash screen appears as it restarts, type the letter `e` quickly to go to the `GNU GRUB` edit menu. 
13
+    
14
+    **Note**: You must type `e` quickly as Photon OS reboots quickly. Also, in VMware vSphere or VMware Workstation Pro, you might have to give the console focus by clicking in its window before it will register input from the keyboard. 
15
+
16
+1. In the `GNU GRUB` edit menu, go to the end of the line that starts with `linux`, add a space, and then add the following code exactly as it appears below:
17
+
18
+	`systemd.unit=emergency.target`
19
+
20
+1. Type `F10`.
21
+
22
+1. In the bash shell, run one of the following commands to fix the file system errors, depending on whether `sda1` or `sda2` represents the root file system: 
23
+
24
+   	`e2fsck -y /dev/sda1`
25
+   
26
+   	or
27
+   
28
+   	`e2fsck -y /dev/sda2`
29
+
30
+1. Restart the virtual machine.
31
+
0 32
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+# Fixing Sendmail
1
+
2
+If Sendmail is not behaving as expected or hangs during installation, it might be because FQDN is not set. 
3
+
4
+Perform the following steps:  
5
+
6
+1. Set an FQDN for your Photon OS machine. 
7
+
8
+1. Run the following commands in the order below: 
9
+        
10
+    ```
11
+    echo $(hostname -f) > /etc/mail/local-host-names
12
+        
13
+        cat > /etc/mail/aliases << "EOF"
14
+            postmaster: root
15
+            MAILER-DAEMON: root
16
+            EOF
17
+    
18
+        /bin/newaliases
19
+    
20
+        cd /etc/mail
21
+    
22
+        m4 m4/cf.m4 sendmail.mc > sendmail.cf
23
+    
24
+        chmod 700 /var/spool/clientmqueue
25
+    
26
+        chown smmsp:smmsp /var/spool/clientmqueue
27
+    ```
28
+
0 29
new file mode 100644
... ...
@@ -0,0 +1,56 @@
0
+# File System Consistency Check Tool
1
+
2
+You can manually check the file system by using the file system consistency check tool, `fsck`, after you unmount the file system.
3
+
4
+The Photon OS file system includes btrfs and ext4. The default root file system is ext4, which you can see by looking at the file system configuration file, `/etc/fstab`: 
5
+
6
+    ```
7
+    cat /etc/fstab
8
+    	#system mnt-pt  type    options dump    fsck
9
+    	/dev/sda1       /       ext4    defaults,barrier,noatime,noacl,data=ordered     1       1
10
+    	/dev/cdrom      /mnt/cdrom      iso9660 ro,noauto       0       0
11
+    ```
12
+
13
+The `1` in the fifth column, under `fsck`, indicates that fsck checks the file system when the system boots.
14
+
15
+You can also perform a read-only check without unmounting it:
16
+	
17
+    ```
18
+    fsck -nf /dev/sda1
19
+    	fsck from util-linux 2.27.1
20
+    	e2fsck 1.42.13 (17-May-2015)
21
+    	Warning!  /dev/sda1 is mounted.
22
+    	Warning: skipping journal recovery because doing a read-only filesystem check.
23
+    	Pass 1: Checking inodes, blocks, and sizes
24
+    	Pass 2: Checking directory structure
25
+    	Pass 3: Checking directory connectivity
26
+    	Pass 4: Checking reference counts
27
+    	Pass 5: Checking group summary information
28
+    	Free blocks count wrong (1439651, counted=1423942).
29
+    	Fix? no
30
+    	Free inodes count wrong (428404, counted=428397).
31
+    	Fix? no
32
+    	/dev/sda1: 95884/524288 files (0.3% non-contiguous), 656477/2096128 blocks
33
+    ```
34
+
35
+The inodes count might be wrong because the file system is mounted and in use. 
36
+
37
+To fix errors, you must first unmount the file system and then run fsck again: 
38
+	
39
+    ```
40
+    umount /dev/sda1
41
+    umount: /: target is busy
42
+    ```
43
+
44
+You can find information about processes that use the device by using `lsof` or `fuser`.
45
+    
46
+    	
47
+    ```
48
+    lsof | grep ^jbd2/sd
49
+    	jbd2/sda1   99                root  cwd       DIR                8,1     4096          2 /
50
+    	jbd2/sda1   99                root  rtd       DIR                8,1     4096          2 /
51
+    	jbd2/sda1   99                root  txt   unknown                                        /proc/99/exe
52
+    ```
53
+
54
+The above example indicates that file system is in use. 
55
+
0 56
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+# General Best Practices
1
+
2
+When troubleshooting, it is recommended that you follow some general best practices:
3
+
4
+* **Take a snapshot.** Before you do anything to a virtual machine running Photon OS, take a snapshot of the VM so that you can restore it if need be. 
5
+
6
+* **Make a backup copy.** Before you change a configuration file, make a copy of the original file. For example: `cp /etc/tdnf/tdnf.conf /etc/tdnf/tdnf.conf.orig`
7
+
8
+* **Collect logs.** Save the log files associated with a Photon OS problem. Include not only the log files on the guest but also the `vmware.log` file on the host. The `vmware.log` file is in the host's directory that contains the VM.
9
+
10
+* **Know what is in your toolbox.** View the man page for a tool before you use it so that you know what your options are. The options can help focus the command's output on the problem you're trying to solve.
11
+
12
+* **Understand the system.** The more you know about the operating system and how it works, the better you can troubleshoot.
0 13
\ No newline at end of file
1 14
new file mode 100644
2 15
Binary files /dev/null and b/docs/photon_troubleshoot/images/grub-edit-menu-changepw.png differ
3 16
new file mode 100644
4 17
Binary files /dev/null and b/docs/photon_troubleshoot/images/grub-edit-menu-orig.png differ
5 18
new file mode 100644
6 19
Binary files /dev/null and b/docs/photon_troubleshoot/images/resetpw.png differ
7 20
new file mode 100644
8 21
Binary files /dev/null and b/docs/photon_troubleshoot/images/top-in-photon-os.png differ
9 22
new file mode 100644
10 23
Binary files /dev/null and b/docs/photon_troubleshoot/images/watchcmd.png differ
11 24
new file mode 100644
... ...
@@ -0,0 +1,32 @@
0
+# Inspecting IP Addresses
1
+
2
+VMware recommends that you use the `ip` or `ss` commands as the `ifconfig` and `netstat` commands are deprecated. 
3
+
4
+To display a list of network interfaces, run the `ss` command. Similarly, to display information for IP addresses, run the `ip addr` command. 
5
+
6
+Examples:
7
+
8
+	USE THIS IPROUTE COMMAND 	INSTEAD OF THIS NET-TOOL COMMAND
9
+	ip addr 					ifconfig -a
10
+	ss 							netstat
11
+	ip route 					route
12
+	ip maddr 					netstat -g
13
+	ip link set eth0 up 		ifconfig eth0 up
14
+	ip -s neigh					arp -v
15
+	ip link set eth0 mtu 9000	ifconfig eth0 mtu 9000
16
+
17
+Use the `ip route` version of a command instead of the net-tools to get accurate information: 
18
+
19
+	ip neigh
20
+	198.51.100.2 dev eth0 lladdr 00:50:56:e2:02:0f STALE
21
+	198.51.100.254 dev eth0 lladdr 00:50:56:e7:13:d9 STALE
22
+	198.51.100.1 dev eth0 lladdr 00:50:56:c0:00:08 DELAY
23
+
24
+	arp -a
25
+	? (198.51.100.2) at 00:50:56:e2:02:0f [ether] on eth0
26
+	? (198.51.100.254) at 00:50:56:e7:13:d9 [ether] on eth0
27
+	? (198.51.100.1) at 00:50:56:c0:00:08 [ether] on eth0
28
+
29
+**Important:** If you modify an IPv6 configuration or add an IPv6 interface, you must restart `systemd-networkd`. Traditional methods of using `ifconfig` commands will be inadequate to register the changes. Run the following command instead: 
30
+
31
+	systemctl restart systemd-networkd
0 32
new file mode 100644
... ...
@@ -0,0 +1,63 @@
0
+# Inspecting the Status of Network Links with `networkctl`
1
+
2
+The `networkctl` command displays information about network connections that helps you configure networking services and troubleshoot networking problems. 
3
+
4
+You can progressively add options and arguments to the `networkctl` command to move from general information about network connections to specific information about a network connection. 
5
+
6
+Running `networkctl` without options defaults to the list command:  
7
+
8
+	networkctl
9
+	IDX LINK             TYPE               OPERATIONAL SETUP
10
+	  1 lo               loopback           carrier     unmanaged
11
+	  2 eth0             ether              routable    configured
12
+	  3 docker0          ether              routable    unmanaged
13
+	 11 vethb0aa7a6      ether              degraded    unmanaged
14
+	 4 links listed.
15
+
16
+Run the `networkctl` with the status command to display active network links with IP addresses for not only the Ethernet connection, but also the Docker container. 
17
+
18
+	root@photon-rc [ ~ ]# networkctl status
19
+	*      State: routable
20
+	     Address: 198.51.100.131 on eth0
21
+	              172.17.0.1 on docker0
22
+	              fe80::20c:29ff:fe55:3ca6 on eth0
23
+	              fe80::42:f0ff:fef7:bd81 on docker0
24
+	              fe80::4c84:caff:fe76:a23f on vethb0aa7a6
25
+	     Gateway: 198.51.100.2 on eth0
26
+	         DNS: 198.51.100.2
27
+
28
+You can add a network link, such as the Ethernet connection, as the argument of the status command to show specific information about the link: 
29
+
30
+	root@photon-rc [ ~ ]# networkctl status eth0
31
+	* 2: eth0
32
+	       Link File: /usr/lib/systemd/network/99-default.link
33
+	    Network File: /etc/systemd/network/10-dhcp-en.network
34
+	            Type: ether
35
+	           State: routable (configured)
36
+	            Path: pci-0000:02:01.0
37
+	          Driver: e1000
38
+	      HW Address: 00:0c:29:55:3c:a6 (VMware, Inc.)
39
+	             MTU: 1500
40
+	         Address: 198.51.100.131
41
+	                  fe80::20c:29ff:fe55:3ca6
42
+	         Gateway: 198.51.100.2
43
+	             DNS: 198.51.100.2
44
+	        CLIENTID: ffb6220feb00020000ab116724f520a0a77337
45
+
46
+You can add a Docker container as follows: 
47
+
48
+	networkctl status docker0
49
+	* 3: docker0
50
+	       Link File: /usr/lib/systemd/network/99-default.link
51
+	    Network File: n/a
52
+	            Type: ether
53
+	           State: routable (unmanaged)
54
+	          Driver: bridge
55
+	      HW Address: 02:42:f0:f7:bd:81
56
+	             MTU: 1500
57
+	         Address: 172.17.0.1
58
+	                  fe80::42:f0ff:fef7:bd81
59
+
60
+In the example above, the output indicates that state of the Docker container is unmanaged. Docker uses the bridge drive to handle managing the networking for the containers and not `systemd-resolved` or `systemd-networkd`. 
61
+
62
+For more information about `networkctl` commands and options, see https://www.freedesktop.org/software/systemd/man/networkctl.html.
0 63
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+# Inspecting Services with `systemd-analyze`
1
+
2
+The `systemd-analyze` command reveals performance statistics for boot times, traces system services, and verifies unit files. It can help troubleshoot slow system boots and incorrect unit files. See the man page for a list of options. 
3
+
4
+Examples:
5
+
6
+	systemd-analyze blame
7
+
8
+	systemd-analyze dump
0 9
\ No newline at end of file
1 10
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+# Installing the Packages for tcpdump and netcat with tdnf
1
+
2
+The minimal version of Photon OS leaves out several useful networking tools to keep the operating system lean. 
3
+
4
+Tcpdump is not available in the minimal version but available in the repository. The minimal version includes the iproute2 tools by default. 
5
+
6
+Tcpdump captures and analyzes packets on a network interface. On Photon OS, you install `tcpdump` and its accompanying package `libpcap`, a C/C++ library for capturing network traffic, by using `tdnf`:
7
+
8
+	tdnf install tcpdump
9
+
10
+Netcat, a tool for sending data over network connections with TCP or UDP, appears in neither the minimal nor the full version of Photon OS. But since netcat furnishes powerful options for analyzing, troubleshooting, and debugging network connections, you might want to install it. To do so, run the following command: 
11
+
12
+	tdnf install netcat
0 13
\ No newline at end of file
1 14
new file mode 100644
... ...
@@ -0,0 +1,34 @@
0
+# Installing Tools from Repositories
1
+
2
+You can install several troubleshooting tools from the Photon OS repositories by using the default package management system, `tdnf`. 
3
+
4
+If a tool you require is not installed, search the repositories to see if it is available. 
5
+
6
+For example, the traceroute tool is not installed by default. You can search for it in the repositories as follows:   
7
+
8
+	tdnf search traceroute
9
+	traceroute : Traces the route taken by packets over an IPv4/IPv6 network
10
+
11
+The results of the above command show that traceroute exists in the repository. You install it with `tdnf`: 
12
+
13
+	tdnf install traceroute
14
+
15
+The following tools are not installed by default but are in the repository and can be installed with `tdnf`: 
16
+
17
+* `net-tools`. Networking tools.
18
+* `ltrace`. Tool for intercepting and recording dynamic library calls. It can identify the function an application was calling when it crashed, making it useful for debugging.
19
+* `nfs-utils`. Client tools for the kernel Network File System, or NFS, including showmount. These are installed by default in the full version of Photon OS but not in the minimal version. 
20
+* `pcstat`. A tool that inspects which pages of a file or files are being cached by the Linux kernel.
21
+* `sysstat` and `sar`. Utilities to monitor system performance and usage activity. Installing sysstat also installs sar.
22
+* `systemtap` and `crash`. The systemtap utility is a programmable instrumentation system for diagnosing problems of performance or function. Installing systemtap also installs crash, which is a kernel crash analysis utility for live systems and dump files.
23
+* `dstat`. Tool for viewing and analyzing statistics about system resources.
24
+
25
+    The `dstat` tool can help troubleshoot system performance. The tool shows live, running list of statistics about system resources: 
26
+    
27
+    	dstat
28
+    	You did not select any stats, using -cdngy by default.
29
+    	----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
30
+    	usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
31
+    	  1   0  98   1   0   0|4036B   42k|   0     0 |   0     0 |  95   276
32
+    	  1   0  98   1   0   0|   0    64k|  60B  940B|   0     0 | 142   320
33
+    	  1   1  98   0   0   0|   0    52k|  60B  476B|   0     0 | 149   385
0 34
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+# Introduction 
1
+
2
+The *Troubleshooting Guide* covers the basics of troubleshooting systemd, packages, network interfaces, services such as SSH and Sendmail, the file system, and the Linux kernel. The guide also includes information about the tools that you can use for troubleshooting with examples, how to access the logs, and best practices.
3
+
4
+-   [Systemd and TDNF](systemd-and-tdnf.md)
5
+-   [The Root Account and the `sudo` and `su` Commands](root-account-sudo-and-su-commands.md)
6
+-   [Checking the Version and Build Number](checking-the-version-and-build-number.md)
7
+-   [General Best Practices](general-best-practices.md)
8
+-   [Photon OS Logs](photon-os-logs.md)
9
+-   [Troubleshooting Progression](troubleshooting-progression.md)
0 10
\ No newline at end of file
1 11
new file mode 100644
... ...
@@ -0,0 +1,48 @@
0
+# Investigating Unexpected Behavior
1
+
2
+If you rebooted to address unexpected behavior before the reboot or if you encountered unexpected behavior during the reboot but have reached the shell, you must analyze what happened since the previous boot. 
3
+
4
+1. Run the following command to check the logs:
5
+
6
+	   `journalctl`
7
+
8
+1. Run the following command to look at what happened since the penultimate reboot:
9
+
10
+	`journalctl --boot=-1`
11
+
12
+    Look at the log from the reboot: 
13
+
14
+	`journalctl -b`
15
+
16
+1. If required, examine the logs for the kernel:
17
+
18
+	   `journalctl -k`
19
+
20
+1. Check which kernel is in use:
21
+
22
+	`uname -r`
23
+
24
+    The kernel version of Photon OS in the full version is 4.4.8. The kernel version of in the OVA version is 4.4.8-esx. With the ESX version of the kernel, some services might not start. 
25
+
26
+1. Run this command to check the overall status of services:
27
+
28
+	`systemctl status` 
29
+
30
+    If a service is in red, check it: 
31
+    
32
+    	systemctl status service-name
33
+    
34
+    Start it if required: 
35
+    
36
+    	systemctl start service-name
37
+
38
+1. If looking at the journal and checking the status of services does not resolve your error, run the following `systemd-analyze` commands to examine the boot time and the speed with which services start.
39
+	
40
+    ```
41
+    systemd-analyze time
42
+    	systemd-analyze blame
43
+    	systemd-analyze critical-chain
44
+    ```
45
+
46
+ 
47
+**Note**: The output of these commands might be misleading because one service might just be waiting for another service to finish initializing.
0 48
new file mode 100644
... ...
@@ -0,0 +1,133 @@
0
+# Investigating the Guest Kernel
1
+
2
+If a VM running Photon OS and an application or virtual appliance is behaving preventing you from logging in to the machine, you can troubleshoot by extracting the kernel logs from the guest's memory and analyzing them with `gdb`. 
3
+
4
+This advanced troubleshooting method works when you are running Photon OS as the operating system for an application or appliance on VMware Workstation, Fusion, or ESXi. The procedure in this section assumes that the virtual machine running Photon OS is functioning normally. 
5
+
6
+The process to use this troubleshooting method varies by environment. The examples in this section assume that the troublesome Photon OS virtual machine is running in VMware Workstation 12 Pro on a Microsoft Windows 8 Enterprise host. The examples also use an additional, fully functional Photon OS virtual machine running in Workstation.
7
+
8
+You can use other hosts, hypervisors, and operating systems--but you will have to adapt the example process below to them. Directory paths, file names, and other aspects might be different on other systems. 
9
+
10
+- [Prerequisites](#prerequisites)
11
+- [Procedure Overview](#procedure-overview)
12
+- [Procedure](#procedure)
13
+
14
+## Prerequisites
15
+
16
+Verify that you have the following resources: 
17
+
18
+* Root access to a Linux machine other than the one you are troubleshooting. It can be another Photon OS machine, Ubuntu, or another Linux variant. 
19
+* The `vmss2core` utility from VMware. It is installed by default in VMware Workstation and some other VMware products. If your system doesn't already contain it, you can download it for free from https://labs.vmware.com/flings/vmss2core.
20
+* A local copy of the Photon OS ISO of the exact same version and release number as the Photon OS machine that you are troubleshooting. 
21
+
22
+## Procedure Overview
23
+
24
+The process to apply this troubleshooting method is as follows:
25
+
26
+- On a local computer, you open a file on the Photon OS ISO that contains Linux debugging information. Then you suspend the troublesome Photon OS VM and extract the kernel memory logs from the VMware hypervisor running Photon OS.
27
+- Next, you use the vmss2core tool to convert the memory logs into core dump files. The vmss2core utility converts VMware checkpoint state files into formats that third-party debugging tools understand. It can handle both suspend (.vmss) and snapshot (.vmsn) checkpoint state files (hereafter referred to as a _vmss file_) as well as monolithic and non-monolithic (separate .vmem file) encapsulation of checkpoint state data. See [Debugging Virtual Machines with the Checkpoint to Core Tool](http://www.vmware.com/pdf/snapshot2core_technote.pdf).
28
+- Finally, you prepare to run the gdb tool by using the debug info file from the ISO to create a `.gdbinit` file, which you can then analyze with the gdb shell on your local Linux machine.
29
+
30
+All three components must be in the same directory on a Linux machine.  
31
+
32
+## Procedure
33
+
34
+1. Obtain a local copy of the Photon OS ISO of the exact same version and release number as the Photon OS machine that you are troubleshooting and mount the ISO on a Linux machine (or open it on a Windows machine):
35
+
36
+	   mount /mnt/cdrom
37
+
38
+1. Locate the following file. (If you opened the Photon OS ISO on a Windows computer, copy the following file to the root folder of a Linux machine.)
39
+
40
+	   /RPMS/x86_64/linux-debuginfo-4.4.8-6.ph1.x86_64.rpm
41
+
42
+1. On a Linux machine, run the following `rpm2cpio` command to convert the RPM file to a cpio file and to extract the contents of the RPM to the current directory:
43
+	
44
+    ```
45
+    rpm2cpio /mnt/cdrom/RPMS/x86_64/linux-debuginfo-4.4.8-6.ph1.x86_64.rpm | cpio -idmv
46
+    ```
47
+
48
+1. From the extracted files, copy the following file to your current directory:
49
+
50
+    ```
51
+    cp usr/lib/debug/lib/modules/4.4.8/vmlinux-4.4.8.debug
52
+    ```
53
+
54
+1. Run the following command to download the dmesg functions that will help extract the kernel log from the coredump: 
55
+
56
+    ```
57
+    wget https://www.kernel.org/doc/Documentation/kdump/gdbmacros.txt
58
+    wget https://github.com/vmware/photon/blob/master/tools/scripts/gdbmacros-for-linux.txt
59
+    ```
60
+
61
+1. Move the file as follows:
62
+	
63
+    ```
64
+    mv gdbmacros-for-linux.txt .gdbinit
65
+    ```
66
+
67
+1. Switch to your host machine so you can get the kernel memory files from the VM. Suspend the troublesome VM and locate the `.vmss` and `.vmem` files in the virtual machine's directory on the host. 
68
+
69
+    Example:
70
+	
71
+    ```
72
+    C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit (7)>dir
73
+    	 Volume in drive C is Windows
74
+    	 Directory of C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit
75
+    	 (7)
76
+    	09/20/2016  12:22 PM    <DIR>          .
77
+    	09/20/2016  12:22 PM    <DIR>          ..
78
+    	09/19/2016  03:39 PM       402,653,184 VMware Photon 64-bit (7)-f6b070cd.vmem
79
+    	09/20/2016  12:11 PM         5,586,907 VMware Photon 64-bit (7)-f6b070cd.vmss
80
+    	09/20/2016  12:11 PM     1,561,001,984 VMware Photon 64-bit (7)-s001.vmdk
81
+    	...
82
+    	09/20/2016  12:11 PM           300,430 vmware.log
83
+    	...
84
+    ```
85
+
86
+1. Now that you have located the `.vmss` and `.vmem` files, convert them to one or more core dump files by using the vmss2core tool that comes with Workstation. Here is an example of how to run the command. Be careful with your pathing, escaping, file names, and so forth--all of which might be different from this example on your Windows machine.
87
+
88
+    ```
89
+    
90
+    	C:\Users\shoenisch\Documents\Virtual Machines\VMware Photon 64-bit (7)>C:\"Program Files (x86)\VMware\VMware Workstation"\vmss2core.exe "VMware Photon 64-bit (7)-f6b070cd.vmss" "VMware Photon 64-bit (7)-f6b070cd.vmem"
91
+    
92
+    The result of this command is one or more files with a `.core` extension plus a digit. Truncated example: 
93
+    
94
+    	C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit (7)>dir
95
+    	 Directory of C:\Users\tester\Documents\Virtual Machines\VMware Photon 64-bit(7)
96
+    	09/20/2016  12:22 PM       729,706,496 vmss.core0
97
+    ```
98
+
99
+1. Copy the `.core` file or files to the your current directory on the Linux machine where you so that you can analyze it with gdb.
100
+
101
+    Run the following `gdb` command to enter the gdb shell attached to the memory core dump file. You might have to change the name of the `vmss.core` file in the example to match your `.core` file:
102
+
103
+	
104
+```
105
+gdb vmlinux-4.4.8.debug vmss.core0
106
+
107
+	GNU gdb (GDB) 7.8.2
108
+	Copyright (C) 2014 Free Software Foundation, Inc.
109
+	License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
110
+	This is free software: you are free to change and redistribute it. 
111
+	There is NO WARRANTY, to the extent permitted by law. ...
112
+	Type "show configuration" for configuration details.
113
+	For bug reporting instructions, please see:
114
+	<http://www.gnu.org/software/gdb/bugs/>.
115
+	Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>.
116
+	For help, type "help".
117
+	Type "apropos word" to search for commands related to "word"...
118
+	Reading symbols from vmlinux-4.4.8.debug...done.
119
+	warning: core file may not match specified executable file.
120
+	[New LWP 12345]
121
+	Core was generated by `GuestVM'.
122
+	Program terminated with signal SIGSEGV, Segmentation fault.
123
+	#0  0xffffffff813df39a in insb (count=0, addr=0xffffc90000144000, port=<optimized out>)
124
+	    at arch/x86/include/asm/io.h:316
125
+	316     arch/x86/include/asm/io.h: No such file or directory.
126
+	(gdb)
127
+```
128
+
129
+**Result** 
130
+
131
+In the results above, the _(gdb)_ of the last line is the prompt of the gdb shell. You can now analyze the core dump by using commands like `bt`, to perform a backtrace, and `dmesg`, to view the Photon OS kernel log and see Photon OS kernel error messages.
132
+
0 133
new file mode 100644
... ...
@@ -0,0 +1,146 @@
0
+# Kernel Log Replication with VProbes
1
+
2
+Replicating the Photon OS kernel logs on the VMware ESXi host is an advanced but powerful method of troubleshooting a kernel problem. 
3
+
4
+
5
+- [Replication Method](#replication-method)
6
+- [Using VProbes Script with a Hard-Coded Address](#using-vprobes-script- with-a-hard-coded-address)
7
+- [A Reusable VProbe Script Using the kallsyms File](#a-reusable-vprobe-script-using-the-kallsyms-file)
8
+
9
+## Replication Method
10
+
11
+This method is applicable when the virtual machine running Photon OS is hanging or inaccessible because, for instance, the hard disk has failed.
12
+
13
+As a prerequisite, you must have preemptively enabled the VMware VProbes facility on the VM before an error rendered it inaccessible. You must also create a VProbes script on the ESXi host, but you can do that after the error. 
14
+
15
+The method is useful in analyzing kernel issues when testing an application or appliance that is running on Photon OS.   
16
+
17
+There are two similar ways in which you can replicate the Photon OS kernel logs on ESXi by using VProbes. 
18
+
19
+- The first modifies the VProbes script so that it works only for the VM that you set. It uses a hard-coded address.
20
+
21
+- The second uses an abstraction instead of a hard-coded address so that the same VProbes script can be used for any VM on an ESXi host that you have enabled for VProbe and copied its kernel symbol table (kallsyms) to ESXi.
22
+
23
+For more information on VMware VProbes, see [VProbes: Deep Observability Into the ESXi Hypervisor](https://labs.vmware.com/vmtj/vprobes-deep-observability-into-the-esxi-hypervisor) and the [VProbes Programming Reference](http://www.vmware.com/pdf/ws7_f3_vprobes_reference.pdf).
24
+
25
+## Using VProbes Script with a Hard-Coded Address
26
+
27
+Perform the following steps to set a VProbe for an individual VM: 
28
+
29
+1. Power off the VM so that you can turn on the VProbe facility. 
30
+
31
+    Edit the `.vmx` configuration file for the VM. The file resides in the directory that contains the VM in the ESXi data store. Add the following line of code to the `.vmx` file and then power the VM on:
32
+    
33
+    	vprobe.enable = "TRUE"
34
+    
35
+    When you edit the `.vmx` file to add the above line of code, you must first turn off the VM--otherwise, your changes will not persist. 
36
+
37
+1. Obtain the kernel `log_store` function address by connecting to the VM with SSH and running the following commands as root. 
38
+
39
+    Photon OS uses the `kptr_restrict` setting to place restrictions on the kernel addresses exposed through `/proc` and other interfaces. This setting hides exposed kernel pointers to prevent attackers from exploiting kernel write vulnerabilities. When you are done using VProbes, you should return `kptr_restrict` to the original setting of `2` by rebooting.)
40
+    
41
+    	echo 0 > /proc/sys/kernel/kptr_restrict
42
+    	grep log_store /proc/kallsyms
43
+    
44
+    The output of the `grep` command will look similar to the following string. The first set of characters (without the `t`) is the log_store function address:
45
+    
46
+    	ffffffff810bb680 t log_store
47
+
48
+1. Connect to the ESXi host with SSH so that you can create a VProbes script. 
49
+
50
+    Below is the template for the script. `log_store` in the first line is a placeholder for the VM's log_store function address:
51
+    	
52
+    ```
53
+    GUEST:ENTER:log_store {
54
+        	   string dst;
55
+        	   getgueststr(dst, getguest(RSP+16) & 0xff, getguest(RSP+8));
56
+        	   printf("%s\n", dst);
57
+        	}
58
+    ```
59
+
60
+    On the ESXi host, create a new file, add the template to it, and then change `log_store` to the function address that was the output from the grep command on the VM. 
61
+
62
+1. Add a `0x` prefix to the function address. In this example, the modified template looks like this:
63
+	
64
+    ```
65
+    GUEST:ENTER:0xffffffff810bb680 {
66
+    	   string dst;
67
+    	   getgueststr(dst, getguest(RSP+16) & 0xff, getguest(RSP+8));
68
+    	   printf("%s\n", dst);
69
+    	}
70
+    ```
71
+
72
+1. Save your VProbes script as `console.emt` in the `/tmp` directory. (The file extension for VProbe scripts is `.emt`.)
73
+
74
+    While still connected to the ESXi host with SSH, run the following command to obtain the ID of the virtual machine that you want to troubleshoot: 
75
+    
76
+    	vim-cmd vmsvc/getallvms
77
+    
78
+    This command lists all the VMs running on the ESXi host. Find the VM you want to troubleshoot in the list and make a note of its ID. 
79
+
80
+1. Run the following command to print all the kernel messages from Photon OS in your SSH console; replace `<VM ID>` with the ID of your VM:
81
+
82
+	`vprobe -m <VM ID> /tmp/console.emt`
83
+
84
+    When you're done, type `Ctrl-C` to stop the loop. 
85
+
86
+## A Reusable VProbe Script Using the kallsyms File
87
+
88
+Perform the following steps to create one VProbe script and use for all the VMs on your ESXi host. 
89
+
90
+1. Power off the VM and turn on the VProbe facility on each VM that you want to be able to analyze. 
91
+
92
+    Add `vprobe.enable = "TRUE"` to the VM's `.vmx` configuration file. See the instructions above.
93
+
94
+1. Power on the VM, connect to it with SSH, and run the following command as root:
95
+	
96
+	   `echo 0 > /proc/sys/kernel/kptr_restrict`
97
+
98
+1. Connect to the ESXi host with SSH to create the following VProbes script and save it as `/tmp/console.emt`:
99
+	
100
+    ```
101
+    GUEST:ENTER:log_store {
102
+    	   string dst;
103
+    	   getgueststr(dst, getguest(RSP+16) & 0xff, getguest(RSP+8));
104
+    	   printf("%s\n", dst);
105
+    	}
106
+    ```
107
+
108
+1. From the ESXi host, run the following command to copy the VM's `kallysms` file to the `tmp` directory on the ESXi host:
109
+
110
+	   `scp root@<vm ip address>:/proc/kallsyms /tmp`
111
+
112
+    While still connected to the ESXi host with SSH, run the following command to obtain the ID of the virtual machine that you want to troubleshoot: 
113
+    
114
+    	`vim-cmd vmsvc/getallvms`
115
+    
116
+    This command lists all the VMs running on the ESXi host. Find the VM you want to troubleshoot in the list and make a note of its ID. 
117
+
118
+1. Run the following command to print all the kernel messages from Photon OS in your SSH console.
119
+
120
+    Replace `<VM ID>` with the ID of your VM. When you're done, type `Ctrl-C` to stop the loop.
121
+
122
+	`vprobe -m <VM ID> -k /tmp/kallysyms /tmp/console.emt`
123
+
124
+    You can use a directory other than `tmp` if you want.
125
+
126
+<!--
127
+### Deep Kernel Analysis with the Crash Utility
128
+
129
+-->
130
+
131
+<!-- 
132
+
133
+### Go to the Debug Shell
134
+
135
+‘ panic=1 init=/bin/bash’
136
+mount –o rw,remount /
137
+cd /lib/systemd/system/multi-user.target.wants
138
+ln –s ../debug-shell.service
139
+umount /
140
+sync
141
+exit
142
+
143
+After reboot debug-shell will be available on tty9. No password required.
144
+
145
+-->
0 146
\ No newline at end of file
1 147
new file mode 100644
... ...
@@ -0,0 +1,39 @@
0
+# Kernel Overview
1
+
2
+You can use `dmesg` command to troubleshooting kernel errors. The `dmesg` command prints messages from the kernel ring buffer. 
3
+
4
+The following command, for example, presents kernel messages in a human-readable format: 
5
+
6
+	dmesg --human --kernel
7
+
8
+To examine kernel messages as you perform actions, such as reproducing a problem, in another terminal, you can run the command with the `--follow` option, which waits for new messages and prints them as they occur: 
9
+
10
+	dmesg --human --kernel --follow
11
+
12
+The kernel buffer is limited in memory size. As a result, the kernel cyclically overwrites the end of the information in the buffer from which `dmesg` pulls information. The systemd journal, however, saves the information from the buffer to a log file so that you can access older information. 
13
+
14
+To view it, run the following command: 
15
+
16
+	journalctl -k
17
+
18
+If required, you can check the modules that are loaded on your Photon OS machine by running the `lsmod` command. For example:  
19
+
20
+	lsmod
21
+	Module                  Size  Used by
22
+	vmw_vsock_vmci_transport    28672  1
23
+	vsock                  36864  2 vmw_vsock_vmci_transport
24
+	coretemp               16384  0
25
+	hwmon                  16384  1 coretemp
26
+	crc32c_intel           24576  0
27
+	hid_generic            16384  0
28
+	usbhid                 28672  0
29
+	hid                   106496  2 hid_generic,usbhid
30
+	xt_conntrack           16384  1
31
+	iptable_nat            16384  0
32
+	nf_conntrack_ipv4      16384  2
33
+	nf_defrag_ipv4         16384  1 nf_conntrack_ipv4
34
+	nf_nat_ipv4            16384  1 iptable_nat
35
+	nf_nat                 24576  1 nf_nat_ipv4
36
+	iptable_filter         16384  1
37
+	ip_tables              24576  2 iptable_filter,iptable_nat
38
+	
0 39
\ No newline at end of file
1 40
new file mode 100644
... ...
@@ -0,0 +1,10 @@
0
+# Kernel Problems and Boot and Login Errors
1
+
2
+Photon OS includes commands to troubleshoot kernel problems and boot and login errors.
3
+
4
+- [Kernel Overview](kernel-overview.md)
5
+- [Boot Process Overview](boot-process-overview.md)
6
+- [Blank Screen on Reboot](blank-screen-on-reboot.md)
7
+- [Investigating Unexpected Behavior](investigating-strange-behavior.md)
8
+- [Investigating the Guest Kernel](investigating-the-guest-kernel.md)
9
+- [Kernel Log Replication with VProbes](kernel-log-replication-with-vprobes.md)
0 10
\ No newline at end of file
1 11
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+# Linux Troubleshooting Tools
1
+
2
+The following Linux troubleshoot tools are neither installed on Photon OS by default nor available in the Photon OS repositories: 
3
+
4
+* iostat
5
+* telnet (use SSH instead)
6
+* Iprm
7
+* hdparm
8
+* syslog (use journalctl instead)
9
+* ddd
10
+* ksysmoops
11
+* xev
12
+* GUI tools (because Photon OS has no GUI)
0 13
\ No newline at end of file
1 14
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+# Managing the Network Configuration
1
+
2
+The network service, which is enabled by default, starts when the system boots. You manage the network service by using systemd commands, such as `systemd-networkd`, `systemd-resolvd`, and `networkctl`. 
3
+
4
+You can check the status of the network service by running the following command: 
5
+
6
+	systemctl status systemd-networkd
7
+
8
+The following is a result of the command: 
9
+
10
+	* systemd-networkd.service - Network Service
11
+	   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
12
+	   Active: active (running) since Fri 2016-04-29 15:08:51 UTC; 6 days ago
13
+	     Docs: man:systemd-networkd.service(8)
14
+	 Main PID: 291 (systemd-network)
15
+	   Status: "Processing requests..."
16
+	   CGroup: /system.slice/systemd-networkd.service
17
+	           `-291 /lib/systemd/systemd-networkd
18
+
19
+
0 20
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+# Inspect Network Settings with `netmgr`
1
+
2
+If you are running a VMware appliance on Photon OS and the VAMI module has problems or if there are networking issues, you can use the Photon OS `netmgr` utility to inspect the networking settings. Make sure that the IP addresses for the DNS server and other infrastructure are correct. Use `tcpdump` to analyze the issues. 
3
+
4
+The error code that you get from netmgr is a standard Unix error code. Enter it into a search engine to obtain more information on the error.
0 5
\ No newline at end of file
1 6
new file mode 100644
... ...
@@ -0,0 +1,18 @@
0
+# Fixing Permissions on Network Config Files
1
+
2
+When you create a new network configuration file as root user, the network service might be unable to process it until you set the file mode bits to `644`.
3
+
4
+If you query the journal with `journalctl -u systemd-networkd`, you might see the following error message along with an indication that the network service did not start: 
5
+
6
+	`could not load configuration files. permission denied`
7
+
8
+The permissions on the network files might cause this problem. Without the correct permissions, `networkd-systemd` cannot parse and apply the settings, and the network configuration that you created will not be loaded. 
9
+
10
+After you create a network configuration file with a `.network` extension, you must run the `chmod` command to set the new file's mode bits to `644`. Example: 
11
+
12
+    `chmod 644 10-static-en.network`
13
+
14
+For Photon OS to apply the new configuration, you must restart the `systemd-networkd` service by running the following command: 
15
+
16
+	`systemctl restart systemd-networkd`
17
+
0 18
new file mode 100644
... ...
@@ -0,0 +1,38 @@
0
+# Network Debugging
1
+
2
+You can set `systemd-networkd` to work in debug mode so that you can analyze log files with debugging information to help troubleshoot networking problems. 
3
+
4
+The following procedure turns on network debugging by adding a drop-in file in `/etc/systemd` to customize the default systemd configuration in `/usr/lib/systemd`.
5
+
6
+1. Run the following command as root to create a directory with this exact name, including the `.d` extension:
7
+
8
+	`mkdir -p /etc/systemd/system/systemd-networkd.service.d/`
9
+
10
+1. Run the following command as root to establish a systemd drop-in unit with a debugging configuration for the network service:
11
+
12
+    ```
13
+    cat > /etc/systemd/system/systemd-networkd.service.d/10-loglevel-debug.conf << "EOF"
14
+    	[Service]
15
+    	Environment=SYSTEMD_LOG_LEVEL=debug
16
+    	EOF
17
+    ```
18
+ 
19
+1. Reload the `systemctl` daemon and restart the `systemd-networkd` service for the changes to take effect:
20
+	
21
+    ```
22
+    systemctl daemon-reload
23
+    	systemctl restart systemd-networkd
24
+    ```
25
+
26
+1. Verify that your changes took effect:
27
+
28
+	   `systemd-delta --type=extended`
29
+
30
+1. View the log files by running this command:
31
+
32
+	   `journalctl -u systemd-networkd`
33
+
34
+1. After debugging the network connections, turn debugging off by deleting the drop-in file:
35
+
36
+   	`rm /etc/systemd/system/systemd-networkd.service.d/10-loglevel-debug.conf`
37
+	
0 38
\ No newline at end of file
1 39
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+# Network Troubleshooting
1
+
2
+Use the `systemd` suite of commands and not deprecated `init.d` commands or other deprecated commands, to manage networking. 
3
+
4
+- [Managing the Network Configuration](managing-the-network-configuration.md)
5
+- [Inspecting IP Addresses](inspecting-ip-addresses.md)
6
+- [Inspecting the Status of Network Links with `networkctl`](inspecting-network-links-with-networkctl.md)
7
+- [Network Debugging](network-debugging.md)
8
+- [Checking Firewall Rules](checking-firewall-rules.md)
9
+- [Inspect Network Settings with `netmgr`](netmgr.md)
10
+
11
+For information about tcpdump and netcat, see [Installing the Packages for tcpdump and netcat with tdnf](photon_admin/installing-the-packages-for-tcpdump-and-netcat-with-tdnf.md)
0 12
new file mode 100644
... ...
@@ -0,0 +1,95 @@
0
+# Troubleshooting Packages
1
+
2
+On Photon OS, `tdnf` is the default package manager. The standard syntax for `tdnf` commands is the same as that for DNF and Yum: 
3
+	
4
+```
5
+tdnf [options] <command> [<arguments>...]
6
+```
7
+
8
+The main configuration files reside in `/etc/tdnf/tdnf.conf`. The repositories appear in `/etc/yum.repos.d/` with `.repo` file extensions. For more information, see the [Photon OS Administration Guide](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md).
9
+
10
+The cache files for data and metadata reside in `/var/cache/tdnf`. The local cache is populated with data from the repository: 
11
+	
12
+```
13
+ls -l /var/cache/tdnf/photon
14
+	total 8
15
+	drwxr-xr-x 2 root root 4096 May 18 22:52 repodata
16
+	d-wxr----t 3 root root 4096 May  3 22:51 rpms
17
+```
18
+
19
+You can clear the cache to help troubleshoot a problem, but doing so might slow the performance of `tdnf` until the cache becomes repopulated with data. Cleaning the cache can remove stale information. Clear the cache as follows: 
20
+	
21
+```
22
+tdnf clean all
23
+	Cleaning repos: photon photon-extras photon-updates lightwave
24
+	Cleaning up everything
25
+```
26
+
27
+Some tdnf commands can help you troubleshoot problems with packages:
28
+
29
+- `makecache` 
30
+
31
+    This command updates the cached binary metadata for all known repositories. You can run it after you clean the cache to make sure you are working with the latest repository data as you troubleshoot. 
32
+    
33
+    Example:
34
+       
35
+    ```
36
+    tdnf makecache
37
+           	Refreshing metadata for: 'VMware Lightwave 1.0(x86_64)'
38
+           	Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)Updates'
39
+           	Refreshing metadata for: 'VMware Photon Extras 1.0(x86_64)'
40
+           	Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)'
41
+           	Metadata cache created.
42
+    ```
43
+
44
+- `tdnf check-local`
45
+    
46
+    This command resolves dependencies by using the local RPMs to help check RPMs for quality assurance before publishing them. To check RPMs with this command, you must create a local directory and place your RPMs in it. The command, which includes no options, takes the path to the local directory containing the RPMs as its argument. The command does not, however, recursively parse directories; it checks the RPMs only in the directory that you specify. 
47
+    
48
+    For example, after creating a directory named `/tmp/myrpms` and placing your RPMs in it, you can run the following command to check them:  
49
+    
50
+    	tdnf check-local /tmp/myrpms
51
+    	Checking all packages from: /tmp/myrpms
52
+    	Found 10 packages
53
+    	Check completed without issues
54
+    
55
+- `tdnf provides`
56
+    
57
+    This command finds the packages that provide the package that you supply as an argument. If you are used to a package name for another system, you can use `tdnf provides` to find the corresponding name of the package on Photon OS. 
58
+    
59
+    Example: 
60
+    
61
+    	tdnf provides docker
62
+    	docker-1.11.0-1.ph1.x86_64 : Docker
63
+    	Repo     : photon
64
+    	docker-1.11.0-1.ph1.x86_64 : Docker
65
+    	Repo     : @System
66
+
67
+    For a file, you must provide the full path. Example: 
68
+
69
+	tdnf provides /usr/include/stdio.h
70
+	glibc-devel-2.22-8.ph1.x86_64 : Header files for glibc
71
+	Repo     : photon
72
+	glibc-devel-2.22-8.ph1.x86_64 : Header files for glibc
73
+	Repo     : @System
74
+
75
+    The following example shows you how to find the package that provides a pluggable authentication module, which you might need to find if the system is mishandling passwords. 
76
+
77
+    ```
78
+    tdnf provides /etc/pam.d/system-account
79
+    	shadow-4.2.1-7.ph1.x86_64 : Programs for handling passwords in a secure way
80
+    	Repo     : photon
81
+    	shadow-4.2.1-8.ph1.x86_64 : Programs for handling passwords in a secure way
82
+    	Repo     : photon-updates
83
+    ```
84
+
85
+    For more commands see the [Photon OS Administration Guide](photon_admin/README.md).
86
+
87
+If a package that is installed is not working, try re-installing it. 
88
+Example: 
89
+    	
90
+    ```
91
+    tdnf reinstall shadow
92
+    	Reinstalling:
93
+    	shadow 	x86_64 	4.2.1-7.ph1   3.85 M
94
+    ```
0 95
new file mode 100644
... ...
@@ -0,0 +1,28 @@
0
+# Performance Issues
1
+
2
+Performance issues can be difficult to troubleshoot because so many variables play a role in overall system performance. Interpreting performance data often depends on the context and the situation. To better identify and isolate variables and to gain insight into performance data, you can use the troubleshooting tools on Photon OS to diagnose the system.  
3
+
4
+If you have no indication what the cause of a performance degradation might be, start by getting a high-level picture of the system's state. Then look for signs in the data that might point to a cause. 
5
+
6
+Use the following guidelines to gain insight into performance data:
7
+
8
+- Start with the `systemd journal`.
9
+
10
+- The `top` tool can unmask problems caused by processes or applications overconsuming CPUs, time, or RAM. If the percent of CPU utilization is consistently high with little idle time, for example, there might be a runaway process. Restart it.
11
+
12
+- The `netstat --statistics` command can identify bottlenecks causing performance issues. It lists interface statistics for different protocols.
13
+
14
+- If `top` and `netstat` reveal no errors, run the `strace ls -al` to view every system call.
15
+
16
+- The `watch` command can help dynamically monitor a command to help troubleshoot performance issues:
17
+
18
+    `watch -n0 --differences <command>`
19
+    
20
+    You can also combine `watch` with the `vmstat` command to dig deeper into statistics about virtual memory, processes, block input-output, disks, and CPU activity. Are there any bottlenecks?
21
+
22
+- You can use the `dstat` utility to see the live, running list of statistics about system resources.
23
+
24
+- The `systemd-analyze` reveals performance statistics for boot time and can help troubleshoot slow system boots and incorrect unit files.
25
+
26
+The additional tools that you select depend on the clues that your initial investigation reveals. The following tools can also help troubleshoot performance: `sysstat`, `sar`, `systemtap`, and `crash`. 
27
+
0 28
new file mode 100644
... ...
@@ -0,0 +1,27 @@
0
+# Permitting Root Login with SSH
1
+
2
+The full version of Photon OS prevents root login with SSH by default. To permit root login over SSH, open `/etc/ssh/sshd_config` with the vim text editor and set `PermitRootLogin` to `yes`. 
3
+
4
+Vim is the default text editor available in both the full and minimal versions of Photon OS. The full version also contains Nano. After you modify the SSH daemon's configuration file, you must restart the sshd daemon for the changes to take effect. Example: 
5
+
6
+	vim /etc/ssh/sshd_config
7
+
8
+	# override default of no subsystems
9
+	Subsystem       sftp    /usr/libexec/sftp-server
10
+
11
+	# Example of overriding settings on a per-user basis
12
+	#Match User anoncvs
13
+	#       X11Forwarding no
14
+	#       AllowTcpForwarding no
15
+	#       PermitTTY no
16
+	#       ForceCommand cvs server
17
+	PermitRootLogin yes
18
+	UsePAM yes
19
+
20
+Save your changes in vim and then restart the sshd daemon: 
21
+
22
+	systemctl restart sshd
23
+
24
+You can then connect to the Photon OS machine with the root account over SSH:
25
+
26
+	steve@ubuntu:~$ ssh root@198.51.100.131
0 27
new file mode 100644
... ...
@@ -0,0 +1,5 @@
0
+# Photon OS Logs
1
+
2
+On Photon OS, all the system logs except the installation logs and the cloud-init logs are written into the systemd journal. The `journalctl` command queries the contents of the systemd journal.
3
+
4
+The installation log files and the cloud-init log files reside in `/var/log`. If Photon OS is running on a virtual machine in a VMware hypervisor, the log file for the VMware tools, `vmware-vmsvc.log`, also resides in `/var/log`. 
0 5
\ No newline at end of file
1 6
new file mode 100644
... ...
@@ -0,0 +1,33 @@
0
+# Resetting a Lost Root Password
1
+
2
+Perform the following steps to rest a lost password:
3
+
4
+1. Restart the Photon OS machine or the virtual machine running Photon OS. 
5
+    
6
+    When the Photon OS splash screen appears as it restarts, type the letter `e` to go to the GNU GRUB edit menu quickly. Because Photon OS reboots so quickly, you won't have much time to type `e`. Remember that in vSphere and Workstation, you might have to give the console focus by clicking in its window before it will register input from the keyboard.
7
+
8
+Second, in the GNU GRUB edit menu, go to the end of the line that starts with `linux`, add a space, and then add the following code exactly as it appears below:
9
+
10
+	rw init=/bin/bash
11
+
12
+After you add this code, the GNU GRUB edit menu should look exactly like this:
13
+
14
+![The modified GNU GRUB edit menu](images/grub-edit-menu-changepw.png) 
15
+
16
+Now type `F10`.
17
+
18
+At the command prompt, type `passwd` and then type (and re-enter) a new root password that conforms to the password complexity rules of Photon OS. Remember the password. 
19
+
20
+Next, type the following command:
21
+
22
+	umount /
23
+
24
+Finally, type the following command. You must include the `-f` option to force a reboot; otherwise, the kernel enters a state of panic.
25
+
26
+	reboot -f
27
+
28
+This sequence of commands should look like this:
29
+
30
+![The series of commands to reset the root password](images/resetpw.png)
31
+
32
+After the Photon OS machine reboots, log in with the new root password. 
0 33
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+# The Root Account and the `sudo` and `su` Commands
1
+
2
+The *Troubleshooting Guide* assumes that you are logged in to Photon OS with the root account and running commands as root. The `sudo` program comes with the full version of Photon OS. On the minimal version, you must install `sudo` with tdnf if you want to use it. As an alternative to installing `sudo` on the minimal version, you can switch users as needed with the `su` command to run commands that require root privileges.
0 3
\ No newline at end of file
1 4
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+# Solutions to Common Problems
1
+
2
+This section describes solutions to problems that you might encounter:
3
+
4
+- [Resetting a Lost Root Password](resetting-a-lost-root-password.md)
5
+- [Fixing Permissions on Network Configuration Files](network-config-files-permissions.md)
6
+- [Permitting Root Login with SSH](permitting-root-login-with-ssh.md)
7
+- [Fixing Sendmail](fixing-sendmail.md)
0 8
new file mode 100644
... ...
@@ -0,0 +1,9 @@
0
+# Systemd and TDNF
1
+
2
+By using systemd, Photon OS adopts a contemporary Linux standard to bootstrap the user space and concurrently start services, an architecture that differs from traditional Linux systems such as SUSE Linux Enterprise Server 11.
3
+
4
+A traditional Linux system contains an initialization system called SysVinit. With SLES 11, for instance, SysVinit-style init programs control how the system starts up and shuts down. Init implements system runlevels. A SysVinit runlevel defines a state in which a process or service runs. In contrast to a SysVinit system, systemd defines no such runlevels. Instead, systemd uses a dependency tree of _targets_ to determine which services to start when.
5
+
6
+Because the systemd commands differ from those of an init.d-based Linux system, a section later in this guide illustrates how to troubleshoot by using systemctl commands instead of init.d-style commands. 
7
+
8
+Tdnf keeps the operating system as small as possible while preserving yum's robust package-management capabilities. On Photon OS, tdnf is the default package manager for installing new packages. Since troubleshooting with tdnf differs from using yum, a later section of this guide describes how to solve problems with packages and repositories by using tdnf commands.
0 9
new file mode 100644
... ...
@@ -0,0 +1,21 @@
0
+# Systemd
1
+
2
+Photon OS manages services with `systemd` and `systemctl`, its command-line utility for inspecting and controlling the system. It does not use the deprecated commands of `init.d`. 
3
+
4
+Basic system administration commands on Photon OS differ from those on operating systems that use SysVinit. Since Photon OS uses systemd instead of SysVinit, you must use systemd commands to manage services. 
5
+
6
+For example, instead of running the /etc/init.d/ssh script to stop and start the OpenSSH server on a init.d-based Linux system, you control the service by running the following systemctl commands on Photon OS: 
7
+
8
+	systemctl stop sshd
9
+	systemctl start sshd
10
+
11
+-   [Troubleshooting Services with `systemctl`](troubleshooting-services.md)
12
+-   [Analyzing System Logs with `journalctl`](analyzing-system-logs-with-journalctl.md)
13
+-   [Inspecting Services with `systemd-analyze`](inspecting-services-with-systemd-analyze.md)
14
+
15
+For an overview of systemd, see [systemd System and Service Manager](https://www.freedesktop.org/wiki/Software/systemd/) and the [man page for systemd](https://www.freedesktop.org/software/systemd/man/systemd.html). The systemd man pages are listed at [https://www.freedesktop.org/software/systemd/man/](https://www.freedesktop.org/software/systemd/man/).
16
+
17
+## 
18
+
19
+### 
20
+
0 21
new file mode 100644
... ...
@@ -0,0 +1,23 @@
0
+#  Troubleshooting Progression
1
+
2
+If you encounter a problem running an application or appliance on Photon OS and you suspect it involves the operating system, you can troubleshoot by proceeding as follows. 
3
+
4
+1. Check the services running on Photon OS:
5
+
6
+	`systemctl status`
7
+
8
+1. Check your application log files for errors. For VMware applications, see [Location of Log Files for VMware Products](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021806).)
9
+
10
+1. Check the service controller or service monitor for your application or appliance.
11
+
12
+1. Check the network interfaces and other aspects of the network service with `systemd-network` commands.
13
+
14
+1. Check the operating system log files:
15
+
16
+	`journalctl`
17
+
18
+    Next, run the following commands to view all services according to the order in which they were started:
19
+
20
+	`systemd-analyze critical-chain`
21
+
22
+1. Use the troubleshooting tool that you think is most likely to help with the issue at hand. For example, use `strace` to identify the location of the failure. 
0 23
new file mode 100644
... ...
@@ -0,0 +1,55 @@
0
+# Troubleshooting Services With 'systemctl`
1
+
2
+To view a description of all the active, loaded units, execute the systemctl command without any options or arguments: 
3
+
4
+	systemctl
5
+
6
+To see all the loaded, active, and inactive units and their description, run this command: 
7
+
8
+	systemctl --all
9
+
10
+To see all the unit files and their current status but no description, run this command: 
11
+
12
+	systemctl list-unit-files
13
+
14
+The `grep` command filters the services by a search term, a helpful tactic to recall the exact name of a unit file without looking through a long list of names. Example: 
15
+
16
+	systemctl list-unit-files | grep network
17
+	org.freedesktop.network1.busname           static
18
+	dbus-org.freedesktop.network1.service      enabled
19
+	systemd-networkd-wait-online.service       enabled
20
+	systemd-networkd.service                   enabled
21
+	systemd-networkd.socket                    enabled
22
+	network-online.target                      static
23
+	network-pre.target                         static
24
+	network.target  
25
+
26
+
27
+For example, to list all the services that you can manage on Photon OS, you run the following command instead of `ls /etc/rc.d/init.d/`: 
28
+
29
+	systemctl list-unit-files --type=service
30
+
31
+Similarly, to check whether the `sshd` service is enabled, on Photon OS you run the following command instead of `chkconfig sshd`:
32
+
33
+	systemctl is-enabled sshd
34
+
35
+The `chkconfig --list` command that shows which services are enabled for which runlevel on a SysVinit computer becomes substantially different on Photon OS because there are no runlevels, only targets: 
36
+
37
+	ls /etc/systemd/system/*.wants
38
+
39
+You can also display similar information with the following command: 
40
+
41
+	systemctl list-unit-files --type=service
42
+
43
+The following is list of some of the systemd commands that take the place of `SysVinit` commands on Photon OS: 
44
+
45
+	USE THIS SYSTEMD COMMAND 	INSTEAD OF THIS SYSVINIT COMMAND
46
+	systemctl start sshd 		service sshd start
47
+	systemctl stop sshd 		service sshd stop
48
+	systemctl restart sshd 		service sshd restart
49
+	systemctl reload sshd 		service sshd reload
50
+	systemctl condrestart sshd 	service sshd condrestart
51
+	systemctl status sshd 		service sshd status
52
+	systemctl enable sshd 		chkconfig sshd on
53
+	systemctl disable sshd 		chkconfig sshd off
54
+	systemctl daemon-reload		chkconfig sshd --add
0 55
new file mode 100644
... ...
@@ -0,0 +1,12 @@
0
+# Troubleshooting Tools
1
+
2
+Photon OS includes tools that help troubleshoot problems. These tools are installed by default on the full version of Photon OS. On the minimal version of Photon OS, you might have to install a tool before you can use it. 
3
+
4
+There is a man page on Photon OS for all the tools covered in this section. The man pages provide more information about each tool's commands, options, and output. To view a tool's man page, on the Photon OS command line, type `man` and then the name of the tool. Example: 
5
+
6
+	man strace
7
+
8
+- [Common Tools](common-tools.md)
9
+- [Default Tools](default-tools.md)
10
+- [Installing Tools Rrom Repositories](installing-tools.md)
11
+- [Linux Troubleshooting Tools](linux-troubleshooting-tools.md)
0 12
\ No newline at end of file
... ...
@@ -7,7 +7,7 @@
7 7
             "text": "PASSWORD"
8 8
         },
9 9
     "packagelist_file": "packages_ami.json",
10
-    "size": {"root": "16", "swap": "0"},
10
+    "size": {"root": "8", "swap": "0"},
11 11
     "public_key":"<ssh-key-here>",
12 12
     "postinstallscripts": [ "ami-patch.sh", "../password-expiry.sh" ],
13 13
     "additionalfiles": [
... ...
@@ -102,7 +102,7 @@ def main():
102 102
     sys.exit(0)
103 103
 
104 104
 
105
-def get_baseurl(self, conf_file):
105
+def get_baseurl(conf_file):
106 106
     with open(conf_file) as jsonFile:
107 107
         config = json.load(jsonFile)
108 108
     return config['baseurl']
... ...
@@ -168,7 +168,8 @@ def buildSourcesList(yamlDir, blackListPkgs, logger, singleFile=True):
168 168
                 sha1 = SPECS.getData().getSHA1(package, version, sourceName)
169 169
                 if sha1 is not None:
170 170
                     PullSources.get(package, sourceName, sha1, yamlSourceDir,
171
-                                    constants.getPullSourcesURLs(package), logger)
171
+                                    constants.getPullSourcesURLs(package),
172
+                                    logger)
172 173
 
173 174
             if not singleFile:
174 175
                 yamlFile = open(yamlSourceDir + "/" + ossname + "-" + version + ".yaml", "w")
... ...
@@ -361,7 +361,8 @@ class constants(object):
361 361
     def getPullSourcesURLs(packageName):
362 362
         urls=[]
363 363
         urls.append(constants.pullsourcesURL)
364
-        urls.extend(constants.extrasourcesURLs[packageName])
364
+        if packageName in constants.extrasourcesURLs:
365
+            urls.extend(constants.extrasourcesURLs[packageName])
365 366
         return urls
366 367
 
367 368
     @staticmethod
368 369
new file mode 100644
369 370
Binary files /dev/null and b/tools/examples/build_spec/simple-module/module_example.tar.xz differ
370 371
new file mode 100755
... ...
@@ -0,0 +1,4 @@
0
+#! /bin/bash
1
+
2
+WDIR=$(dirname $(readlink -m $0))
3
+$WDIR/../../../scripts/build_spec.sh $WDIR/simple-module.spec
0 4
new file mode 100644
... ...
@@ -0,0 +1,38 @@
0
+Summary:        Simple Linux module
1
+Name:           simple-module
2
+Version:        4.18.9
3
+Release:        5%{?dist}
4
+License:    	GPLv2
5
+Group:        	System Environment/Kernel
6
+Vendor:         VMware, Inc.
7
+Distribution: 	Photon
8
+Source0:        module_example.tar.xz
9
+BuildRequires:  linux-devel = 4.18.9
10
+BuildRequires:  kmod
11
+Requires:       linux = 4.18.9
12
+
13
+%description
14
+Example of building linux module for Photon OS
15
+
16
+%prep
17
+%setup -q -n module_example
18
+
19
+%build
20
+make -C `echo /usr/src/linux-headers-4.18.9*` M=`pwd` VERBOSE=1 modules %{?_smp_mflags}
21
+
22
+%install
23
+make -C `echo /usr/src/linux-headers-4.18.9*` M=`pwd` INSTALL_MOD_PATH=%{buildroot} modules_install
24
+# fix permissins to generate non empty debuginfo
25
+find %{buildroot}/lib/modules -name '*.ko' -print0 | xargs -0 chmod u+x
26
+
27
+%post
28
+/sbin/depmod -a
29
+
30
+%files
31
+%defattr(-,root,root)
32
+/lib/modules/*
33
+
34
+%changelog
35
+*   Tue Dec 04 2018 Alexey Makhalov <amakhalov@vmware.com> 4.18.9-5
36
+-   Initial build. First version
37
+
0 38
new file mode 100755
... ...
@@ -0,0 +1,146 @@
0
+#! /bin/bash
1
+
2
+# Target to Photon OS version
3
+VERSION=3
4
+
5
+# Keep running container instance alive?
6
+KEEP_SANDBOX_AFTER_FAILURE=1
7
+
8
+# Draw spinner while waiting
9
+DRAW_SPINNER=1
10
+
11
+test "$#" -ne 1 && echo "Usage: $0 spec-file-to-build.spec" && exit 1
12
+
13
+CONTAINER=build_spec
14
+SPECPATH=$(readlink -m $1)
15
+SPECFILE=$(basename $SPECPATH)
16
+SPECDIR=$(dirname $SPECPATH)
17
+mkdir -p $SPECDIR/stage/LOGS
18
+LOGFILE=$SPECDIR/stage/LOGS/$(basename $SPECFILE .spec).log
19
+
20
+# use &3 for user output
21
+exec 3>&1
22
+# redirect &1 and &2 to the log file
23
+exec &>$LOGFILE
24
+
25
+function wait_for_result() {
26
+  local pid=$!
27
+  if [ "$DRAW_SPINNER" -eq 1 ]; then
28
+    local spin='-\|/'
29
+    local i=0
30
+    echo -n " " >&3
31
+    while [ -d /proc/$pid ]; do
32
+      sleep .25
33
+      echo -ne "\b${spin:i++%4:1}" >&3
34
+    done
35
+    echo -ne "\b" >&3
36
+  fi
37
+  wait $pid
38
+  if [ $? -eq 0 ]; then
39
+    echo -e "\033[0;32mOK\033[0m" >&3
40
+  else
41
+    echo -e "\033[0;31mFAIL\033[0m" >&3
42
+    fail
43
+  fi
44
+}
45
+
46
+function run() {
47
+  echo -ne "\t$1 " >&3
48
+  shift
49
+  echo "run: $@"
50
+  $@ &
51
+  wait_for_result
52
+}
53
+
54
+function in_sandbox() {
55
+  docker exec $CONTAINER "$@"
56
+}
57
+
58
+function create_sandbox() {
59
+  docker ps -f "name=$CONTAINER" && docker rm -f $CONTAINER
60
+  docker inspect --format='{{.Created}}' photon_build_spec:$VERSION.0
61
+  local status=$?
62
+  local cdate=$(date --date=`docker inspect --format='{{.Created}}' photon_build_spec:$VERSION.0` '+%s')
63
+  # image exists?
64
+  if [ $status -eq 0 ]; then
65
+    local vdate=$((`date '+%s'` - 1209600))
66
+    # image is less then 2 weeks
67
+    if [ $cdate -gt $vdate ]; then
68
+      # use this image
69
+      run "Use local build template image" docker run -d --name $CONTAINER --network="host" photon_build_spec:$VERSION.0 tail -f /dev/null
70
+      return 0
71
+    else
72
+      # remove old image
73
+      docker image rm photon_build_spec:$VERSION.0
74
+    fi
75
+  fi
76
+
77
+
78
+  run "Pull photon image" docker run -d --name $CONTAINER --network="host" photon:$VERSION.0 tail -f /dev/null
79
+
80
+  # replace toybox with coreutils and install default build tools
81
+  run "Replace toybox with coreutils" in_sandbox tdnf remove -y toybox
82
+  run "Install default build tools" in_sandbox tdnf install -y rpm-build build-essential tar sed findutils file gzip patch
83
+
84
+  run "Create build template image for future use" docker commit `docker ps -q -f "name=$CONTAINER"` photon_build_spec:$VERSION.0
85
+}
86
+
87
+function prepare_buildenv() {
88
+  run "Create source folder" in_sandbox mkdir -p /usr/src/photon/SOURCES
89
+  run "Copy sources from $SPECDIR" docker cp $SPECDIR/. $CONTAINER:/usr/src/photon/SOURCES
90
+  local br=`sed -n 's/BuildRequires://p' $SPECPATH | sed 's/ \(<\|\)= /=/g;s/>\(=\|\) [^ ]*//g'`
91
+  if [ "$br" != "" ]; then
92
+    run "Install build requirements" in_sandbox tdnf install -y $br 
93
+  fi
94
+}
95
+
96
+function build() {
97
+  echo -ne "\tRun rpmbuild " >&3
98
+  docker exec $CONTAINER rpmbuild -bb --define "dist .ph$VERSION" /usr/src/photon/SOURCES/$SPECFILE &
99
+  wait_for_result
100
+}
101
+
102
+function get_rpms() {
103
+  run "Copy RPMS" docker cp $CONTAINER:/usr/src/photon/RPMS $SPECDIR/stage
104
+  run "Copy SRPMS" docker cp $CONTAINER:/usr/src/photon/SRPMS $SPECDIR/stage
105
+}
106
+
107
+function destroy_sandbox() {
108
+  run "Stop container" docker kill $CONTAINER
109
+  run "Remove container" docker rm $CONTAINER
110
+}
111
+
112
+function clean_up() {
113
+  echo "Post clean up" >&3
114
+  docker ps -f "name=$CONTAINER" &>/dev/null && destroy_sandbox &>/dev/null
115
+}
116
+
117
+function fail() {
118
+  test "$KEEP_SANDBOX_AFTER_FAILURE" -ne 1 && clean_up || \
119
+    echo "Sandbox is preserved for analisys. Use 'docker exec -it $CONTAINER /bin/bash'" >&3
120
+  echo "Build failed. See $LOGFILE for full output" >&3
121
+  echo -e "\033[1;33m" >&3
122
+  tail $LOGFILE >&3
123
+  echo -e "\033[0m" >&3
124
+  exit 1
125
+}
126
+
127
+trap clean_up SIGINT SIGTERM
128
+
129
+echo "1. Create sandbox" >&3
130
+create_sandbox
131
+
132
+echo "2. Prepare build environment" >&3
133
+prepare_buildenv
134
+
135
+echo "3. Build" >&3
136
+build
137
+
138
+echo "4. Get binaries" >&3
139
+get_rpms
140
+
141
+echo "5. Destroy sandbox" >&3
142
+destroy_sandbox
143
+
144
+echo "Build completed. RPMS are in '$SPECDIR/stage' folder" >&3
145
+