<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Red Hat &#8211; Made For Cloud</title>
	<atom:link href="https://madeforcloud.com/category/red-hat/feed/" rel="self" type="application/rss+xml" />
	<link>https://madeforcloud.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sat, 27 Jan 2024 00:10:42 +0000</lastBuildDate>
	<language>en-AU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Fatal glibc error: CPU does not support x86-64-v2</title>
		<link>https://madeforcloud.com/2024/01/27/fatal-glibc-error-cpu-does-not-support-x86-64-v2/</link>
					<comments>https://madeforcloud.com/2024/01/27/fatal-glibc-error-cpu-does-not-support-x86-64-v2/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sat, 27 Jan 2024 00:10:42 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[AWX]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=163</guid>

					<description><![CDATA[I&#8217;m just writing this down in case anyone has a similar issue. As per Building Red Hat Enterprise Linux 9 for the x86-64-v2 microarchitecture level &#124; Red Hat Developer, back in 2020, AMD, Intel, Red Hat, and SUSE collaborated to define three x86-64 microarchitecture levels on top of the x86-64 baseline. The three microarchitectures group together CPU&#8230;<p><a class="more-link" href="https://madeforcloud.com/2024/01/27/fatal-glibc-error-cpu-does-not-support-x86-64-v2/" title="Continue reading &#8216;Fatal glibc error: CPU does not support x86-64-v2&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;m just writing this down in case anyone has a similar issue.</p>



<p>As per <a href="https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level">Building Red Hat Enterprise Linux 9 for the x86-64-v2 microarchitecture level | Red Hat Developer</a>, back in 2020, AMD, Intel, Red Hat, and SUSE <a href="https://lists.llvm.org/pipermail/llvm-dev/2020-July/143289.html">collaborated</a> to define three x86-64 microarchitecture levels on top of the x86-64 baseline. The three microarchitectures group together CPU features roughly based on hardware release dates:</p>



<ul class="wp-block-list">
<li><strong>x86-64-v2</strong>&nbsp;brings support (among other things) for vector instructions up to Streaming SIMD Extensions 4.2 (SSE4.2)&nbsp; and Supplemental Streaming SIMD Extensions 3 (SSSE3), the POPCNT instruction (useful for data analysis and bit-fiddling in some data structures), and CMPXCHG16B (a two-word compare-and-swap instruction useful for concurrent algorithms).</li>



<li><strong>x86-64-v3</strong>&nbsp;adds vector instructions up to AVX2, MOVBE (for big-endian data access), and additional bit-manipulation instructions.</li>



<li><strong>x86-64-v4</strong>&nbsp;includes vector instructions from some of the AVX-512 variants.</li>
</ul>



<p>This is a great idea and goal except when you have perfectly good old hardware that, while end-of-life is still working and you find it doesn&#8217;t support the new compile target.</p>



<p>This nice little awk script from the fine folks over at <a href="https://unix.stackexchange.com/questions/631217/how-do-i-check-if-my-cpu-supports-x86-64-v2">stackexchange</a> will show you what microarchitecture your cpu supports by looking at the /proc/cpuinfo flags. I&#8217;ve included a local copy here and as you can see it&#8217;s pretty simple.</p>



<pre class="wp-block-code"><code>#!/usr/bin/awk -f

BEGIN {
    while (!/flags/) if (getline &lt; "/proc/cpuinfo" != 1) exit 1
    if (/lm/&amp;&amp;/cmov/&amp;&amp;/cx8/&amp;&amp;/fpu/&amp;&amp;/fxsr/&amp;&amp;/mmx/&amp;&amp;/syscall/&amp;&amp;/sse2/) level = 1
    if (level == 1 &amp;&amp; /cx16/&amp;&amp;/lahf/&amp;&amp;/popcnt/&amp;&amp;/sse4_1/&amp;&amp;/sse4_2/&amp;&amp;/ssse3/) level = 2
    if (level == 2 &amp;&amp; /avx/&amp;&amp;/avx2/&amp;&amp;/bmi1/&amp;&amp;/bmi2/&amp;&amp;/f16c/&amp;&amp;/fma/&amp;&amp;/abm/&amp;&amp;/movbe/&amp;&amp;/xsave/) level = 3
    if (level == 3 &amp;&amp; /avx512f/&amp;&amp;/avx512bw/&amp;&amp;/avx512cd/&amp;&amp;/avx512dq/&amp;&amp;/avx512vl/) level = 4
    if (level > 0) { print "CPU supports x86-64-v" level; exit level + 1 }
    exit 1
}</code></pre>



<p>Running the awk script on my test system reveals :</p>



<pre class="wp-block-code"><code>$ ./testarch.awk
CPU supports x86-64-v1</code></pre>



<p>The implications of this are annoying for me. I was trying to get <a href="https://github.com/ansible/awx">awx </a>to work on my little play system, but as the awx container is based on centos9 and compiled requiring at least x86-64-v2 then the awx container just wont start &#8211; yes I know there is more to awx than just this container, but it highlights the point nicely in the following command.</p>



<pre class="wp-block-code"><code>$ docker run --rm  ghcr.io/ansible/awx:latest
Fatal glibc error: CPU does not support x86-64-v2</code></pre>



<p>This seems to have started somewhere after <a href="https://github.com/ansible/awx/issues/11879">awx release 19.5.0</a> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2024/01/27/fatal-glibc-error-cpu-does-not-support-x86-64-v2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Converting from CentOS 8 to AlmaLinux 8</title>
		<link>https://madeforcloud.com/2022/07/12/converting-from-centos-8-to-almalinux-8/</link>
					<comments>https://madeforcloud.com/2022/07/12/converting-from-centos-8-to-almalinux-8/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Tue, 12 Jul 2022 05:06:15 +0000</pubDate>
				<category><![CDATA[AlmaLinux]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">http://168.138.6.194/?p=143</guid>

					<description><![CDATA[This is more so that I can remember. You need to get to the latest update level on the CentOS systems. If the systems have been unloved you will likely find that they can no longer access the repos servers. Change the baseurl to http://vault.centos.org/, comment out the mirrorlist as per this image. You&#8217;ll need&#8230;<p><a class="more-link" href="https://madeforcloud.com/2022/07/12/converting-from-centos-8-to-almalinux-8/" title="Continue reading &#8216;Converting from CentOS 8 to AlmaLinux 8&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>This is more so that I can remember.</p>



<p></p>



<p>You need to get to the latest update level on the CentOS systems.  If the systems have been unloved you will likely find that they can no longer access the repos servers.</p>



<p>Change the baseurl to http://vault.centos.org/, comment out the mirrorlist as per this image.</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="387" src="http://168.138.6.194/wp-content/uploads/2022/07/Screenshot-2022-07-12-144956-1024x387.png" alt="" class="wp-image-144" srcset="https://madeforcloud.com/wp-content/uploads/2022/07/Screenshot-2022-07-12-144956-1024x387.png 1024w, https://madeforcloud.com/wp-content/uploads/2022/07/Screenshot-2022-07-12-144956-300x113.png 300w, https://madeforcloud.com/wp-content/uploads/2022/07/Screenshot-2022-07-12-144956-768x290.png 768w, https://madeforcloud.com/wp-content/uploads/2022/07/Screenshot-2022-07-12-144956.png 1087w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>You&#8217;ll need to do this in at least :</p>



<pre class="wp-block-code"><code>/etc/yum.repos.d/CentOS-Linux-BaseOS.repo
/etc/yum.repos.d/CentOS-Linux-AppStream.repo</code></pre>



<p>Then you can perform the required upgrade :</p>



<pre class="wp-block-code"><code>dnf update
dnf upgrade</code></pre>



<p>Then I suggest re-booting and you can then perform the AlmaLinux migration by :</p>



<pre class="wp-block-code"><code>curl -O https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
bash almalinux-deploy.sh
</code></pre>



<p>Then the following should show that you&#8217;ve converted OK</p>



<pre class="wp-block-code"><code>cat /etc/os-release</code></pre>



<pre class="wp-block-code"><code>cat /etc/os-release
NAME="AlmaLinux"
VERSION="8.6 (Sky Tiger)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.6 (Sky Tiger)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:8::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.6"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.6"</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2022/07/12/converting-from-centos-8-to-almalinux-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting started with Powershell on Linux</title>
		<link>https://madeforcloud.com/2021/11/26/getting-started-with-powershell-on-linux/</link>
					<comments>https://madeforcloud.com/2021/11/26/getting-started-with-powershell-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Fri, 26 Nov 2021 06:16:12 +0000</pubDate>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=125</guid>

					<description><![CDATA[First of all, simply don&#8217;t believe anyone who says that it&#8217;s hard to install Powershell on Linux. Installing on a Red Hat clone (eg. Centos 8) This wont take long. That&#8217;s it Installing on Ubuntu 20.04 and above Again, that&#8217;s it. In both cases you can then launch the shell via :]]></description>
										<content:encoded><![CDATA[
<p>First of all, simply don&#8217;t believe anyone who says that it&#8217;s hard to install Powershell on Linux.</p>



<h2 class="wp-block-heading">Installing on a Red Hat clone (eg. Centos 8)</h2>



<p>This wont take long.</p>



<p></p>



<pre class="wp-block-code"><code>curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
sudo yum install -y powershell</code></pre>



<p>That&#8217;s it</p>



<h2 class="wp-block-heading">Installing on Ubuntu 20.04 and above</h2>



<pre class="wp-block-code"><code>sudo snap install powershell --classic</code></pre>



<p>Again, that&#8217;s it.</p>



<p>In both cases you can then launch the shell  via :</p>



<pre class="wp-block-code"><code>$ pwsh
PowerShell 7.2.0
Copyright (c) Microsoft Corporation.

https:&#47;&#47;aka.ms/powershell
Type 'help' to get help.

PS /home/gocallag> </code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2021/11/26/getting-started-with-powershell-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Converting Centos 8 to Centos 8 Stream &#8211; because you know you want to!</title>
		<link>https://madeforcloud.com/2021/01/27/converting-centos-8-to-centos-8-stream-because-you-know-you-want-to/</link>
					<comments>https://madeforcloud.com/2021/01/27/converting-centos-8-to-centos-8-stream-because-you-know-you-want-to/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Wed, 27 Jan 2021 09:21:41 +0000</pubDate>
				<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=121</guid>

					<description><![CDATA[This is more so I can remember, but it&#8217;s basically 3 steps. Apply all the latest patches to your Centos 8 systems Then install the Centos 8 stream repo&#8217;s Then swap from Centos Linux repo&#8217;s to Centos stream repo&#8217;s Then do a distro sync to get everything back in sync You should be golden at&#8230;<p><a class="more-link" href="https://madeforcloud.com/2021/01/27/converting-centos-8-to-centos-8-stream-because-you-know-you-want-to/" title="Continue reading &#8216;Converting Centos 8 to Centos 8 Stream &#8211; because you know you want to!&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>This is more so I can remember, but it&#8217;s basically 3 steps.</p>



<p>Apply all the latest patches to your Centos 8 systems</p>



<pre class="wp-block-code"><code>dnf update -y
reboot</code></pre>



<p>Then install the Centos 8 stream repo&#8217;s</p>



<pre class="wp-block-code"><code>dnf install -y centos-release-stream</code></pre>



<p>Then swap from Centos Linux repo&#8217;s to Centos stream repo&#8217;s</p>



<pre class="wp-block-code"><code>dnf swap -y centos-{linux,stream}-repos</code></pre>



<p>Then do a distro sync to get everything back in sync</p>



<pre class="wp-block-code"><code>dnf distro-sync -y
reboot</code></pre>



<p>You should be golden at this point</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2021/01/27/converting-centos-8-to-centos-8-stream-because-you-know-you-want-to/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Powercli via RHEL7 UBI container images</title>
		<link>https://madeforcloud.com/2020/01/01/powercli-via-rhel7-ubi-container-images/</link>
					<comments>https://madeforcloud.com/2020/01/01/powercli-via-rhel7-ubi-container-images/#respond</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Wed, 01 Jan 2020 10:47:23 +0000</pubDate>
				<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Uncategorised]]></category>
		<category><![CDATA[vRealize]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=91</guid>

					<description><![CDATA[So yes, that is quite a specific title for a blog post. The path leading to it wasn&#8217;t as succinct, but it was an enjoyable journey. Firstly, VMware provides a fine Powercli container built on top of Photon OS , but being me I thought Hey I wonder if I can get the same thing&#8230;<p><a class="more-link" href="https://madeforcloud.com/2020/01/01/powercli-via-rhel7-ubi-container-images/" title="Continue reading &#8216;Powercli via RHEL7 UBI container images&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>So yes,  that is quite a specific title for a blog post.  The path leading to it wasn&#8217;t as succinct, but it was an enjoyable journey.</p>



<p>Firstly,  VMware provides a fine <a href="https://github.com/vmware/powerclicore">Powercli container </a>built on top of <a href="https://vmware.github.io/photon/">Photon OS </a>, but being me I thought <strong>Hey I wonder if I can get the same thing with a Red Hat Universal Base Image (UBI)? </strong>  And so, my journey began.</p>



<p>I decided i&#8217;d use the VMware Dockerfile as the starting point, but I want to build it using <a href="https://buildah.io/">buildah </a>and run it using <a href="https://podman.io/">podman </a>&#8211; because I&#8217;d like to know (you can see a pattern here) .</p>



<p>The original Dockerfile is <a href="https://github.com/vmware/powerclicore/blob/master/Dockerfile">accessible here</a>, or here&#8217;s a local copy.</p>



<pre class="wp-block-code"><code>FROM photon:3.0
  
LABEL authors="renoufa@vmware.com,jaker@vmware.com"

ENV TERM linux

WORKDIR /root

# Set terminal. If we don't do this, weird readline things happen.
RUN echo "/usr/bin/pwsh" >> /etc/shells &amp;&amp; \
    echo "/bin/pwsh" >> /etc/shells &amp;&amp; \
    tdnf install -y powershell-6.2.3-1.ph3 unzip &amp;&amp; \
    pwsh -c "Set-PSRepository -Name PSGallery -InstallationPolicy Trusted" &amp;&amp; \
    pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module VMware.PowerCLI -RequiredVersion 11.5.0.14912921" &amp;&amp; \
    pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module PowerNSX -RequiredVersion 3.0.1174" &amp;&amp; \
    pwsh -c "\$ProgressPreference = \"SilentlyContinue\"; Install-Module PowervRA -RequiredVersion 3.6.0" &amp;&amp; \
    curl -o ./PowerCLI-Example-Scripts.zip -J -L https://github.com/vmware/PowerCLI-Example-Scripts/archive/03272c1d2db26a525b31c930e3bf3d20d34468e0.zip &amp;&amp; \
    unzip PowerCLI-Example-Scripts.zip &amp;&amp; \
    rm -f PowerCLI-Example-Scripts.zip &amp;&amp; \
    mv ./PowerCLI-Example-Scripts-* ./PowerCLI-Example-Scripts &amp;&amp; \
    mv ./PowerCLI-Example-Scripts/Modules/* /usr/lib/powershell/Modules/ &amp;&amp; \
    find / -name "net45" | xargs rm -rf &amp;&amp; \
    tdnf erase -y unzip &amp;&amp; \
    tdnf clean all


CMD &#91;"/bin/pwsh"]</code></pre>



<p>I&#8217;ve made a few changes,  some cosmetic due to the way I like to layout my docker file, but the outcome is similar.   My Dockerfile is below or you can find it over at my github account.  Using the default RHEL7 UBI (sadly Microsoft don&#8217;t have powershell for RHEL8 as yet) I was able to build the image at around 567 Mb, whereas the Photon OS image is around 362 Mb.   Not a bad result given how little effort (none) i&#8217;ve put into making it as small as possible.</p>



<pre class="wp-block-code"><code>FROM registry.access.redhat.com/ubi7/ubi:latest

LABEL authors="geoffocallaghan@gmail.com"

WORKDIR /root

RUN curl https://packages.microsoft.com/config/rhel/7/prod.repo -o /etc/yum.repos.d/microsoft.repo &amp;&amp; yum install -y powershell  unzip
RUN pwsh -c 'Set-PSRepository -Name PSGallery -InstallationPolicy Trusted; \
             $ProgressPreference = "SilentlyContinue"; \
             Install-Module VMware.PowerCLI -RequiredVersion 11.5.0.14912921; \
             Install-Module PowerNSX -RequiredVersion 3.0.1174; \
             Install-Module PowervRA -RequiredVersion 3.6.0'
RUN curl -o ./PowerCLI-Example-Scripts.zip -J -L https://github.com/vmware/PowerCLI-Example-Scripts/archive/03272c1d2db26a525b31c930e3bf3d20d34468e0.zip \
    &amp;&amp; unzip PowerCLI-Example-Scripts.zip \
    &amp;&amp; rm -f PowerCLI-Example-Scripts.zip \
    &amp;&amp; mv ./PowerCLI-Example-Scripts-* ./PowerCLI-Example-Scripts \
    &amp;&amp; mv ./PowerCLI-Example-Scripts/Modules/* /opt/microsoft/powershell/6/Modules/ \
    &amp;&amp; find / -name "net45" | xargs rm -rf


CMD &#91;"/bin/pwsh"]</code></pre>



<p>As you can see in the Dockerfile, i&#8217;m simply installing powershell from the microsoft repository on top of the RHEL7 UBI image and then (via powershell) installed the PowerCLI, PowerNSX and PowervRA modules from the upstream powershell gallery.</p>



<p>Building it with <strong>buildah</strong> is trivial.</p>



<pre class="wp-block-code"><code>buildah build-using-dockerfile -t rcli  .</code></pre>



<p>And to run it via podman (trivial example)</p>



<pre class="wp-block-code"><code>&#91;gocallag@orac8 rhel7]$ podman run -it rcli pwsh
PowerShell 6.2.3
Copyright (c) Microsoft Corporation. All rights reserved.

https:&#47;&#47;aka.ms/pscore6-docs
Type 'help' to get help.

PS /root> Get-VM   # plus a couple of tabs to force auto-completion of the command 
Get-VM                                       Get-VmfsDatastoreInfo                        Get-VMHostPatch
Get-VMByToolsInfo                            Get-VMGuest                                  Get-VMHostPciDevice
Get-VMCCommand                               Get-VMHost                                   Get-VMHostProfile
Get-VMCEdge                                  Get-VMHostAccount                            Get-VMHostProfileImageCacheConfiguration
Get-VMCEdgeNic                               Get-VMHostAdvancedConfiguration              Get-VMHostProfileRequiredInput
Get-VMCEdgeNicStat                           Get-VMHostAttributes                         Get-VMHostProfileStorageDeviceConfiguration
Get-VMCEdgeStatus                            Get-VMHostAuthentication                     Get-VMHostProfileUserConfiguration
Get-VMCEdgeUplinkStat                        Get-VMHostAvailableTimeZone                  Get-VMHostProfileVmPortGroupConfiguration
Get-VMCFirewallRule                          Get-VMHostBirthday                           Get-VMHostRoute
Get-VMCLogicalNetwork                        Get-VMHostDiagnosticPartition                Get-VMHostService
Get-VMCOrg                                   Get-VMHostDisk                               Get-VMHostSnmp
Get-VMCPSettings                             Get-VMHostDiskPartition                      Get-VMHostStartPolicy
Get-VMCSDDC                                  Get-VMHostFirewallDefaultPolicy              Get-VMHostStorage
Get-VMCSDDCCluster                           Get-VMHostFirewallException                  Get-VMHostSysLogServer
Get-VMCSDDCDefaultCredential                 Get-VMHostFirmware                           Get-VMmaxIOPS
Get-VmcSddcNetworkService                    Get-VMHostFirmwareVersion                    Get-VMQuestion
Get-VMCSDDCPublicIP                          Get-VMHostHardware                           Get-VMResourceConfiguration
Get-VMCSDDCVersion                           Get-VMHostHba                                Get-VMStartPolicy
Get-VmcService                               Get-VMHostImageProfile                       Get-VMToolsGuestInfo
Get-VMCTask                                  Get-VMHostMatchingRules                      Get-VMToolsInfo
Get-VMCVMHost                                Get-VMHostModule                             Get-VMToolsInstallLastError
Get-VMEncryptionInfo                         Get-VMHostNetwork                            Get-VMToolsUpgradePolicy
Get-VMEvcMode                                Get-VMHostNetworkAdapter
Get-VmfsDatastoreIncrease                    Get-VMHostNtpServer</code></pre>



<p>You&#8217;re <s>likely,</s>    <s>possibly,</s>   most likely not wondering if I have anything planned for this container.   The answer is yes, but it will be the subject of later posts.  I&#8217;m a big fan of the ability to run Powercli via powershell on linux, and doing it via a container is a very neat packaging solution.   Sure,  i&#8217;ve could&#8217;ve used the VMware container (kudos to them for creating it), but I now know more than I did this morning and that&#8217;s the result I was aiming for.</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2020/01/01/powercli-via-rhel7-ubi-container-images/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure Credentials for Ansible</title>
		<link>https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/</link>
					<comments>https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/#comments</comments>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 24 Nov 2019 03:42:16 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">https://madeforcloud.com/?p=72</guid>

					<description><![CDATA[So, you need Ansible to connect to Azure. Congrats, Ansible is awesome for managing Azure resources. The Ansible team has already put together a scenario on how to integrate Ansible with Azure over at https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html The section &#8216;Authenticating with Azure&#8216; sounds like the right place, but you can&#8217;t use your AD username / password from&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/" title="Continue reading &#8216;Azure Credentials for Ansible&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>So, you need Ansible to connect to Azure.   Congrats,  Ansible is awesome for managing Azure resources.   The Ansible team has already put together a scenario on how to integrate Ansible with Azure over at <a href="https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html">https://docs.ansible.com/ansible/latest/scenario_guides/guide_azure.html</a>   </p>



<p>The section &#8216;<strong>Authenticating with Azure</strong>&#8216; sounds like the right place, but you can&#8217;t use your AD username / password from Ansible because you turned on 2FA &#8211;  You turned it on RIGHT?  So the option left to you is to create a Service Principal (SP).</p>



<p><strong>Note:  having 2FA on your account is what you should be doing, so don&#8217;t turn it off.</strong></p>



<p>It&#8217;s quite simple to create a credential for Ansible to use when connecting to Azure.  Simply, fire up the Cloud Shell  (awesome feature BTW Microsoft) and create a Service Principal (SP).</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2019/11/AzureCloudShell-1024x133.png" alt="" class="wp-image-73"/></figure>



<p>But <span style="text-decoration: underline;">Hang On</span>,  what is a Service Principal?  The Ansible guide refers you to the Azure documentation over at <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal">https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal</a>  which you will read, and if you&#8217;re like me,  you&#8217;ll wonder what you actually just read.   Have no fear.  As I mentioned above you can use a simple Azure CLI command (via the Cloud Shell you just started) and create the Service Principal.     Think of the Service Principal as a credential an application (in this case Ansible) can use to access the Azure service(s).  </p>



<pre class="wp-block-code"><code>geoff@Azure:~$ az ad sp create-for-rbac --name svc-ansible-azure  # (optional if not specified one will be generated)  --password 'ALovelyComplexPasswor@'
Changing "svc-ansible-azure" to a valid URI of "http://svc-ansible-azure", which is the required format used for service principal names
Creating a role assignment under the scope of "/subscriptions/88888888-4444-4444-4444-cccccccccccc"
  Retrying role assignment creation: 1/36
  Retrying role assignment creation: 2/36
{
  "appId": "appid888-4444-4444-4444-cccccccccccc",
  "displayName": "svc-ansible-azure",
  "name": "http://svc-ansible-azure",
  "password": "password-4444-4444-4444-cccccccccccc",
  "tenant": "tenant88-4444-4444-4444-cccccccccccc"
}
geoff@Azure:~$</code></pre>



<p>If you want to see what that command just did in the Azure portal, head over to the Azure Active Directory -> App registrations blade.</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2019/11/aad.png" alt="" class="wp-image-74"/></figure>



<p>and then you can see the Service Principal you just created.</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://madeforcloud.com/wp-content/uploads/2019/11/appregistrations.png" alt="" class="wp-image-75"/></figure>



<p>So what do you do with the new credential.</p>



<p>The Ansible Azure scenario guide has a section on what to do, however, it&#8217;s a bit too vague for me.</p>



<h4 class="wp-block-heading">Using Environment Variables</h4>



<p>To pass service principal credentials via the environment, define the following variables:</p>



<ul class="wp-block-list"><li>AZURE_CLIENT_ID</li><li>AZURE_SECRET</li><li>AZURE_SUBSCRIPTION_ID</li><li>AZURE_TENANT</li></ul>



<p>Azure has given me :</p>



<p>&#8220;appId&#8221;: &#8220;appid888-4444-4444-4444-cccccccccccc&#8221;,<br>&#8220;displayName&#8221;: &#8220;svc-ansible-azure&#8221;,<br>&#8220;name&#8221;: &#8220;http://svc-ansible-azure&#8221;,<br>&#8220;password&#8221;: &#8220;password-4444-4444-4444-cccccccccccc&#8221;,<br>&#8220;tenant&#8221;: &#8220;tenant88-4444-4444-4444-cccccccccccc&#8221;</p>



<p>For your sanity,  <br>AZURE_CLIENT_ID ==&gt; appId<br>AZURE_SECRET ==&gt; password<br>AZURE_TENANT ==&gt; tenant</p>



<p>The remaining item, AZURE_SUBSCRIPTION_ID  is exactly that,  you can also get from the Cloud Shell as follows</p>



<pre class="wp-block-code"><code>geoff@Azure:~$ az account list
[
  {
    "cloudName": "AzureCloud",
    "id": "subscrip-4444-4444-4444-cccccccccccc
    "isDefault": true,
.
.
.</code></pre>



<p>In this case AZURE_SUBSCRIPTION_ID ==> id ,   whichever id in your account that is valid for your use case.</p>



<p>If you want to add these credentials into Ansible Tower, simply create a Credential of type <strong>Microsoft Azure Resource Manager </strong>and use the values you&#8217;ve deduced above.   Ansible Tower will automatically translate them into Environment Variables for your Tower template execution.</p>



<p>Enjoy Ansible and Azure!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://madeforcloud.com/2019/11/24/azure-credentials-for-ansible/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>ESXi 6+ PXE Boot from Centos 8 &#8211; Nope?</title>
		<link>https://madeforcloud.com/2019/11/04/esxi-6-pxe-boot-from-centos-8-nope/</link>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Mon, 04 Nov 2019 01:31:45 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=51</guid>

					<description><![CDATA[I was rebuilding some Lab ESXi physical hosts, but also thought i&#8217;d upgrade my &#8216;builder&#8217; system to Centos 8. My builder system uses a bunch of Ansible playbooks to create the necessary DHCP, TFTP etc configuration to support PXE booting multiple OS types &#8211; including ESXi 6.5/6.7. I started with test builds of Centos 7/8&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/11/04/esxi-6-pxe-boot-from-centos-8-nope/" title="Continue reading &#8216;ESXi 6+ PXE Boot from Centos 8 &#8211; Nope?&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>I was rebuilding some Lab ESXi physical hosts, but also thought i&#8217;d upgrade my &#8216;builder&#8217; system to Centos 8.   My builder system uses a bunch of Ansible playbooks to create the necessary DHCP, TFTP etc configuration to support PXE booting multiple OS types &#8211; including ESXi 6.5/6.7.</p>



<p>I started with test builds of Centos 7/8 using my now Centos 8 build server and it was all fine.  </p>



<p>However&#8230;..  when I tried to build ESXi 6.5+ the TFTP delivered the ESXi mboot.c32 file to the host (via syslinux 6.04 which is new to Centos 8) but it couldn&#8217;t be loaded.   After several hours of frustration I tried downgrading to the syslinux 3.86 version mentioned in <a href="https://www.vmware.com/techpapers/2015/installing-vmware-esxi-6.0-using-pxe-10508.html">https://www.vmware.com/techpapers/2015/installing-vmware-esxi-6.0-using-pxe-10508.html</a> .  Sadly you can&#8217;t install that version on Centos 8 without considerable grief.   </p>



<p>I was able to install syslinux 4.05 on Centos 8 and lo and behold the build process works.   Clearly something in syslinux 6 doesn&#8217;t like PXE booting ESXi.   I&#8217;m not sure what yet, but hopefully this blog post at least gives people a workaround to a frustrating problem.</p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Centos 8 &#8211; where did Lynx go ?</title>
		<link>https://madeforcloud.com/2019/11/04/centos-8-where-did-lynx-go/</link>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 03 Nov 2019 23:55:04 +0000</pubDate>
				<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=47</guid>

					<description><![CDATA[It&#8217;s always fun when you build a system at a new OS level and things have moved around. But having Lynx disappear made me a #sadpanda. Fortunately, it wasn&#8217;t far away &#8211; it&#8217;s been moved to the PowerTools repository which you can enable with a quick: Then you can install my favourite little text based&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/11/04/centos-8-where-did-lynx-go/" title="Continue reading &#8216;Centos 8 &#8211; where did Lynx go ?&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>It&#8217;s always fun when you build a system at a new OS level and things have moved around.  But having Lynx disappear made me a #sadpanda.</p>



<p>Fortunately, it wasn&#8217;t far away &#8211; it&#8217;s been moved to the PowerTools repository which you can enable with a quick:</p>



<pre class="wp-block-code"><code>dnf config-manager --set-enabled PowerTools</code></pre>



<p> Then you can install my favourite  little text based web browser again.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Hyper-V meet RHEL8 &#8211; screen resolution</title>
		<link>https://madeforcloud.com/2019/10/31/hyper-v-meet-rhel8-screen-resolution/</link>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Wed, 30 Oct 2019 23:44:29 +0000</pubDate>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=23</guid>

					<description><![CDATA[I&#8217;m running Hyper-V on my laptop and I&#8217;m also doing work with RHEL 8 desktops. Alas, the default screen resolution you get is the rather odd 1152&#215;864. In order to make this more reasonable, such as the 1920&#215;1080 full screen resolution on my laptop you have to set the hyper-v framebuffer at boot time. You&#8217;ll&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/10/31/hyper-v-meet-rhel8-screen-resolution/" title="Continue reading &#8216;Hyper-V meet RHEL8 &#8211; screen resolution&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>I&#8217;m running Hyper-V on my laptop and I&#8217;m also doing work with RHEL 8 desktops.  Alas,  the default screen resolution you get is the rather odd 1152&#215;864.</p>



<p>In order to make this more reasonable, such as the 1920&#215;1080 full screen resolution on my laptop you have to set the hyper-v framebuffer at boot time.</p>



<pre class="wp-block-code"><code>sudo grubby --update-kernel=ALL --args="video=hyperv_fb:1920x1080"</code></pre>



<p>You&#8217;ll likely need to do this after each kernel update.  </p>



<p>May the full screen be with you.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Ansible Tower &#8211; Local_Action + Sudo ?</title>
		<link>https://madeforcloud.com/2019/10/27/ansible-tower-local_action-sudo/</link>
		
		<dc:creator><![CDATA[gocallag]]></dc:creator>
		<pubDate>Sun, 27 Oct 2019 01:04:20 +0000</pubDate>
				<category><![CDATA[Ansible]]></category>
		<category><![CDATA[Ansible Tower]]></category>
		<category><![CDATA[Red Hat]]></category>
		<guid isPermaLink="false">http://madeforcloud.com/?p=15</guid>

					<description><![CDATA[There are many times when you run an Ansible playbook through Ansible Tower and you have to become a privileged user on the target system. This is business as usual for Ansible and Ansible Tower. This is normally achieved by specifying become as part of your playbook, such as this snippet. Typically, as part of&#8230;<p><a class="more-link" href="https://madeforcloud.com/2019/10/27/ansible-tower-local_action-sudo/" title="Continue reading &#8216;Ansible Tower &#8211; Local_Action + Sudo ?&#8217;">Continue reading <span class="meta-nav">&#8594;</span></a></p>]]></description>
										<content:encoded><![CDATA[
<p>There are many times when you run an Ansible playbook through Ansible Tower and you have to <em>become</em> a privileged user on the target system.  This is <em>business as usual</em> for Ansible and Ansible Tower.     </p>



<p>This is normally achieved by specifying <em>become</em> as part of your playbook, such as this snippet.</p>



<pre class="wp-block-code"><code>---
- name: Patch Linux
  hosts: all
  gather_facts: true
  become: true</code></pre>



<p>Typically, as part of a patching playbook, you would reboot the system and wait for the reboot to finish using a code fragment like this :</p>



<pre class="wp-block-code"><code> - name: Wait for server to restart
   local_action:
     module: wait_for
       host={{ ansible_ssh_host }}
       port=22
       delay=60
       timeout=300
</code></pre>



<p>This local_action inherits the <em>become: true</em> from the parent definition and this is where Tower starts to complain.   Remember, with Ansible Tower, it&#8217;s the tower server itself where the local_action will  run.   You can expect to see something like this :</p>



<pre class="wp-block-code"><code>"module_stderr": "sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?\n",</code></pre>



<p>No,  you <strong>SHOULD NOT</strong> enable the awx user to use sudo on the Tower system as  the AWX service user is intentionally restricted from sudo operations.  The best approach is to de-privilege the local_action.   Fortunately, local_action has it&#8217;s own <em>become</em> capability so you can turn off the request for privileged access as you don&#8217;t need it.</p>



<p>The above code block is now :</p>



<pre class="wp-block-code"><code> - name: Wait for server to restart
   become: false
   local_action:
     module: wait_for
       host={{ ansible_ssh_host }}
       port=22
       delay=60
       timeout=300</code></pre>



<p>and the tower job template will execute without any errors.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
