<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Michael Poore on Medium]]></title>
        <description><![CDATA[Stories by Michael Poore on Medium]]></description>
        <link>https://medium.com/@mpoore?source=rss-3d4d7478f28f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HBWhLNIMsvW_TtBE</url>
            <title>Stories by Michael Poore on Medium</title>
            <link>https://medium.com/@mpoore?source=rss-3d4d7478f28f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 04:33:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mpoore/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[VMware Aria Suite Lifecycle without Aria Automation]]></title>
            <link>https://medium.com/@mpoore/vmware-aria-suite-lifecycle-without-aria-automation-a35edb996e8a?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a35edb996e8a</guid>
            <category><![CDATA[vmware]]></category>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Wed, 10 May 2023 10:24:41 GMT</pubDate>
            <atom:updated>2023-05-10T10:24:41.343Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>Things that I didn’t know before includes many useless facts. But one very interesting thing that I learned recently is that you can download the VMware Aria Suite Lifecycle product without the Aria Automation and Identity Manager solutions embedded. It’s a much smaller download!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ji48u8XEbaDFnIgD.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a35edb996e8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Packer Container for an Image Factory]]></title>
            <link>https://medium.com/@mpoore/creating-a-packer-container-for-an-image-factory-d2bb6fd3d726?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2bb6fd3d726</guid>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 15:00:57 GMT</pubDate>
            <atom:updated>2023-03-14T15:00:57.645Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>I recently detailed the steps that I went through to create a standalone Docker host on Photon OS to be used as part of a larger solution by VMware Aria Automation. In this post I’m going to focus on the container image that’s going to run on that host.</p><p>What I’m aiming to achieve is to have a pipeline that takes my Packer builds from my source control repository and builds them for me without me having to initiate the process. Part of that involves having somewhere for Packer to run. I could, and have done in the past, have a Linux host with Packer on it that can be accessed via SSH. It works, but it’s a host that I don’t want to have to maintain and it’s not easy to move between versions of Packer. Instead, if I have Packer in a container then the container’s configuration is well locked down. The containers are ephemeral — after use they are destroyed — so tidying up isn’t a problem. I’m also doing it because I can!</p><p>Not familiar with Docker? Creating images isn’t too hard. Let me walk you through this one.</p><h4>Dockerfile</h4><p>Docker images are created using a Dockerfile. This is just a text file that defines what an image is comprised of. Each line or element in the file is a layer in your resultant image. Ideally we don’t want the image to be too big or complicated. We want it to contain nothing more or less than is need to complete its job.</p><p>Let’s go line-by-line.</p><pre>FROM photon:latest</pre><p>This first line tells Docker where to start. It’s like a foundation. Here we are instructing it to start with the latest Photon OS image. Why Photon? There are smaller, leaner images to use but I want to make sure that my resulting image can be used in VMware Aria Automation Pipelines. Some of the smaller images can have issues interacting with Aria Automation Pipelines.</p><pre>ARG VERSION</pre><p>This line creates an argument called VERSION that we need to populate when we build the image. It’s not required for Docker, but in this image it is used further on.</p><pre>LABEL maintainer=&quot;blog.v12n.io&quot;<br>LABEL version=&quot;$VERSION&quot;</pre><p>The labels are a good practice so that people who know created the image or perhaps, in this case, what version the image is. As you’ll see shortly, the version of the image correlates directly to the version of Packer being used.</p><pre># Update packages and install new ones<br>RUN tdnf install -y curl unzip git wget tar bindutils coreutils xorriso jq mkpasswd &amp;&amp; \<br>    tdnf autoremove -y &amp;&amp; \<br>    tdnf clean all</pre><p>The base Photon image is very minimal. There are some extra packages that I need later on so they get added to the image.</p><ul><li>xorriso — used to create ISO images by Packer</li><li>jq — used to transform Packer manifest files</li><li>mkpasswd — used to encrypt passwords</li></ul><pre># Install Packer<br>ADD https://releases.hashicorp.com/packer/${VERSION}/packer_${VERSION}_linux_amd64.zip ./<br>RUN unzip packer_${VERSION}_linux_amd64.zip -d /bin &amp;&amp; \<br>    rm -f packer_${VERSION}_linux_amd64.zip</pre><p>Using that VERSION argument again, these lines download Packer directly from HashiCorp and unzip it.</p><pre>ADD VERSION .</pre><p>Finally, and again just a nice-to-have, I add the local file VERSION in to the image.</p><p>The full Dockerfile looks like this:</p><pre>FROM photon:latest<br>ARG VERSION<br>LABEL maintainer=&quot;blog.v12n.io&quot;<br>LABEL version=&quot;$VERSION&quot;<br><br># Update packages and install new ones<br>RUN tdnf install -y curl unzip git wget tar bindutils coreutils xorriso jq mkpasswd &amp;&amp; \<br>    tdnf autoremove -y &amp;&amp; \<br>    tdnf clean all<br><br># Install Packer<br>ADD https://releases.hashicorp.com/packer/${VERSION}/packer_${VERSION}_linux_amd64.zip ./<br>RUN unzip packer_${VERSION}_linux_amd64.zip -d /bin &amp;&amp; \<br>    rm -f packer_${VERSION}_linux_amd64.zip<br><br># Complete<br>ADD VERSION .</pre><h4>Version</h4><p>At the time of writing, the latest version of Packer in 1.8.6. Alongside the Dockerfile I have a small file called <em>VERSION</em> that contains just this version number. Here’s the whole lot together in its <a href="https://github.com/v12n-io/codestream-ci-packer">GitHub repository</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9y9-RD8CUv3zOkTP.png" /><figcaption>codestream-ci-packer repository as seen in Visual Studio Code</figcaption></figure><h4>Building</h4><p>Now that we have a Dockerfile and the <em>VERSION</em> file let’s build an image! Assuming that you have access to Docker, building an image is pretty straightforward. In this case there is a minor step to be completed first. Assuming that you’re at a command line in the directory where the two files above are located, first read in the <em>VERSION</em> file:</p><pre>VERSION=$(&lt;VERSION)</pre><p>This populates the variable “VERSION” with a value of 1.8.6 (or whatever the contents of the file are).</p><p>Next, we simply build the image with Docker:</p><pre>docker build . -t v12nio/codestream-ci-packer:latest -t v12nio/codestream-ci-packer:v$VERSION --build-arg VERSION=$VERSION</pre><p>This builds the image and tags it with the tags “latest” and the tag “v1.8.6” with the value of VERSION being passed in by the — build-arg option.</p><h4>Publishing</h4><p>As a final step, I push the image to my free account at hub.docker.com. That way Aria Automation can just pull it down to use in my pipeline.</p><pre>docker push v12nio/codestream-ci-packer:latest<br>docker push v12nio/codestream-ci-packer:v$VERSION</pre><p>The image itself is only transferred once, but gets tagged twice so that it can be referenced either by “latest” or directly by the version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1xs05IB1i0LBwZJL.png" /><figcaption>dockerhub dashboard showing published images</figcaption></figure><h4>Using the Image</h4><p>The image can now be pulled by anyone from dockerhub directly and used. It’s that simple.</p><p>You’re very welcome to use the published images, or fork the <a href="https://github.com/v12n-io/codestream-ci-packer">repository</a>. I’m always happy to take feedback and suggestions too.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2bb6fd3d726" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a simple Docker host using Photon OS and VMware Aria Automation]]></title>
            <link>https://medium.com/@mpoore/creating-a-simple-docker-host-using-photon-os-and-vmware-aria-automation-a77541c37f28?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a77541c37f28</guid>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Tue, 07 Mar 2023 15:00:45 GMT</pubDate>
            <atom:updated>2023-03-07T15:00:45.544Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>It’s been a while. A long while. But I’ve been busy. Now though I want to document something that I have been using and developing over the last year or so and share it. Before I get to the good stuff though, there are some foundational things that I need to take care of.</p><p>A key element in it is having a simple capability to execute container images as part of an automation pipeline. One of the simplest ways to achieve this is to have a standalone Docker host that I can use as an endpoint for VMware Aria Automation. In this post I will go through the creation of such a host based on Photon OS. Then I’ll go one step further and turn it in to a catalog item for Aria Automation.</p><h4>Photon OS</h4><p>If you haven’t heard of or used Photon OS before, it’s an open-source minimalist Linux distribution from VMware that is used as the base for the appliances for solutions such as vCenter, Aria Automation etc. It can be downloaded from Github <a href="https://github.com/vmware/photon/wiki/Downloading-Photon-OS">here</a>, and although there are beta versions of 5.0 available, this article was written against 4.0 Rev 2.</p><p>Some might ask why I’m using Photon. Well, aside from the obvious “dogfooding” reason (I work for VMware), it’s small and Docker comes pre-installed even if it isn’t activated. So you can get to a functioning Docker host fairly easily.</p><p>I won’t cover the installation process for Photon here. In fact, I can’t recall the last time when I did it by hand! I build my images using <a href="https://www.packer.io/">HashiCorp Packer</a>. In fact, it’s Packer that I want to put in to a container to use in my image creation pipeline.</p><p>If you want to see the Packer build for Photon, I’ll cover it in more detail in a future post. For now however, there are plenty of other guides out there on how to install Photon.</p><h4>Enabling Docker in Photon</h4><p>My use-case for Docker involves Aria Automation being able to run containers on the host remotely, so the configuration has a few more steps to it. But it shouldn’t be too hard to follow. In brief, those steps are:</p><ol><li>Open the firewall ports for remote Docker access</li><li>Adding a user to the docker group</li><li>Creating service definitions for Docker that include remote access</li><li>Enable the Docker services</li></ol><h4>Firewall</h4><p>Photon uses iptables to facilitate a firewall service in the OS. If we want Aria Automation to be able to access Docker on the host then we either need to disable the firewall (not recommended) or poke a couple of holes in it. Docker uses ports 2375 and 2376 by default. I’ll also open up ICMP so that we can ping the host, but that’s not necessary, just a nice-to-have.</p><p>Via SSH or on the console for Photon, the following commands are needed to open the ports:</p><pre>sudo iptables -A INPUT -p tcp --dport 2375 -j ACCEPT<br>sudo iptables -A INPUT -p tcp --dport 2376 -j ACCEPT<br>sudo iptables -A OUTPUT -p icmp -j ACCEPT<br>sudo iptables -A INPUT -p icmp -j ACCEPT</pre><p>But if we want those settings to be persisted across reboots then we need to make them permanent also:</p><pre>sudo iptables-save &gt; /etc/systemd/scripts/ip4save<br>sudo systemctl restart iptables</pre><h4>Docker Group</h4><p>If we want to be able to use Docker, our user will need to be a member of the local group called “docker” on the host. The group already exists, we just need to add our user to it.</p><p>As a recommended practice, although there is a root account it’s best not to use it directly and make use of sudo to get privileged access. By default I create a non-administrative user account in all of my Linux images that has the ability to use sudo for administrative access. I therefore add this user to the “docker” group.</p><pre>sudo usermod -a -G docker username</pre><p>Where “username” is obviously the name of the account I’m using.</p><h4>Service Definitions</h4><p>We could just enable Docker at this point, but the service would only accept local connections by default. As I already stated, I want Aria Automation to connect in remotely. Hence I need to make a change to the options used to start Docker.</p><p>Now, I could change the default service file directly but such a change could get wiped out by an upgrade / update. Instead, I create and use my own service definitions. The first of these is for the <em>docker.socket</em> service. This involves creating a file called <em>/etc/systemd/system/docker.socket </em>with the following contents:</p><pre>[Unit]<br>Description=Docker Socket for the API<br>PartOf=docker.service<br><br>[Socket]<br>ListenStream=/var/run/docker.sock<br>SocketMode=0660<br>SocketUser=root<br>SocketGroup=docker<br><br>[Install]<br>WantedBy=sockets.target</pre><p>The file should be owned by root:root and the permissions should match the other files in the directory.</p><p>The second service definition file is for the <em>docker.service</em> service. This time the file is called <em>/etc/systemd/system/docker.service</em> and has the following contents:</p><pre>[Unit]<br>Description=Docker Application Container Engine<br>Documentation=https://docs.docker.com<br>After=network-online.target docker.socket<br>Requires=docker.socket<br><br>[Service]<br>Type=notify<br>ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375<br>ExecReload=/bin/kill -s HUP $MAINPID<br>LimitNOFILE=infinity<br>LimitNPROC=infinity<br>LimitCORE=infinity<br>TimeoutStartSec=0<br>Delegate=yes<br>KillMode=process<br>Restart=on-failure<br>StartLimitBurst=3<br>StartLimitInterval=60s<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>The key thing that is added here is the addition of the tcp://0.0.0.0:2375 option. Without it Docker won’t allow remote access.</p><h4>Start Services</h4><p>The final step is pretty simple. We just need to enable and start the services.</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable docker.socket<br>sudo systemctl enable docker<br>sudo systemctl start docker<br>sudo systemctl start docker.socket</pre><p>Job done! Docker is now running and will start automatically at reboot.</p><h4>There’s more…</h4><p>Wait! What?</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*y4iqpzCf0ft2QQjr" /><figcaption>Photo by <a href="https://unsplash.com/@miki202og?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Miguel Orós</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Having gone to that trouble, what if I could capture that and make a catalog item out of it in Aria Automation? Docker hosts on demand!</p><p>Thanks to cloud-init it’s pretty straightforward. Having a password in clear text isn’t a good idea, although it’s set to require changing on first login. But this is just an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YehPqqKbqBKroY1Z.png" /><figcaption>Request for for a Docker host</figcaption></figure><p>As you can guess from the form indentation, there are a couple of properties that are part of a property group. However, they’re just for selecting a flavor mapping and setting the system disk size. The rest is just a standard Cloud Template.</p><pre># ----------------------------------------------------------------------------<br># Name:         Docker Host<br># Description:  Deploys a standalone Docker host<br># Author:       Michael Poore (@mpoore)<br># ----------------------------------------------------------------------------name: Docker Host<br>description: Deploys a standalone Docker Host based on Photon OS<br>version: 0.0.1<br>formatVersion: 1<br># ----- Inputs -----<br>inputs:<br>  linuxSettings:<br>    type: object<br>    $ref: /ref/property-groups/defaultLinuxSettings<br>  photonVersion:<br>    type: string<br>    title: OS Version<br>    description: Select the version of Photon OS to use for this Docker deployment<br>    default: &#39;4&#39;<br>    enum:<br>      - &#39;4&#39;<br>      - &#39;5&#39;<br>  addressType:<br>    type: string<br>    title: IP Address Type<br>    description: Select the type of IP address to use for this deployment, Static or DHCP<br>    default: dynamic<br>    oneOf:<br>      - title: DHCP<br>        const: dynamic<br>      - title: Static<br>        const: static<br>  userAccount:<br>    type: string<br>    title: User Account<br>    description: Enter the name of a user account that will be created on the Docker Host<br>    default: dockeruser<br>    minLength: 6<br>    maxLength: 16<br>    pattern: \b([a-z0-9]+)\b(?&lt;!root|v12n|docker)<br>  userPassword:<br>    type: string<br>    minLength: 8<br>    maxLength: 16<br>    default: null<br>    pattern: (?=^.{8,}$)(?=.*\d)(?=.*[!@#$%^&amp;*]+)(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$<br># ----- Resources -----<br>resources:<br>  DockerHost:<br>    type: Cloud.Machine<br>    properties:<br>      image: ${&quot;photon&quot; + input.photonVersion + &quot;-main&quot;}<br>      flavor: ${input.linuxSettings.instanceSize}<br>      storage:<br>        bootDiskCapacityInGB: ${input.linuxSettings.systemDiskSize}<br>      cloudConfig: |<br>        #cloud-config<br>        preserve_hostname: false<br>        hostname: ${self.resourceName}<br>        users:<br>          - name: ${input.userAccount}<br>            groups: users,docker<br>            lock_passwd: false<br>        chpasswd:<br>          list: |<br>            ${input.userAccount}:${input.userPassword}<br>          expire: True<br>        write_files:<br>          - owner: root:root<br>            path: /etc/systemd/system/docker.socket<br>            permissions: &#39;0755&#39;<br>            content: |<br>              [Unit]<br>              Description=Docker Socket for the API<br>              PartOf=docker.service<br><br>              [Socket]<br>              ListenStream=/var/run/docker.sock<br>              SocketMode=0660<br>              SocketUser=root<br>              SocketGroup=docker<br><br>              [Install]<br>              WantedBy=sockets.target<br>          - owner: root:root<br>            path: /etc/systemd/system/docker.service<br>            permissions: &#39;0755&#39;<br>            content: |<br>              [Unit]<br>              Description=Docker Application Container Engine<br>              Documentation=https://docs.docker.com<br>              After=network-online.target docker.socket<br>              Requires=docker.socket<br><br>              [Service]<br>              Type=notify<br>              ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375<br>              ExecReload=/bin/kill -s HUP $MAINPID<br>              LimitNOFILE=infinity<br>              LimitNPROC=infinity<br>              LimitCORE=infinity<br>              TimeoutStartSec=0<br>              Delegate=yes<br>              KillMode=process<br>              Restart=on-failure<br>              StartLimitBurst=3<br>              StartLimitInterval=60s<br><br>              [Install]<br>              WantedBy=multi-user.target<br>        runcmd:<br>          - iptables -A INPUT -p tcp --dport 2375 -j ACCEPT<br>          - iptables -A INPUT -p tcp --dport 2376 -j ACCEPT<br>          - iptables -A OUTPUT -p icmp -j ACCEPT<br>          - iptables -A INPUT -p icmp -j ACCEPT<br>          - iptables-save &gt; /etc/systemd/scripts/ip4save<br>          - systemctl restart iptables<br>          - systemctl daemon-reload<br>          - systemctl enable docker.socket<br>          - systemctl enable docker<br>          - systemctl start docker<br>          - systemctl start docker.socket<br>      networks:<br>        - network: ${resource.PrimaryNetwork.id}<br>          assignment: ${input.addressType}<br>      role: dkr<br>  PrimaryNetwork:<br>    type: Cloud.Network<br>    properties:<br>      networkType: existing<br># ----------------------------------------------------------------------------<br># Changes:<br>#   0.0.x - Draft versions<br># ----------------------------------------------------------------------------</pre><p>There you have it…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a77541c37f28" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ch…ch…ch…changes!]]></title>
            <link>https://medium.com/@mpoore/ch-ch-ch-changes-5a034f86749f?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a034f86749f</guid>
            <category><![CDATA[personal]]></category>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 14:15:55 GMT</pubDate>
            <atom:updated>2022-07-28T14:15:55.988Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>I have been a little quiet for the last five months or so (I’m not counting). Life has been busy, lots has happened — both personally and professionally.</p><ul><li>One of my children hit a milestone age</li><li>I was accepted as a HashiCorp Ambassador for the second successive year</li><li>I attended HashiConf Europe</li><li>I have had several onsite visits with customers — the first ones since early 2020</li><li>I recently broke my 820+ day streak of not catching Covid — bummer!</li><li>My day job has been crazy busy throughout</li></ul><p>Through it all there have been some mental health battles that I have been fighting. What I love about the people that I work with and know socially though, is that they’re incredibly supportive. To name but a few, Claire (my wife), Katarina Brookfield, Mark Brookfield, Joe Baguley, Dave Marley and my direct line management at VMware have been cornerstones of my existence through what have been some challenging times! I haven’t thanked them enough, but I hope that they know that their support is very much appreciated! The list of who I should thank goes on and on. I could almost copy and paste my contacts into this post.</p><p>There comes a time though when a fundamental change is needed in order to keep progressing and growing. I joined VMware in September 2015 and have spent all of my (nearly) 7 years in Professional Services (PSO). I live for helping my customers succeed and PS has been a great vehicle to achieve that. Lately though I have felt the need to find a new outlet for my passion towards cloud management and cloud automation. VMware’s offerings in this area are easier to adopt and consume than they have ever been and I have been getting less satisfaction from my PS role than I used to. Which means that it’s time for a new role.</p><p>In two more weeks I will finish with PSO and go immediately in to PTO! (That means that I’m going on holiday / vacation for those of you not familiar with the acronym.) When I come back at the end of August though, I will be stepping in to a new role at VMware. It’s one that has more of a global scope, and I’m quite excited about it!!</p><p>More will follow in due course…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a034f86749f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Monitoring Chrony with Grafana and Telegraf]]></title>
            <link>https://medium.com/@mpoore/monitoring-chrony-with-grafana-and-telegraf-94d495dd09e6?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/94d495dd09e6</guid>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Thu, 03 Mar 2022 15:00:08 GMT</pubDate>
            <atom:updated>2022-03-03T15:00:08.584Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>In my previous post I created some new NTP servers for my lab to replace the older CentOS 8 servers that I had — one of which recently failed without me noticing!</p><p>Having got the new servers up and running using Photon OS and Chrony, it’s now time to focus on keeping an eye on what’s going on.</p><p>Of course, I have vRealize Operations in my lab and it’s very capable of being used for this purpose. However, from time to time I remove it and re-deploy it. So I also have Grafana deployed and use it for things that don’t change too much.</p><p>This post isn’t about setting Grafana up in the first place, there are other great blogs around that cover that. For example, <a href="https://jorgedelacruz.uk/">Jorge de la Cruz</a> and <a href="https://rudimartinsen.com/">Rudi Martinsen</a> both have great content. Instead, this is about getting Telegraf installed and setup on my NTP servers to sent data to InfluxDB so that Grafana can query and display it. Time for a diagram…</p><h4>How it works</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/0*gItrD_wNevUUvBl8.png" /><figcaption>Logical diagram of how we will monitor Chrony</figcaption></figure><p>There are two servers involved here. On the left, one of my NTP servers. We have already installed <em>Chrony</em>, but now we need to add and configure the <em>Telegraf</em> agent. We’re going to configure it to use the <em>chronyc</em> utility to query the <em>chronyd</em> service and return some measurements. <em>Telegraf</em> will also then be configured to forward these measurements to <em>InfluxDB</em> running on the monitoring server on the right. <em>Grafana</em> can then pull the measurements and display / act on them.</p><p>Now although I already have <em>Grafana</em> and <em>InfluxDB</em> in place, I do need to make some changes to <em>InfluxDB</em> to permit a remote <em>Telegraf</em> agent to access it. Let’s start there.</p><h4>InfluxDB (on ukw-p-ops-01)</h4><p>There are three things that we need to do with <em>InfluxDB</em> to get it ready. The first is to open up a firewall port.</p><p><em>InfluxDB</em> has an HTTP input plugin that <em>Telegraf</em> can leverage. By default this uses TCP on 8086, so that need to be opened up.</p><pre>firewall-cmd --add-port=8086/tcp --permanent<br>firewall-cmd --reload</pre><p>Secondly, we ought to create some users in <em>InfluxDB</em> so that we can enable authentication rather than just having everyone able to send measurements to the database. This is achieved by running the <em>influx</em> command line utility. We can then create users…</p><pre>CREATE USER &quot;influxadmin&quot; WITH PASSWORD &#39;Ch4ngeMe!&#39; WITH ALL PRIVILEGES<br>CREATE USER &quot;influxread&quot; WITH PASSWORD &#39;Ch4ngeMe!&#39;<br>CREATE USER &quot;influxwrite&quot; WITH PASSWORD &#39;Ch4ngeMe!&#39;</pre><p>and grant them appropriate access to the database (which is called ‘telegraf’ in this instance).</p><pre>GRANT READ ON &quot;telegraf&quot; TO &quot;influxread&quot;<br>GRANT WRITE ON &quot;telegraf&quot; TO &quot;influxwrite&quot;</pre><p>Finally we need to enable the HTTP input plugin and authentication. This involves editing the <em>/etc/influxdb/influxdb.conf</em> file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/0*FMsD6MblKXkH0OC9.png" /><figcaption>Changes needed in the InfluxDB configuration file</figcaption></figure><p>The two lines that have to be changed are under the [http] section. Uncomment both lines and set them as follows:</p><pre>enabled = true<br>auth-enabled = true</pre><p>(Optionally you can enable the access logs if you want.) To implement the change, just restart <em>InfluxDB</em>:</p><pre>systemctl restart influxdb</pre><h4>Telegraf (on ukw-p-ntp-01)</h4><p>Moving on to the time server we want to monitor, we will need to install and configure <em>Telegraf</em>.</p><p>The installation is easy (remember this host is running Photon OS, hence the use of <em>tdnf</em>):</p><pre>tdnf install telegraf -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hyncFptg3zlwCOrb.png" /><figcaption>Installing Telegraf</figcaption></figure><p>Told you it was easy!</p><h4>Inputs</h4><p>Next we need to make some configuration changes to <em>Telegraf</em>. By default it will pull in configurations from a subfolder (if present) which makes it handy to keep things tidy. So first we will create that and change the owner to the ‘telegraf’ user.</p><pre>mkdir -p /etc/telegraf/telegraf.d<br>chown telegraf:telegraf /etc/telegraf/telegraf.d</pre><p>Next we’re going to instruct <em>Telegraf</em> to take inputs from <em>Chrony</em>, which it will do using the <em>chronyc</em> utility. Luckily <em>Telegraf</em> includes a plugin for <em>Chrony</em>, we just have to enable it. To do that we create a file called <em>/etc/telegraf/telegraf.d/chrony.conf </em>and add the following content:</p><pre># Get standard chrony metrics, requires chronyc executable.<br>[[inputs.chrony]]<br>  ## If true, chronyc tries to perform a DNS lookup for the time server.<br>  # dns_lookup = false</pre><p>I also would like to get some basic system stats across. For example, uptime and CPU utilisation. For that we can enable the system plugin by creating another file called <em>/etc/telegraf/telegraf.d/system.conf </em>with the following content.</p><pre># Read metrics about system load &amp; uptime<br>[[inputs.system]]<br>  # no configuration</pre><p>Make sure that <strong>both</strong> files are owned by the ‘telegraf’ user and have permissions set at 640.</p><h4>Outputs</h4><p>Now that <em>Telegraf</em> is ready to collect measurements, we need to tell it where to send them. For this we need to configure an output plugin for <em>InfluxDB</em>.</p><p>Once more we can create a file called <em>/etc/telegraf/telegraf.d/outputs.conf</em> for this with the following example content:</p><pre>[[outputs.influxdb]]<br>  urls = [&quot;http://ukw-p-ops-01.v12n.io:8086&quot;]<br>  insecure_skip_verify = true<br>  database = &quot;telegraf&quot;<br>  skip_database_creation = true<br>  precision = &quot;s&quot;<br>  timeout = &quot;5s&quot;<br>  username = &quot;influxwrite&quot;<br>  password = &quot;Ch4ngeMe!&quot;<br>  retention_policy = &quot;&quot;</pre><p>Obviously this needs to be customised to suit the environment and again must be owned by the ‘telegraf’ user. We could have combined all of these three files in to one or even have made the changes in the main <em>telegraf.conf</em> file but I think that this separation is better to understand.</p><h4>Start Telegraf</h4><p>That’s all we need to do now except enable the service and start it.</p><pre>systemctl enable telegraf<br>systemctl start telegraf</pre><p>All being well then we should see some measurements hit <em>InfluxDB</em>. Which we can verify easily enough before moving on to <em>Grafana</em>.</p><h4>Verify Measurements (on ukw-p-ops-01)</h4><p>If you enabled it then you could look at the HTTP access log for <em>InfluxDB</em>, but I think that querying the database would be a better demonstration. This is achieved using the <em>influx</em> command line utility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*uWbamGH_bnm6jbpB.png" /><figcaption>Starting the influx command line utility</figcaption></figure><p>Notice that now we must use the ‘auth’ command to authenticate to InfluxDB before we can do anything. Once the correct database is selected (‘telegraf’ in my case), we can check to see if we have any measurements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1N4z9Mbh-O3YsO9k.png" /><figcaption>Querying the chrony measurements</figcaption></figure><p>This is good!</p><h4>Grafana (on ukw-p-ops-01)</h4><p>It took me a while to get used to how dashboards are constructed in <em>Grafana</em> through the web interface, but I’m getting the hang of it now.</p><p>Using the information provided by the <em>Chrony</em> and <em>System</em> plugins in <em>Telegraf</em>, I was able to create 3 simple panels that showed:</p><ol><li>The uptime of the OS on the NTP server</li><li>The system load on the NTP server</li><li>The time skew in the <em>Chrony</em> daemon</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pHFZs7U4j_skI7-6.png" /><figcaption>A Grafana dashboard for Chrony monitoring</figcaption></figure><p>I’ll get this dashboard published on the <em>Grafana</em> <a href="https://grafana.com/grafana/dashboards/">dashboard page</a> in due course once I’ve tweaked it a little. What I really like though is that as soon as I configure my second NTP server with <em>Telegraf</em> in the same way, it will automatically show up on the dashboard!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94d495dd09e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Replacing CentOS NTP servers with Photon and Chrony]]></title>
            <link>https://medium.com/@mpoore/replacing-centos-ntp-servers-with-photon-and-chrony-a4ffbfdab5e9?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4ffbfdab5e9</guid>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Tue, 01 Mar 2022 15:00:15 GMT</pubDate>
            <atom:updated>2022-03-01T15:00:15.337Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>There are countless memes available on the internet that suggest that the cause of various IT issues is normally always DNS.</p><p>There are plenty that suggest NTP as a cause too. And, in light of Facebook’s snafu last year, probably plenty around BGP now as well. It was NTP that bit me recently though.</p><p>I have time servers in my lab for a few reasons:</p><ol><li>Most of my customers operate their own time sources, therefore I should too.</li><li>If, for any reason, my lab becomes disconnected from the internet then at least there are local time servers to synchronise with.</li><li>Although the traffic overhead is negligible for NTP, I’d rather limit the number of applications and appliances reaching out for time updates.</li></ol><p>The setup looks a bit like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/0*AQruTeUoQwhY1uL1.png" /><figcaption>NTP setup in the v12n lab</figcaption></figure><p>All of the various applications and appliances synchronise their time with the two NTP servers. They in turn synchronise with the UK pool of public NTP servers.</p><p>My NTP servers were running CentOS 8 and had the Chrony service configured to share time with any connected clients. All seemed good until recently when I had to spend several hours troubleshooting and issue that turned out to be related to NTP. In the end, I discovered that for some reason the Chrony service wasn’t started or enabled on one of my time servers!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*VulnZodEJX9bO4OO.png" /><figcaption>Enabling and starting the Chrony service after it “disappeared”</figcaption></figure><p>I hadn’t yet updated those time servers to use CentOS 8 Stream, and of course CentOS 8 (the non-stream) version went End-of-Life a few months back. So I decided to rebuild my NTP servers from the ground up.</p><h4>Photon OS</h4><p>Photon OS is a lightweight Linux operating system that was created by VMware and is now the base OS for the majority of their appliances. Rather than use up my limited number of RHEL licenses on these NTP servers, I decided to go with Photon. It also helps that I already have a Photon 4 build in my <a href="https://github.com/v12n-io/packer">Packer repository</a>.</p><p>With the new NTP servers deployed and given temporary DHCP IP addresses, I could go ahead with configuring them ready to swap over with the outgoing servers.</p><h4>Firewall</h4><p>First thing to do is to open up the firewall to allow clients to synchronise time. In Photon this is achieved with <em>iptables</em> using the following:</p><pre>iptables -A INPUT -i eth0 -p udp --dport 123 -j ACCEPT<br>iptables-save</pre><p>The first line opens UDP port 123 to incoming traffic. The second is used to save the configuration.</p><h4>Chrony</h4><p>If it’s not already installed, we need to add <em>chrony</em>:</p><pre>tdnf install chrony -y</pre><p>The default configuration file for <em>chrony</em> can be found at /etc/chrony.conf. I made a couple of changes to it so it looked like this:</p><pre># Use public servers from the pool.ntp.org project.<br># Please consider joining the pool (https://www.pool.ntp.org/join.html).<br>pool uk.pool.ntp.org iburst<br><br># Record the rate at which the system clock gains/losses time.<br>driftfile /var/lib/chrony/drift<br><br># Allow the system clock to be stepped in the first three updates<br># if its offset is larger than 1 second.<br>makestep 1.0 3<br><br># Enable kernel synchronization of the real-time clock (RTC).<br>rtcsync<br><br># Enable hardware timestamping on all interfaces that support it.<br>#hwtimestamp *<br><br># Increase the minimum number of selectable sources required to adjust<br># the system clock.<br>minsources 2<br><br># Allow NTP client access from local network.<br>#allow 192.168.0.0/16<br>allow 172.16.0.0/12<br>allow 192.168.0.0/16<br>allow 10.0.0.0/8<br><br># Serve time even if not synchronized to a time source.<br># local stratum 10<br><br># Require authentication (nts or key option) for all NTP sources.<br>#authselectmode require<br><br># Specify file containing keys for NTP authentication.<br>#keyfile /etc/chrony.keys<br><br># Save NTS keys and cookies.<br>ntsdumpdir /var/lib/chrony<br><br># Insert/delete leap seconds by slewing instead of stepping.<br>#leapsecmode slew<br><br># Get TAI-UTC offset and leap seconds from the system tz database.<br>#leapsectz right/UTC<br><br># Specify directory for log files.<br>logdir /var/log/chrony<br><br># Select which information is logged.<br>#log measurements statistics tracking</pre><ul><li>On line 3 I have set <em>chrony</em> to use the NTP pool for uk.pool.ntp.org for time sources.</li><li>On line 20 I have configured a minimum of 2 time sources to be used for synchronisation. This is for upstream synchronisation and means that <em>chrony</em> will require two servers from the UK NTP pool to respond to change the local time. This reduces the risk of getting an incorrect time.</li><li>On lines 24–26 I have allowed incoming requests from the RFC1918 private address ranges to be serviced.</li></ul><p>Once saved, we need to enable and start the <em>chronyd</em> service.</p><pre>systemctl enable chronyd<br>systemctl start chronyd</pre><p>If all is well, you can use the <em>chronyc</em> utility to see the status of time sync with the NTP pool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*0v6JJ9sUXHGhz2D1.png" /><figcaption>Using the chronyc utility to check if the time is being synchronised</figcaption></figure><h4>Network</h4><p>The penultimate step for me was to configure the networking to have a static IP address on boot. On Photon this can be achieved easily by creating a configuration file called /etc/systemd/network/10-static-en.network and putting something like this in it:</p><pre>[Match]<br>Name=eth0<br><br>[Network]<br>Address=172.16.0.3/24<br>Gateway=172.16.0.254<br>DNS=172.16.0.1 172.16.0.2</pre><p>Obviously you need to use IPs that fit your environment.</p><p>The file /etc/systemd/network/99-dhcp-en.network should then be removed if it is present.</p><h4>Switchover</h4><p>Switching over was just a matter of shutting down the old CentOS NTP server and rebooting the new one.</p><p>Of course, I then repeated the whole procedure for the second NTP server.</p><h4>What’s Next?</h4><p>The trigger for creating these new NTP servers was that one of them had stopped working. Rather than hope that it doesn’t happen again, I wanted to make sure that there was some easy way to keep an eye on them. I’ll cover that in the next post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4ffbfdab5e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixed: UniFi Network Application Not Starting After Firmware Upgrade]]></title>
            <link>https://medium.com/@mpoore/fixed-unifi-network-application-not-starting-after-firmware-upgrade-943e8f1d421d?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/943e8f1d421d</guid>
            <category><![CDATA[vexpert]]></category>
            <category><![CDATA[unifi]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 15:00:06 GMT</pubDate>
            <atom:updated>2022-01-25T15:00:06.409Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>In case it’s useful for anyone else, I encountered an issue after a recent firmware upgrade on the UniFi Dream Machine Pro (UDM-PRO) that handles my home networking and routing.</p><p>Ubiquiti released version 1.11.0 of their firmware for the UDM late in 2021 and prior to starting back to work in anger this year I decided to upgrade. The actual firmware update went without a hitch and my internet connection was only offline for a few moments. However, I quickly discovered that I had no ability to manage any aspect of networking at all.</p><p>Not being the only person in the house, I would have been informed <em>very</em> quickly if there was an issue preventing internet access. After some quick tests I was able to verify that all networking and routing was working fine, it was just that I couldn’t access the “Network” application to manage anything.</p><p>For those not familiar with the UDM-PRO, it’s a rack mountable router that also manages other parts of the UniFi ecosystem (for example telephony, cameras etc). I only currently have it managing my network but it manages everything from WiFi to my homelab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TFDg_2WNv-x2IF7_.png" /></figure><p>Each different use has a separate application that is used to manage and operate that function. As you can see in the screenshot above, I have only “Network” enabled. After the firmware update this was showing as <em>Starting. </em>The version was also showing as 6.5.54, which may have been related to the issue.</p><p>A restart of the UDM didn’t address the issue so I opted to have a poke around the CLI to see if there was any further information. Fortunately I already had SSH enabled so getting in wasn’t a problem.</p><p>‼️</p><p>Here be dragons! You can break things very easily with typos or if you’re not 100% sure what you’re doing. Everything below is offered as information based on my experience and Your Mileage May Vary.</p><p>Once connected you land in a limited shell that offers you a small number of commands that you can execute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*GU9DuNu21UGIt3OC.png" /></figure><p>However, you can drop in to the OS shell by using the following command:</p><pre>unifi-os shell</pre><p><strong>If you’re not familiar with Linux system administration then this might be a bit daunting, so be careful.</strong></p><p>Under the covers the “Network” application is called <em>unifi</em> and there is a service associated with it. You can show the status of the service using the command:</p><pre>systemctl status unifi.service</pre><p>What I got was this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/0*_IhLY9861C3UftqI.png" /></figure><p>I tried starting / restarting the service a few times with the following commands but got the same result:</p><pre>systemctl start unifi.service<br>systemctl restart unifi.service</pre><p>I tried looking through the service’s log files but couldn’t really see what was going on. I did know however that version 6.5.55 of the Network application was available, I thought it might be worth trying to update it, which you can’t do through the UI when it’s not running. The following commands will do that:</p><pre>apt-get update; apt-get install unifi -y</pre><p>That completed successfully as you’ll see below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ikLt9D3I6otPU2H-.png" /></figure><p>And that solved my problem!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=943e8f1d421d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fixing VMware Identity Manager Network Properties Precheck Error]]></title>
            <link>https://medium.com/@mpoore/fixing-vmware-identity-manager-network-properties-precheck-error-c800b7724258?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c800b7724258</guid>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Thu, 20 Jan 2022 15:00:07 GMT</pubDate>
            <atom:updated>2022-01-20T15:00:07.733Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>vRealize Automation 8.6.2 became generally available (GA) on January 18th 2022 and I don’t like to leave it long to update it as there are monthly releases. However, alongside vRA 8.6.2 is an important update for VMware Identity Manager to 3.3.6.</p><p>It’s a fairly minor release, as you can see in the <a href="https://docs.vmware.com/en/VMware-Workspace-ONE-Access/3.3/rn/VMware-Identity-Manager-336-Release-Notes.html">release notes</a>, with a number of security vulnerabilities being addressed including the much publicised Log4j one.</p><p>Following on from some health checks I was ready to proceed with updating vIDM. I had taken snapshots and removed the backup nodes from my load balancer. All that remained was the prechecks. But some of them failed…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*32kUtsjULdm8jm3F.png" /><figcaption>Failed prechecks for VIDM upgrade</figcaption></figure><p>To help the search engines, the text of the message(s) is as follows:</p><pre>Network properties should be properly assigned on the appliance. Network properties: [OVFENV_OK, OVFENV_NET_HOSTNAME, OVFENV_NET_DNS, OVFENV_IPV4_IP0, OVFENV_IPV4_NETMASK, OVFENV_IPV4_GATEWAY] are not present on the host: ukw-p-idm-04.v12n.io</pre><p>vIDM had been working without issue prior to this, and I’m still not sure why the properties mentioned were missing, but it had to be fixed to carry on. Luckily the <em>Recommendations</em> column contains a link to a <a href="https://kb.vmware.com/s/article/83587">VMware KB article (83587)</a> on this issue. However it doesn’t take you through the resolution in detail. There are some potential gotchas along the way.</p><h4>Preparation</h4><p>Having got as far as being about to run the upgrade, there are some things that have to be undone first.</p><ol><li>Re-add the backup nodes to your load balancer. If you’re running a clustered instance of vIDM you should start off with all three nodes enabled behind your load balancer.</li><li>If this is a production service, you’ll need to schedule some downtime. As the KB article above says, you’ll need to shutdown your appliances.</li><li>Make sure that you know all of the network configuration (IPs, hostnames, DNS servers etc) for all nodes.</li><li>Make yourself a cup of tea*</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*caN_sig00mHXTROc" /><figcaption>Photo by <a href="https://unsplash.com/@asverna?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">As Verna</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><pre>* Other beverages are available</pre><h4>Power Off vIDM</h4><p>Next up, we need to shutdown vIDM gracefully. This is achieved through Lifecycle Manager (vRSLCM) using a Day 2 operation, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*uABwuYsQIs1-jBN2.png" /><figcaption>Power OFF operation to shutdown vIDM</figcaption></figure><p>That will take a couple of minutes to complete but by the end of it your vIDM cluster will be shutdown and the VMs powered off.</p><h4>Add vApp Options</h4><p>For this we need to head over to vCenter. We need to apply some vApp Options to each of the vIDM appliances. When I looked at each of my appliances in vCenter, none of them had any options set at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/0*kV64EPWgfLIM8Ak1.png" /><figcaption>VM with vApp Options disabled</figcaption></figure><p>I’m not sure why this happened. They would have been present and set when vIDM was initially deployed. Apparently they are lost if the VMs have been removed and re-added to vCenter but I don’t recall doing that ever. What’s important though is to get them back. And this is where the KB article wasn’t too clear for me and, I must confess, I did make a mistake that cost me some time on a Wednesday night!!!</p><h4>Enable vApp Options</h4><p>For each of the three appliances I had to <em>Edit</em> the vApp Options to enable them. This opens a dialog box that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*WrmT1Jf5ajuCjkwU.png" /><figcaption>Edit vApp Options Dialog</figcaption></figure><p>Perform the following for the <em>Authoring</em> section:</p><ul><li>Check the ‘Enable vApp Options’ checkbox</li><li>Select ‘Both’ for the IP protocol</li><li>Check ‘OVF environment’ for the IP allocation scheme</li></ul><p>Under the <em>Deployment</em> section, set the following:</p><ul><li>Select ‘IPv4’ for IP protocol</li><li>Leave the ‘IP allocation’ set to <strong>Static — Manual</strong></li></ul><p>You should have something that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*sRD45ZhF03GYUITx.png" /><figcaption>vApp Options IP Allocation settings</figcaption></figure><p>On the OVF Details tab, the only thing you need to do is check the box next to ‘VMware Tools’ for the <em>OVF environment transport</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/0*rTCsyIMToTlvaKm_.png" /><figcaption>vApp Options OVF Details settings</figcaption></figure><p>Once that is done you can click <strong>OK</strong> and close the dialog box. You’ll now see that vApp Options is no longer disabled:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K_sW9BWFGZ83NMjo.png" /><figcaption>vApp Options enabled</figcaption></figure><p>There’s still more to do here though…</p><h4>Set Properties</h4><p>The properties in the bottom of the screenshot above are what vRSLCM was complaining about. Basically, there aren’t any!</p><p>When you click the ADD button / link by the Properties table, you get a dialog box open with two tabs on it. Those tabs are:</p><p>General</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/0*kNFw2ZdO7IQ6iM-N.png" /></figure><p>Type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/0*4XP-KRxKaE_yVbgH.png" /></figure><p>For each of the properties in the table below, you must click the ADD button / link and fill in the relevant information.</p><p>Label Key class ID Key ID Key instance ID Type vmname vm vmname String CEIP ceip.enabled Boolean Timezone vamitimezone String DNS vami DNS IdentityManager String Gateway vami gateway IdentityManager String Domain vami domain IdentityManager String Domain Search vami searchpath IdentityManager String FQDN vami hostname String IP vami ip0 IdentityManager String Netmask vami netmask0 IdentityManager String</p><p>Next, revisit each property and set values for them per the table below (although use values that are appropriate for your environment):</p><p>Key Value Description ceip.enabled False This setting dictates whether the Customer Experience Improvement Program (CEIP) should be joined. Set it to ‘True’ or ‘False’, but it must have one of these values or the VM will not power on (this is one of the gotchas I warned you about). vamitimezone Etc/UTC The timezone for the appliance (see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a>). It must be the same on all three appliances. vami.domain.IdentityManager v12n.io The DNS domain that the appliance belongs to. vami.gateway.IdentityManager 192.168.1.254 The IPv4 default gateway for the appliance. vami.hostname vidm01.v12n.io The FQDN of the appliance. There must be a DNS entry for this present. vami.ip0.IdentityManager 192.168.1.51 The unique IP address assigned to this appliance. vami.netmask0.IdentityManager 255.255.255.0 The subnet mask vami.searchpath.IdentityManager v12n.io The default domain(s) that the appliance searches for hostnames in. vami.DNS.IdentityManager 192.168.1.1,192.168.1.2 A comma separated list of DNS servers to use for name resolution. vmname IdentityManager This is <em>NOT</em> the name of the VM in vCenter. It <strong>MUST</strong> be set to ‘IdentityManager’ (another gotcha).</p><p>⚠️</p><p>If you do get any of these wrong then vIDM may not start!! In particular, if ‘vmname’ doesn’t match the third part of the ‘vami.*’ keys then those values will not get read and your appliance will try to use DHCP! I did this, it’s ugly. Don’t be like me!</p><h4>Power ON</h4><p>Finally, once you have completed this for all three appliances, head back in to vRSLCM and now <em>Power ON</em> the vIDM cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*gJttJJuBmFpySv6D.png" /><figcaption>Power ON operation to startup vIDM</figcaption></figure><p>The process will take a few minutes. But you’re on the home straight now.</p><h4>Finally</h4><p>Make sure that you check the health of PostgreSQL, vIDM in general and take snapshots. You should now find that your prechecks complete successfully and you can upgrade!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i3qIjrhPWuIWTfkD.png" /><figcaption>vIDM upgrade from 3.3.5 to 3.3.6 in progress</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c800b7724258" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating HTML email templates for vRealize Automation Code Stream]]></title>
            <link>https://medium.com/@mpoore/creating-html-email-templates-for-vrealize-automation-code-stream-c2150d023579?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2150d023579</guid>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Tue, 18 Jan 2022 15:00:17 GMT</pubDate>
            <atom:updated>2022-01-18T15:00:17.897Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>I have written several times before about the Packer process that I use to create VM images for my homelab. What I haven’t spent as much time on is the pipeline that I use to execute that process. Whilst I’m not going to dig deep in to that now, there was one aspect that I wanted to touch on as I think that it could be useful.</p><p>One of the drawbacks to my pipeline and the process in general is that if it fails for some reason it can take some time to diagnose and correct the issue. Partly that is because the pipeline cleans up after itself so that there aren’t lots of files left lying around taking up space. To make my life a little easier, I decided to experiment with adding an email notification to my pipeline.</p><p>Too many emails can be the bane of your life. But messages that convey information that is important to the reader in a succinct manner are always welcome. Even if they’re handled with a filter or rule that archives them, they are at least present somewhere for easy retrieval. In this post I look at how to create a well formatted email to help me understand the result of my Packer pipeline.</p><h4>BEE Free</h4><p><a href="https://beefree.io/">BEE Free</a> is an online tool for creating emails and landing pages using a drag and drop editor. I came across it while I was searching for information about creating HTML emails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tJiKYc3SvZSt0r0q.png" /><figcaption>BEE Free homepage</figcaption></figure><p>Unlike the modern web browser, many email clients still rely on antiquated rendering methods like HTML tables!</p><figure><img alt="surprise!" src="https://cdn-images-1.medium.com/proxy/0*cHSdYcVQnLdUMLhm" /><figcaption>Photo by <a href="https://unsplash.com/@xavi_cabrera?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Xavi Cabrera</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>I’d rather spend my time on something more valuable, so having a tool to create a simple framework for an email suits me just fine. The added bonus with BEE Free is that as well as a Pro plan, they let you use the tools for free although anything produced without registering will carry a footer containing some of their branding. For the ease of use however that is a price worth paying.</p><p>Of course there are some templates that you can start with, but I chose to use a blank canvas:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e5Xtrv5AJMnBSDH1.png" /><figcaption>Blank email template canvas in BEE Free</figcaption></figure><p>Here you can see the “Designed with BEE” footer already present along with drag and drop tools to add sections and content. This post isn’t going to be a detailed tutorial on how to build an email in this tool, it’s just the one that I chose to use and after a short time I was able to craft what I wanted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LiN6LNBrMEBhLqNl.png" /><figcaption>Packer pipeline result email template</figcaption></figure><p>It doesn’t look like much now, but much of the text will be replaced by Code Stream. Anything starting with a ‘$’ will be replaced by the value in curly braces after it.</p><h4>Placeholders</h4><p>You can work out what these placeholders will be based on the names of your pipeline’s <em>stages</em> and <em>tasks</em> and the value that you need. For example, let’s look at how I get the Packer log file content in the pipeline.</p><p>Packer is executed on a remote Linux host and Code Stream uses SSH to connect to it. There is a simple set of commands that the <em>Read Logfile</em> task executes to echo the logfile’s contents back to Code Stream.</p><pre>cd ${executionIndex}/builds/${input.packer_build}<br>while IFS= read -r line || [ -n &quot;$line&quot; ]<br>do<br>  echo &quot;$line&lt;br /&gt;&quot; &gt;&gt; $SCRIPT_RESPONSE_FILE<br>done &lt; packer.log</pre><p>Effectively the commands echo the logfile to the task’s output.response variable. We can then construct the placeholder using our knowledge of the pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rhJ2dKznRCzHAfCk.png" /><figcaption>Pipeline elements used to create a placeholder in the email template</figcaption></figure><p>In this case, our placeholder text becomes:</p><pre>${Build.Read Logfile.output.response}</pre><p>We can just place that where we want the logfile text to be placed in the email template.</p><h4>Export</h4><p>Once you have a template that you like the look of, you can export it and download the HTML source. The zip file that you get will include the HTML and any images or assets you’ve added to your template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u5eNxwrq7O4vT5Wd.png" /><figcaption>HTML source for the Packer pipeline email</figcaption></figure><p>I’d hate to have written that by hand!</p><h4>Code Stream Notification Setup</h4><p>Now that we have our email source, we can add it in to Code Stream. Once you have the pipeline open for editing, it’s just a matter of configuring notifications for it.</p><p>⚠️</p><p>For an email notification to work, you will have had to configure an email endpoint in Code Stream. For more information about how to do this, see the <a href="https://learncodestream.github.io/Configure/Endpoints/Email/">Email</a> page on the Learn Code Stream site.</p><p>When adding a notification, you can then just copy the HTML source from your template in to the configuration window, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/0*YMkGxszRKvS8toZD.png" /><figcaption>Notification configuration in Code Stream</figcaption></figure><p>Once the changes are saved you’re all good to go. Having kicked off a pipeline execution, I went off and did something else and was notified once it was done. Those placeholders in the email template were replaced by Code Stream using outputs from each of the stages of my pipeline. Here’s an example from my Windows 2022 build:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vk_Q49oMysiLbgWS.png" /><figcaption>Sample email sent by Code Stream</figcaption></figure><p>At a glance I can see that the build appeared to be successful. Had there been an error, particularly in the Packer task, I have the full log present to review with ease.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2150d023579" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to get BGP working on a UniFi Dream Machine Pro]]></title>
            <link>https://medium.com/@mpoore/how-to-get-bgp-working-on-a-unifi-dream-machine-pro-e5217e3adba4?source=rss-3d4d7478f28f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5217e3adba4</guid>
            <category><![CDATA[homelab]]></category>
            <category><![CDATA[vexpert]]></category>
            <dc:creator><![CDATA[Michael Poore]]></dc:creator>
            <pubDate>Fri, 14 Jan 2022 15:00:06 GMT</pubDate>
            <atom:updated>2022-01-14T15:00:06.456Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nc-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<p>I stayed up quite late the other night to get BGP working on my UniFi Dream Machine Pro (UDMP) and I thought I’d share how I did it as I know that at least two followers on Twitter are very interested.</p><p>But first, a little background…</p><p>The <a href="https://eu.store.ui.com/products/udm-pro">UDM Pro</a> was launched in early 2020, just before this darned pandemic started. It was positioned as a successor to the USG Pro 4 and a significant upgrade from the standard USG that I had as my internet gateway. It offered a handy 10GB SFP LAN port, which is what attracted my attention to it. As an existing UniFi user, switching my older USG to the UDM Pro enabled me to introduce 10GB networking to my homelab <em>and</em> keep the existing WiFi setup that I had at home too.</p><p>At the time that I bought it I knew that it didn’t have BGP (Border Gateway Protocol) available but I assumed that it would be added as a feature eventually as the USG Pro 4 had it. With the release of the 1.11.0 firmware recently I decided that the time had finally come to do something about it.</p><p>I had previously read that <a href="https://github.com/FRRouting/frr">FRRouting</a> could be configured to run on the UDMP and allow it to peer with other BGP enabled devices (such as an NSX-T Tier 0 edge) but there weren’t any clear instructions in a single place that I could follow so I had to piece it together myself.</p><h4>About the UDM Pro</h4><p>The UDMP is a 1U network device that includes both 1GB and 10GB WAN interfaces as well as 8x 1GB LAN ports and a 10GB LAN port. In addition to routing and switching, it includes some firewalling capabilities too. The UniFi OS that it runs enables a number of management “applications” to run that are used for network configuration and optionally network video recording, access control and IP telephony. I just use it for networking though.</p><p>Inside the UDMP there seems to be some Debian variant of Linux running and the applications that I mentioned above are actually executed in a container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VkxWAYaExZfuxcEx.png" /></figure><p>In the screenshot above you can see that I have two containers running. One is FRRouting and the other is the UniFi OS where the UniFi applications are running. To gain access to the device’s shell like this you need to have enabled SSH access and know the password. This is configured through the UDM’s settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xgQpY5-1lqIPVoX6.png" /><figcaption>UDMP settings showing SSH enabled</figcaption></figure><p>To see the running containers once you have connected via SSH, you simply need the following command:</p><pre>podman ps</pre><p><strong>WARNING: Please be careful in here. You can break things. I took a risk working this out for myself but I can’t take responsibility if it doesn’t work for anyone else for some reason.</strong></p><p>Ok. Now that we have access, let’s get down to business…</p><h4>UDM-Utilities</h4><p>The first thing we’ll need to do is install something called <a href="https://github.com/boostchicken-dev/udm-utilities/tree/master/on-boot-script"><em>UDMPro Boot Script</em></a>. This utility was created by someone who wanted to make some tweaks or changes to their UDMP that would persist through reboots and firmware updates. The utility allows you to place shell scripts under /mnt/data and have them executed at boot time.</p><p>Assuming that you have connected via SSH already, you’ll need to then drop in to the UniFi OS shell by typing:</p><pre>unifi-os shell</pre><p>The command line prompt should change to root@ubnt:/# at this point. The best approach is to then follow the instructions in the GitHub repository linked above. At the time of writing all that was required was to enter the following:</p><pre>curl -L https://udm-boot.boostchicken.dev -o udm-boot_1.0.5_all.deb<br>dpkg -i udm-boot_1.0.5_all.deb<br>exit</pre><p>The first line downloads the package. The second installs it. The exit command leaves the unifi-os shell.</p><h4>FRRouting Preparation</h4><p>Before we download / start FRRouting, I’m going to cover the two configuration files needed to get it running. Both of these will be stored under /mnt/data so that they persist through reboots and firmware updates.</p><p>From your SSH prompt, create the required directory:</p><pre>mkdir -p /mnt/data/frr</pre><p>In to this directory we need to create the following two files:</p><h4>daemons</h4><p>This file determines which features or functions of FRRouting will be enabled. By default everything is disabled. The content of the file is covered in the <a href="http://docs.frrouting.org/en/latest/setup.html#daemons-configuration-file">documentation</a> but you just need to take the defaults and ensure that BGP is enabled by setting</p><pre>bgpd=yes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A9NRrackQSc69C27.png" /><figcaption>Daemons file for FRRouting with bgpd enabled</figcaption></figure><h4>bgpd.conf</h4><p>This file contains the configuration for the BGP daemon itself. I’m no expert when it comes to BGP so I’ve started off with a fairly simple configuration, as follows:</p><pre>! -*- bgp -*-<br>hostname ukw-p-rtr-01<br>frr defaults datacenter<br>log file stdout<br>service integrated-vtysh-config<br>!<br>!<br>router bgp 65000<br> bgp router-id 192.168.1.1<br> neighbor 192.168.1.254 remote-as 65001<br> !<br> address-family ipv4 unicast<br>  redistribute connected<br>  redistribute kernel<br>  neighbor V4 soft-reconfiguration inbound<br>  neighbor V4 route-map ALLOW-ALL in<br>  neighbor V4 route-map ALLOW-ALL out<br> exit-address-family<br> !<br>route-map ALLOW-ALL permit 10<br>!<br>line vty<br>!</pre><p>The important parts to have synchronised with NSX-T are the router ID and the AS numbers. Again the <a href="http://docs.frrouting.org/en/latest/bgp.html">documentation</a> contains more about all of the options.</p><p>Once these files are created, and making sure that they have 644 permissions, you can move on to FRRouting itself.</p><h4>Installing / Starting FRRouting</h4><p>If you’re a dab hand with Ansible then you could do a lot of this with an Ansible role that has been created for the UDMP and is <a href="https://github.com/mabunixda/ansible-udmp">available on GitHub</a>. If you’re not comfortable with that, then you just need one of the files from that repository to get going. The file in question is <a href="https://github.com/mabunixda/ansible-udmp/blob/main/files/10-onboot-frr.sh">10-onboot-frr.sh</a>. I have reproduced it here for clarity but all credit goes to <a href="https://github.com/mabunixda">Martin Buchleitner</a>.</p><pre>#!/usr/bin/env sh<br><br>DEBUG=${DEBUG:--d}<br>CONTAINER_NAME=&quot;frr&quot;<br><br>if podman container exists ${CONTAINER_NAME}; then<br>  podman start ${CONTAINER_NAME}<br>else<br>  podman run --mount=&quot;type=bind,source=/mnt/data/$CONTAINER_NAME,destination=/etc/frr/&quot; \<br>            --name &quot;$CONTAINER_NAME&quot; \<br>            --network=host \<br>            --privileged \<br>            --restart always \<br>            $DEBUG \<br>            docker.io/frrouting/frr:v8.1.0<br>fi</pre><p>This file needs to be placed in the directory /mnt/data/on_boot.d and needs to be made executable. I think that 744 permissions should be sufficient although I have it set to 755.</p><p>That should be all you need. You can either restart your UDMP or run the script manually. Either way, the container should be downloaded and started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AvagNdTFdf8L1y4X.png" /><figcaption>Podman output showing running containers</figcaption></figure><p>Once it’s running, you can “enter” it to check BGP’s status.</p><h4>Check BGP Status</h4><p>To connect to the BGP daemon and check the status of it, you run the following podman command:</p><pre>podman exec -it frr vtysh</pre><p>This will connect you to the shell running inside the container and allow you to interrogate BGP in much the same way as you would with any other network device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vq2nE51rwZE1E7Y2.png" /></figure><p>For example, to show the BGP neighbors and status use the following:</p><pre>show ip bgp neighbor</pre><p>Further down the screenshot below, you should be able to see that there are updates being sent and received.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*g0IdPw5mbbjshDmc.png" /></figure><p>The same can be seen in NSX-T.</p><p>Hope this helps…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5217e3adba4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>