<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Orchestrator on Neale&#39;s Corner</title>
        <link>https://enlow.co.uk/categories/orchestrator/</link>
        <description>Recent content in Orchestrator on Neale&#39;s Corner</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Mon, 19 Aug 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://enlow.co.uk/categories/orchestrator/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Enabling SSH on ESXi with vRO</title>
        <link>https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/</link>
        <pubDate>Mon, 19 Aug 2019 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/</guid>
        <description>&lt;p&gt;I think it is a good rule of thumb that the security maturity of the organisation can be measured by whether SSH is left enabled (with warnings muted) or disabled on ESXi Hosts. As there is a warning on the host if the service is enabled, and the hardening guides recommend that it is disabled, there is little doubt that this disabled state is VMware&amp;rsquo;s preference and a security best practice.&lt;/p&gt;
&lt;p&gt;So how do we enable SSH on ESXi ? I am assuming that the only accessible interface is the Web Client, as access to the console is likely restricted too - perhaps the hosts are in lockdown mode ? We have a few options..&lt;/p&gt;
&lt;h3 id=&#34;web-client&#34;&gt;Web Client
&lt;/h3&gt;&lt;p&gt;This is a little bit convoluted. We need to follow the steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the host on which to enable/disable SSH.&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Configure&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Security Profile&lt;/strong&gt; menu option.&lt;/li&gt;
&lt;li&gt;*Optional: Minimise one or both &lt;strong&gt;Firewall&lt;/strong&gt; sections (Incoming Connections and Outgoing Connections).&lt;/li&gt;
&lt;li&gt;*Optional: Scroll down to the &lt;strong&gt;Services&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Press the Edit button in the &lt;strong&gt;Services&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;SSH&lt;/strong&gt; entry in the list.&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Start&lt;/strong&gt; or &lt;strong&gt;Stop&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The * noted items are for vCenter 6.5 or earlier. In vCenter 6.7 the Services panel is moved to the top of the Security Profile section.&lt;/p&gt;
&lt;p&gt;The menu to manipulate the service looks as below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image.png&#34;
	width=&#34;709&#34;
	height=&#34;399&#34;
	srcset=&#34;https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image_hu_613ed0ebf7dc8765.png 480w, https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image_hu_b8712b4a17a95717.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;177&#34;
		data-flex-basis=&#34;426px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;In summary, this is quite a bit of work to enable the service on only one host. Next we&amp;rsquo;ll look at how to do the same on the HTML5 Client.&lt;/p&gt;
&lt;h3 id=&#34;html5-client&#34;&gt;HTML5 Client
&lt;/h3&gt;&lt;p&gt;The steps required to enable/disable SSH on a host using the HTML5 client are as follows:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select the host on which to enable/disable SSH.&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Configure&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Services&lt;/strong&gt; menu option.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;SSH&lt;/strong&gt; entry in the list.&lt;/li&gt;
&lt;li&gt;Press the &lt;strong&gt;Start&lt;/strong&gt; button&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are fewer steps in the list compared to the Flex client, however this is still onerous when having to work with multiple hosts. The section for changing service state in this client looks as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image-1.png&#34;
	width=&#34;503&#34;
	height=&#34;230&#34;
	srcset=&#34;https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image-1_hu_4d6a8d6e03f709ce.png 480w, https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image-1_hu_c140d138dcbbef8b.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;218&#34;
		data-flex-basis=&#34;524px&#34;
	
&gt;&lt;/p&gt;
&lt;h3 id=&#34;vrealize-orchestrator&#34;&gt;vRealize Orchestrator
&lt;/h3&gt;&lt;p&gt;Ah, so we&amp;rsquo;ve got to the real reason of why I&amp;rsquo;m writing this post ! With past experience I&amp;rsquo;ve needed to use SSH to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;troubleshoot on a single host&lt;/li&gt;
&lt;li&gt;perform maintenance/change on every host in the cluster.&lt;/li&gt;
&lt;li&gt;disable SSH on host as someone else left it enabled and the timeout value hasn&amp;rsquo;t been set properly.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This identifies that we need workflows to enable and disable the service for a host, and for every host in a cluster.&lt;/p&gt;
&lt;p&gt;However, thinking about this, if a host typically has SSH disabled then the shell/ssh enabled warning will not be suppressed - so you will know whether SSH is enabled or not. So, we will also have a workflow that toggles the service between enabled/disabled on a host - purely as a way of presenting fewer options to the end user so the vRealize Orchestrator submenu is kept as trim as necessary :)&lt;/p&gt;
&lt;p&gt;Our approach to the cluster can re-use some of this - in a best case scenario the service is in the opposite of the desired state for every host in the cluster - i.e. if we want to enable, then the state of every host&amp;rsquo;s service is disabled. However we must also account for the possibility that the service is enabled on some hosts and disabled on others. Conversely, if the SSH service has been left enabled on a few hosts in a big cluster and we want to disable them, it could be easier to do in a single cluster workflow rather than running a workflow per host. A toggle workflow will not work here - we want to explicitly set the state of the service for all hosts in the cluster - whether enabled or disabled - otherwise we could end up reversing the state. From the point of the user - they know what end state they want, let&amp;rsquo;s get them there !&lt;/p&gt;
&lt;p&gt;This leaves us with one last architecture decision between:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A workflow for enable and a workflow for disable.&lt;/li&gt;
&lt;li&gt;A single workflow with a boolean parameter that defines enable/disable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Honestly, I don&amp;rsquo;t think there is much between the two, both are good and reasonable choices. I decided to go with the top option for the reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The workflow can be invoked remotely with less parameters.&lt;/li&gt;
&lt;li&gt;Flex WebClient integration will allow the workflow to be immediately run with less clicks.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;building-the-workflow&#34;&gt;Building the workflow
&lt;/h4&gt;&lt;p&gt;The following code block will enumerate the services available on the host, and if the SSH service is not running, start it.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;services&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;host&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;configManager&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;serviceSystem&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;serviceInfo&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;service&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;svc&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;services&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;svc&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;key&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;TSM-SSH&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;current_state&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;svc&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;running&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;true&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;current_state&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;host&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;configManager&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;serviceSystem&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;startService&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;TSM-SSH&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Conversely, to stop the service, most the above is identical, except for the innermost conditional block:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		if (current_state == true)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		{
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			host.configManager.serviceSystem.stopService(&amp;#34;TSM-SSH&amp;#34;);
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Our toggle code can be written as:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		if (current_state == false)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		{
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			host.configManager.serviceSystem.startService(&amp;#34;TSM-SSH&amp;#34;);
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		}
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		else if (current_state == true)
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		{
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			host.configManager.serviceSystem.stopService(&amp;#34;TSM-SSH&amp;#34;);
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		}		
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		break;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The workflows for the cluster follow a typical pattern:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get all the hosts in the cluster&lt;/li&gt;
&lt;li&gt;Call the appropriate workflow for each host&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The workflow schema looks as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image-2.png&#34;
	width=&#34;511&#34;
	height=&#34;98&#34;
	srcset=&#34;https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image-2_hu_53261eb3c5148b47.png 480w, https://enlow.co.uk/p/enabling-ssh-on-esxi-with-vro/images/image-2_hu_37ccd1da3e0b6688.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;521&#34;
		data-flex-basis=&#34;1251px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;As can be seen, we use a built-in action to get all the hosts in a cluster, and the builtin workflow loop object to run a workflow for every host in the array.&lt;/p&gt;
&lt;p&gt;In the workflows I also check the connection state of the host - there is no point trying to change the service state on a host that is disconnected !&lt;/p&gt;
&lt;h4 id=&#34;download&#34;&gt;Download
&lt;/h4&gt;&lt;p&gt;If your browser renames the file, you are free to change the file extension to &amp;ldquo;.package&amp;rdquo; (the import may still work if you do not). The file is an exported vRO package (from version 7.5) and is ready for import onto your server.&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://enlow.co.uk/wp-content/uploads/2019/08/uk.co.enlow.vmware.ssh.package&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Click this link to download the package.&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;</description>
        </item>
        <item>
        <title>Managing a DRS group with vRealize Orchestrator</title>
        <link>https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/</link>
        <pubDate>Mon, 25 Mar 2019 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/</guid>
        <description>&lt;p&gt;The use case for this challenge was a small (8-10 ESXi hosts) cluster, that only a subset of servers were &amp;lsquo;assigned&amp;rsquo; with Windows datacenter licenses - so in order to maintain compliance all the Windows VMs would need to run on those hosts. The natural choice for ensuring this happens is a &amp;ldquo;must run&amp;rdquo; DRS rule between a group of VMs and a group of hosts and the automation step for this is ensuring that the VM group is accurate by only containing VMs that are still in the cluster and contains all Windows VMs in the cluster. Thus, the plan is use vRealize Orchestrator to manage the DRS group.&lt;/p&gt;
&lt;p&gt;This technique (and workflow) will be left open enough for it to be used with any type of Operating System, after all I believe Red Hat also license on a per-hypervisor basis.&lt;/p&gt;
&lt;h4 id=&#34;core&#34;&gt;Core
&lt;/h4&gt;&lt;p&gt;The schema of the workflow is pictured below.&lt;/p&gt;
&lt;figure&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/images/image-13-1024x213.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
	
&gt;&lt;/p&gt;
&lt;figcaption&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The flow is one of the simplest we can make ! The steps are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Retrieve the configuration variables from the ConfigurationElement.&lt;/li&gt;
&lt;li&gt;Get the VMs from the cluster (exit the workflow if it has none).&lt;/li&gt;
&lt;li&gt;Get the DRS Group from the name (exit if it does not exist).&lt;/li&gt;
&lt;li&gt;Loop through the VMs and add/remove them to the DRS group as necessary.&lt;/li&gt;
&lt;li&gt;Send an email report if changes are made.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It has a single input of a ConfigurationElement, with the following variables. The description should make it apparent what each variable is used for.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/images/image-14.png&#34;
	width=&#34;778&#34;
	height=&#34;132&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/images/image-14_hu_5d4003f78d3f6dd0.png 480w, https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/images/image-14_hu_78786cfcb17a2ce4.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;589&#34;
		data-flex-basis=&#34;1414px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The magic of the workflow is the updating of the DRS rule, which the below script covers:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/images/image-16.png&#34;
	width=&#34;481&#34;
	height=&#34;275&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/images/image-16_hu_54ec3002e9fbd3f5.png 480w, https://enlow.co.uk/p/managing-a-drs-group-with-vrealize-orchestrator/images/image-16_hu_ac0747f4fcc18b3f.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;174&#34;
		data-flex-basis=&#34;419px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;where-next&#34;&gt;Where next
&lt;/h4&gt;&lt;p&gt;As it stands now, we can schedule the workflow to run at the end of the day and allow DRS to place the VMs correctly.&lt;/p&gt;
&lt;p&gt;However, to really ensure that the VM is running on the correct host we would invoke this workflow on every creation and addition to the cluster. This is possible when using LogInsight - configured as a destination for the ESXi hosts&amp;rsquo; syslogs - to call Orchestrator via a Webhook when the appropriate events are received.&lt;/p&gt;
&lt;p&gt;Now that we can dynamically change a DRS rule, this is starting to open up possibilities. Stay tuned :)&lt;/p&gt;
&lt;h4 id=&#34;summary&#34;&gt;Summary
&lt;/h4&gt;&lt;p&gt;You can download the workflow package using the button below. Please let me know if you found this useful !&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;http://enlow.co.uk/wp-content/uploads/2019/03/uk.co_.enlow_.drs_.package&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;&lt;br&gt;
&lt;/a&gt;&lt;a class=&#34;link&#34; href=&#34;http://enlow.co.uk/wp-content/uploads/2019/03/uk.co_.enlow_.drs_.package&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Download package file&lt;/a&gt;&lt;/p&gt;</description>
        </item>
        <item>
        <title>Updating a HP iLO using Rest API and vRealize Orchestrator</title>
        <link>https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/</link>
        <pubDate>Mon, 18 Mar 2019 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/</guid>
        <description>&lt;p&gt;A security vulnerability against Hewlett Packard iLOs was announced last year (link - &lt;a class=&#34;link&#34; href=&#34;https://www.rapid7.com/db/modules/auxiliary/admin/hp/hp_ilo_create_admin_account&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://www.rapid7.com/db/modules/auxiliary/admin/hp/hp_ilo_create_admin_account&lt;/a&gt;), along with the required firmware to patch. No doubt there are some amazing tools by HP that will allow firmware to be patched across an estate, but as I don&amp;rsquo;t have access to them I need to find another way to get firmware out to 20+ servers.&lt;/p&gt;
&lt;p&gt;There is an API (documentation at &lt;a class=&#34;link&#34; href=&#34;https://hewlettpackard.github.io/ilo-rest-api-docs/ilo4/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://hewlettpackard.github.io/ilo-rest-api-docs/ilo4/&lt;/a&gt;) which is quite straight forward to use, so we&amp;rsquo;ll have a look at using Postman to update an iLO and then use vRealize Orchestrator to implement a workflow.&lt;/p&gt;
&lt;h4 id=&#34;using-postman&#34;&gt;Using Postman
&lt;/h4&gt;&lt;p&gt;Throughout this I will be using the headers below, though the second one is only required when updating the firmware.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ea3b6ffa8.png&#34;
	width=&#34;538&#34;
	height=&#34;53&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ea3b6ffa8_hu_d497410c5ea35e3e.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ea3b6ffa8_hu_aa5948b3526b066d.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;1015&#34;
		data-flex-basis=&#34;2436px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;To start, we&amp;rsquo;ll ask the iLO for a Manager interface, which will provide links to the services it offers. Authentication is handled by the headers on a per-request basis. We won&amp;rsquo;t need to manage session or tokens :)&lt;/p&gt;
&lt;p&gt;The initial request is a GET to https://&amp;lt;FQDN/IP&amp;gt;/redfish/v1/managers/ as below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5e98da20e8.png&#34;
	width=&#34;836&#34;
	height=&#34;581&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5e98da20e8_hu_8f19e856d5cfbc0a.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5e98da20e8_hu_1e67e038247ff7c1.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;143&#34;
		data-flex-basis=&#34;345px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The data returned contains an array with the name &amp;ldquo;Members&amp;rdquo; that will point to the URL for the manager for the iLO. We&amp;rsquo;re going to use that to get the details for the manager - there is a lot of data here so I&amp;rsquo;m not going to post it all. There are two points of interest for us - firstly the current firmware version:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ea96db8af.png&#34;
	width=&#34;272&#34;
	height=&#34;157&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ea96db8af_hu_9cdaf4a765c1ee06.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ea96db8af_hu_9f939eb64653f864.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;173&#34;
		data-flex-basis=&#34;415px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Secondly the links to services - we are interested in the UpdateService.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5eaecef4ce.png&#34;
	width=&#34;460&#34;
	height=&#34;452&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5eaecef4ce_hu_f15fc58704d95963.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5eaecef4ce_hu_d2ced477cfce2b78.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;101&#34;
		data-flex-basis=&#34;244px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;We will use the location provided to access the service - which will allow the current firmware status to be retrieved and an update to be triggered.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5eb7cdba9c.png&#34;
	width=&#34;788&#34;
	height=&#34;509&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5eb7cdba9c_hu_e765b4d6726baf53.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5eb7cdba9c_hu_5b51c3d78971ac19.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;154&#34;
		data-flex-basis=&#34;371px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The documentation has some reference on what to do - &lt;a class=&#34;link&#34; href=&#34;https://hewlettpackard.github.io/ilo-rest-api-docs/ilo4/#links-updateuri-extref-and-links-updateuri-extref&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://hewlettpackard.github.io/ilo-rest-api-docs/ilo4/#links-updateuri-extref-and-links-updateuri-extref&lt;/a&gt; - which is pictured below.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ed00a4bfa.png&#34;
	width=&#34;240&#34;
	height=&#34;261&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ed00a4bfa_hu_c6f17de2e5aa61fd.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ed00a4bfa_hu_aadaac0b853b745e.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;91&#34;
		data-flex-basis=&#34;220px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;However, other documentation at http://h22208.www2.hpe.com/eginfolib/servers/docs/HPRestfultool/iLo4/data_model_reference.html#HpiLOFirmwareUpdate details the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5edaee7ecb.png&#34;
	width=&#34;780&#34;
	height=&#34;402&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5edaee7ecb_hu_5acb0efc95e118d8.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5edaee7ecb_hu_637885d8a355b4fc.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;194&#34;
		data-flex-basis=&#34;465px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;This explains we&amp;rsquo;ll need to include an &amp;ldquo;Action&amp;rdquo; parameter in our request. To update the iLO we will need to host the firmware on a webserver that is accessible from the iLO address - this blog entry isn&amp;rsquo;t going to cover how to do this (I&amp;rsquo;m assuming that you&amp;rsquo;ve got a webserver to hand and you&amp;rsquo;re allowing the extension/content-type to be downloaded. Remember to test it manually before trying to automate, especially if your environment is subject to network controls)&lt;/p&gt;
&lt;p&gt;Our POST request body will look as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ef28893b9.png&#34;
	width=&#34;493&#34;
	height=&#34;214&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ef28893b9_hu_f06530d1e4bc1367.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc5ef28893b9_hu_af0f633e35ff6de9.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;230&#34;
		data-flex-basis=&#34;552px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The iLO will restart when complete - there is no need to manually trigger this, though it is generally a good idea to ensure it has completed. To do this, we will call the GET request to the UpdateService/ URL and check the &amp;ldquo;State&amp;rdquo; value - it will change to the following values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;UPDATING&lt;/li&gt;
&lt;li&gt;COMPLETED&lt;/li&gt;
&lt;li&gt;(The request will fail when the iLO automatically restarts)&lt;/li&gt;
&lt;li&gt;IDLE&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So if we get a value of COMPLETED or IDLE then we can check the iLO version. However, given that a value of COMPLETED will follow with a period of silence it is more prudent to wait for the IDLE - which I believe we will also receive in the result of failure.&lt;/p&gt;
&lt;h3 id=&#34;using-vrealize-orchestrator&#34;&gt;Using vRealize Orchestrator
&lt;/h3&gt;&lt;p&gt;Now to find a way to put the above into Orchestrator - the workflow to upgrade an iLO is:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60c9b8427b.png&#34;
	width=&#34;1324&#34;
	height=&#34;506&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60c9b8427b_hu_91dad65412a873a9.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60c9b8427b_hu_e0db6b6bf3813ebb.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;261&#34;
		data-flex-basis=&#34;627px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The workflow has the following inputs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60d6498f61.png&#34;
	width=&#34;779&#34;
	height=&#34;246&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60d6498f61_hu_976ed18640662a07.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60d6498f61_hu_9dd39b25b8c61cc0.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;316&#34;
		data-flex-basis=&#34;760px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The check version value will, if set to true, retrieve the version from the iLO and compare it to the values in the new_major and new_minor fields. If the firmware version on the iLO is newer then the firmware installation will not proceed. This check is dependent on human accuracy as there is no way of reliably retrieving the firmware version from the file, thus if the incorrect version is entered then installation will fail.&lt;/p&gt;
&lt;p&gt;The heart of using vRO to drive this process is dynamically creating REST hosts in code, sending the requests and dealing with the response. Taking a look in the vRO workflow &amp;ldquo;Invoke a dynamic REST operation&amp;rdquo; we can see how VMware have done it:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/images/img_5bc60e877ecc8-1024x209.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
	
&gt;&lt;/p&gt;
&lt;p&gt;The important things to note are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We need to create a REST Host object, and then use it to create a transient host.&lt;/li&gt;
&lt;li&gt;We need to specify the base url and authentication on the transient host object.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;However if we invoke a REST call over HTTPS without importing the certificate it will fail, so we will need to handle this failure by importing the certificate and re-running the REST invocation.&lt;/p&gt;
&lt;p&gt;This is handled by the Import Cert ?/Import a certificate/Log Cert Import elements. This is done by catching the exception that is thrown.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60f4848f98.png&#34;
	width=&#34;1228&#34;
	height=&#34;218&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60f4848f98_hu_a0ab6e092094ee9b.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5bc60f4848f98_hu_e92be2955487afe3.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;563&#34;
		data-flex-basis=&#34;1351px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;We now need to can connect to the manager address and find out the location of the UpdateService service - which we did earlier in Postman. Doing this in some javascript looks like the following:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7efc986cc.png&#34;
	width=&#34;1230&#34;
	height=&#34;534&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7efc986cc_hu_ef95c81cbd20ecf9.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7efc986cc_hu_8e54a57fcc6420eb.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;230&#34;
		data-flex-basis=&#34;552px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The main part of this workflow is upgrading the firmware - we need to POST the update:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7f6a7ac3b.png&#34;
	width=&#34;1380&#34;
	height=&#34;262&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7f6a7ac3b_hu_3e574656e70ffb8a.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7f6a7ac3b_hu_f5d235398b18b135.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;526&#34;
		data-flex-basis=&#34;1264px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;And then loop until we reach the IDLE state. When we exit the loop we can check if the version is different from before we started the process. This will give us our success/failure result to return to the user. The loop is as below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7f892ee2b.png&#34;
	width=&#34;1293&#34;
	height=&#34;666&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7f892ee2b_hu_292b607d71ea5211.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7f892ee2b_hu_a419c2f611cc4ed7.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;194&#34;
		data-flex-basis=&#34;465px&#34;
	
&gt;&lt;/p&gt;
&lt;h3 id=&#34;wrapping-it-up-&#34;&gt;Wrapping it Up !
&lt;/h3&gt;&lt;h4 id=&#34;updating-multiple-ilos&#34;&gt;Updating multiple iLOs
&lt;/h4&gt;&lt;p&gt;This is quite straight forward - there are two approaches.&lt;/p&gt;
&lt;p&gt;The first one will duplicate the workflow and then adjust the input to take an array of addresses (This does however mean that the credentials to access the iLO must be the same). The schema will be changed to loop through the addresses.&lt;/p&gt;
&lt;p&gt;The second approach is the one I favour - we create a new workflow which has duplicate inputs, with the exception of an addition for an array of addresses. The workflow loops through the addresses and calls our original workflow with the other inputs. This method means that we only have one workflow which contains the code that upgrades the iLO, so there is less to manage/maintain.&lt;/p&gt;
&lt;p&gt;The workflow in this case will look like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7ca56b8be.png&#34;
	width=&#34;775&#34;
	height=&#34;380&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7ca56b8be_hu_c693e5a6901dc9b0.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7ca56b8be_hu_403db8c135b17252.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;203&#34;
		data-flex-basis=&#34;489px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;with the following inputs:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7cd162439.png&#34;
	width=&#34;723&#34;
	height=&#34;349&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7cd162439_hu_bc753960779340e7.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7cd162439_hu_df4af61d02a12dbb.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;207&#34;
		data-flex-basis=&#34;497px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;updating-an-esxi-cluster-using-a-custom-attribute&#34;&gt;Updating an ESXi Cluster using a custom attribute
&lt;/h4&gt;&lt;p&gt;To take this a step further, each ESXi host has a custom attribute with the address of its iLO (work Host so address is blanked):&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7dde6fd08.png&#34;
	width=&#34;581&#34;
	height=&#34;218&#34;
	srcset=&#34;https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7dde6fd08_hu_e4e1d3065476a2fa.png 480w, https://enlow.co.uk/p/updating-a-hp-ilo-using-rest-api-and-vrealize-orchestrator/images/img_5c0e7dde6fd08_hu_e709322125d86c12.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;266&#34;
		data-flex-basis=&#34;639px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;A workflow is created that will get all the hosts in the cluster, and for each host retrieve the custom attribute. If a value exists, then the original workflow is called to upgrade the firmware. This workflow will only upgrade one physical server at a time, even though there is (or should not be) any impact on the running workloads. It&amp;rsquo;s just less risky, and isn&amp;rsquo;t that what our job is really about ? ;)&lt;/p&gt;
&lt;p&gt;The challenge here will be ensuring that hosts have a completed (and valid) address for the iLO.&lt;/p&gt;
&lt;h4 id=&#34;vsphere-client-integration&#34;&gt;vSphere Client Integration
&lt;/h4&gt;&lt;p&gt;Still using the Flash Client because it allows you to call vRealize Orchestrator workflows ? Yep, me too. We can export the workflows we&amp;rsquo;ve created here to make them available on the context menu for hosts and clusters - thus making the upgrade even easier !&lt;/p&gt;
&lt;h4 id=&#34;further-automation--improvements&#34;&gt;Further Automation / Improvements
&lt;/h4&gt;&lt;p&gt;Taking this further would be to wrap this in an interface (custom HTTP, ansible, etc) that allows end users to provide the firmware file and the host(s) or cluster(s) to upgrade.&lt;/p&gt;
&lt;p&gt;This is beyond the scope of this post, but could be provisioned through your DevOps platform of choice. Let me know your thoughts on this one !&lt;/p&gt;
&lt;h3 id=&#34;summary&#34;&gt;Summary
&lt;/h3&gt;&lt;p&gt;The workflow(s) and associated actions/etc are all available to download via the button below.&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;http://enlow.co.uk/wp-content/uploads/2019/03/uk.co_.enlow_.hp_.ilo_.package&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Download package file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope you&amp;rsquo;ve found this useful, please let me know your feedback and whether it helped. Thanks for reading :)&lt;/p&gt;</description>
        </item>
        <item>
        <title>Managing Snapshots with vRO</title>
        <link>https://enlow.co.uk/p/managing-snapshots-with-vro/</link>
        <pubDate>Mon, 25 Feb 2019 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/managing-snapshots-with-vro/</guid>
        <description>&lt;p&gt;One of the main issues that face departments on their virtualisation journey is how they are managing snapshots:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Who can take them&lt;/li&gt;
&lt;li&gt;Who can delete them&lt;/li&gt;
&lt;li&gt;How long do they stick around for&lt;/li&gt;
&lt;li&gt;Name/Description formatting policy&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I consider them &amp;rsquo;low hanging fruit&amp;rsquo; on the management tree - how an organisation approaches this is defined by policy and there shouldn&amp;rsquo;t be anything too contentious involved. There are also options to have the snapshots deleted automatically, with most management software providing the function. If you don&amp;rsquo;t have this, then a vSphere alarm can be created to warn on snapshots sizes.&lt;/p&gt;
&lt;p&gt;There was no option to automatically remove snapshots that was in accordance with the policy that was agreed at a previous role, so it was time to automate something :). One of the items revolved around communication to the snapshot owner - it is very important to inform them that the snapshot will be automatically removed and when it has been. Another item was where some snapshots that might be automatically cleared up would need to be held for longer - perhaps as a part of a Root Cause Analysis investigation.&lt;/p&gt;
&lt;h4 id=&#34;requirements&#34;&gt;Requirements
&lt;/h4&gt;&lt;p&gt;From the above, the requirements are this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Inform the user who took the snapshot that it will be deleted in X days, daily until deleted. (X should be configurable).&lt;/li&gt;
&lt;li&gt;Inform the user that the snapshot has been deleted.&lt;/li&gt;
&lt;li&gt;Report to a team/email address details on all snapshots present and estimate the space use.&lt;/li&gt;
&lt;li&gt;Exclude Virtual Machines from having their snapshots automatically deleted.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These will mean that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The workflow will always produce a report. Therefore our input values should include an email address.&lt;/li&gt;
&lt;li&gt;A means of identifying a Virtual Machine as being excluded. We could supply a list, or a naming format to match, a tag or a custom attribute.&lt;/li&gt;
&lt;li&gt;Given that we can retrieve the username of the person who created the snapshot (it is contained within the event), we still need a means of identifying the email address of the user.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;My preference for the second item above is to use a tag as we can retrieve VMs easier from a management perspective.&lt;/p&gt;
&lt;p&gt;The identity source for the vCenter is assumed to be Active Directory, thus we would have the further assumption that no local accounts are allowed (or only in exceptional circumstances) and will be taking snapshots. We can therefore use the Active Directory plugin to query for the user and retrieve the email address. However we should also handle the edge case that the user does not have an email address set, or it is not valid - therefore we will issue warning emails to an appropriate team that the end user was not/cannot be warned of the snapshot expiry.&lt;/p&gt;
&lt;p&gt;In summary, our input values are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;# Days when start to warn end users of deletion.&lt;/li&gt;
&lt;li&gt;# Days when the snapshot should be deleted.&lt;/li&gt;
&lt;li&gt;Email address in case of errors.&lt;/li&gt;
&lt;li&gt;Email address for the report.&lt;/li&gt;
&lt;li&gt;Tag name for VMs to be excluded from snapshot management.&lt;/li&gt;
&lt;li&gt;A &amp;lsquo;WhatIf&amp;rsquo; to control whether action is taken.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our vRO server will also need to have the Active Directory plugin active and configured.&lt;/p&gt;
&lt;p&gt;We also need to deal with another assumption - there can be more than one snapshot on a VM, and multiple snapshots may need to be deleted on each day.&lt;/p&gt;
\[Hindsight\]&lt;p&gt;&lt;br&gt;
After creating the workflows I added another couple of inputs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Minimum age of VM snapshot to appear on the report.&lt;/li&gt;
&lt;li&gt;Subject of the report.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;workflows&#34;&gt;Workflows
&lt;/h4&gt;&lt;p&gt;I write vRO workflows in a decentralised manner - for example if I am to do something with a Virtual Machine I have a workflow for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The Virtual Machine&lt;/li&gt;
&lt;li&gt;The Cluster&lt;/li&gt;
&lt;li&gt;(Sometimes) The Datacenter&lt;/li&gt;
&lt;li&gt;vCenter Server&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This can add up to a lot of workflows, but it allows for testing and iterating changes easily. I will often put a &amp;ldquo;WhatIf&amp;rdquo; input on the Virtual Machine workflow so that I can test the workflows that function at a higher level - this ties in with the identified inputs earlier. So in this case, the workflow design mirrors the above (but without a datacenter script).&lt;/p&gt;
&lt;p&gt;Additionally, when communicating to people the details of a VM with a snapshot I include Custom Attributes and Tags. So the workflows below will contain some tagging actions that I really need to release ;)&lt;/p&gt;
&lt;h5 id=&#34;virtual-machine&#34;&gt;Virtual Machine
&lt;/h5&gt;&lt;p&gt;This workflow will need to do the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get the snapshot information for a VM.&lt;/li&gt;
&lt;li&gt;Calculate snapshot size (if possible).&lt;/li&gt;
&lt;li&gt;Get the tags for a VM.&lt;/li&gt;
&lt;li&gt;Add information to the report.&lt;/li&gt;
&lt;li&gt;Check the tag to see if the VM will have it&amp;rsquo;s snapshots automatically managed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If the VM is to be automatically managed, it will need to do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If the snapshot is older than the warning age, send a warning to the snapshot creator, or the errors address.&lt;/li&gt;
&lt;li&gt;If the snapshot is older than the deletion age, send a notification to the snapshot creator, or the errors address.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;ve separate the above into two lists as I think the logic flows naturally in this way - the first list will apply to every VM that we examine whereas the second will only apply to those VMs with snapshots that we will manage. Thus we can break the logic up into two workflows.&lt;/p&gt;
&lt;p&gt;Disclaimer: I&amp;rsquo;m assuming some familiarity with Orchestrator here, and there are plenty of other awesome blogs introducing the tool, so I&amp;rsquo;m going to dive in to some completed workflows.&lt;/p&gt;
&lt;p&gt;The schema for the first flow is below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image.png&#34;
	width=&#34;951&#34;
	height=&#34;778&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image_hu_ca228819a2854b6.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image_hu_ac8532ac801bd852.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;122&#34;
		data-flex-basis=&#34;293px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Some notable steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Excluded from snaps - This is where the tag is checked.&lt;/li&gt;
&lt;li&gt;Automatic Management - This is where the WhatIf is handled.&lt;/li&gt;
&lt;li&gt;Manage Snapshots - We call the workflow to manage them. This sits inside a loop that will examine all the snapshots on a VM.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Some scripts are included to help with generating the report :)&lt;/p&gt;
&lt;p&gt;The schema for Managing Snapshots is here:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-1.png&#34;
	width=&#34;785&#34;
	height=&#34;627&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-1_hu_f12000405c04baea.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-1_hu_29889c44363e0dcd.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;125&#34;
		data-flex-basis=&#34;300px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The notable steps for this workflow are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;getEmailAddressForUser - this will query Active Directory for the mail attribute for the user identified earlier.&lt;/li&gt;
&lt;li&gt;Remove Snapshot - deletes the snapshot and sets a task object so the workflows/entire process operates synchronously.&lt;/li&gt;
&lt;li&gt;Customise Email - these write the warning and notification emails to be sent to the end user.&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&#34;cluster-workflow&#34;&gt;Cluster Workflow
&lt;/h5&gt;&lt;p&gt;This workflow retrieves all the VMs in the cluster and runs the main VM workflow against it. Nothing special here :)&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-3.png&#34;
	width=&#34;803&#34;
	height=&#34;571&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-3_hu_f603823e5a7f413f.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-3_hu_35009c07f1ea6a6.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;140&#34;
		data-flex-basis=&#34;337px&#34;
	
&gt;&lt;/p&gt;
&lt;h5 id=&#34;clusters--vcenter-servers-workflow&#34;&gt;Clusters / vCenter Servers Workflow
&lt;/h5&gt;&lt;p&gt;This is fairly standard workflow that goes through all the clusters on a vCenter Server and runs the Cluster workflow. It follows a standard pattern of retrieving a set of items and iterating through them. The end of the schema is devoted to sending the report email.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-2.png&#34;
	width=&#34;841&#34;
	height=&#34;767&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-2_hu_efaab48d18be370.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-2_hu_2647f530706c78d7.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;109&#34;
		data-flex-basis=&#34;263px&#34;
	
&gt;&lt;/p&gt;
&lt;h5 id=&#34;configuration-element&#34;&gt;Configuration Element
&lt;/h5&gt;&lt;p&gt;As I wrote this a while ago, I put all the configuration inside a Configuration Element so that configuration variables could be updated once a workflow was scheduled. Please excuse my naming format, it does the job but the names made sense at the time I promise !&lt;/p&gt;
&lt;p&gt;These names match the inputs that the workflows take:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-4.png&#34;
	width=&#34;820&#34;
	height=&#34;316&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-4_hu_4f71f68befdce92c.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-4_hu_cb68cbdd31bc82.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;259&#34;
		data-flex-basis=&#34;622px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;emails&#34;&gt;Emails
&lt;/h4&gt;&lt;p&gt;Here is an example of the report email running on a live environment:&lt;/p&gt;
&lt;figure&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-5.png&#34;
	width=&#34;881&#34;
	height=&#34;541&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-5_hu_8bc89fc8a1bdb9f.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-5_hu_5b56084f3c944716.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;162&#34;
		data-flex-basis=&#34;390px&#34;
	
&gt;&lt;/p&gt;
&lt;figcaption&gt;
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;An example of the email notification a user receives about their snapshot (some field values have been removed):&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-6.png&#34;
	width=&#34;421&#34;
	height=&#34;288&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-6_hu_e66f887406faf538.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-6_hu_e09a4a206fc5f4d8.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;146&#34;
		data-flex-basis=&#34;350px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;download&#34;&gt;Download
&lt;/h4&gt;&lt;p&gt;The workflows, actions and configuration element is available to download here. The package includes the following workflows&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-7.png&#34;
	width=&#34;233&#34;
	height=&#34;147&#34;
	srcset=&#34;https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-7_hu_5f5eb853662bf00e.png 480w, https://enlow.co.uk/p/managing-snapshots-with-vro/images/image-7_hu_944729b87de21430.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;158&#34;
		data-flex-basis=&#34;380px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Once the package is imported, run one of the workflows and let me know what you think ! You&amp;rsquo;ll be able to run the cluster and VM workflows without having to configure a Configuration Element.&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;http://enlow.co.uk/wp-content/uploads/2019/02/uk.co_.enlow_.snapshots.package&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Download package file&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&#34;improvements&#34;&gt;Improvements
&lt;/h4&gt;&lt;p&gt;The most obvious improvement to this workflow would be to made the notifications optional and controlled via an input. Maybe something for a rainy day ;)&lt;/p&gt;
&lt;p&gt;Let me know if this was useful or interesting to you !&lt;/p&gt;</description>
        </item>
        <item>
        <title>vRealize Orchestrator: Finding a REST Host from a vCenter SDK connection</title>
        <link>https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/</link>
        <pubDate>Tue, 13 Mar 2018 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/</guid>
        <description>&lt;p&gt;vRealize Orchestrator can communicate directly with the vCenter Server(s) that it is connected to, but uses the old SOAP API. However, with the advent of the REST API for vSphere, some things are easier (for example, tagging) and only possible to handle outside of the builtin abilities. In this post I will look at how to find a REST Host from a vCenter SDK connection in vRealize Orchestrator - this can be used to reduce the number of inputs on a workflow or make it easier to create multiple-vCenter workflows.&lt;/p&gt;
&lt;p&gt;Each vSphere object has an &amp;ldquo;sdkConnection&amp;rdquo; property that refers to the vCenter Server. This is useful, but if you wish to use the REST API, we&amp;rsquo;ll need to provide a RestHost object type. We could provide that as an input to the workflow, but this is not dynamic and we shouldn&amp;rsquo;t force unnecessary parameters on users.&lt;/p&gt;
&lt;p&gt;There must be an easier way, right ?&lt;/p&gt;
&lt;p&gt;We should assume that every vCenter Server that is connected to vRealize Orchestrator is also configured as a Rest Host. This configuration only needs to be done once, though we will look at automating this at the end of the article.&lt;/p&gt;
&lt;p&gt;Thus, we can enumerate the REST Hosts and find the one we&amp;rsquo;re after by comparing the URL of the vCenter API endpoint to the vCenter REST API endpoint. There is a catch in that the URLs are different so we will need to do a little string manipulation to make it work.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The vCenter Server is &lt;a class=&#34;link&#34; href=&#34;https://auto-vc.auto.internal:443/sdk&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://auto-vc.auto.internal:443/sdk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;The REST Host is &lt;a class=&#34;link&#34; href=&#34;https://auto-vc.auto.internal/rest&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://auto-vc.auto.internal/rest&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I believe it is a fair assumption that the protocol will always be https for both, so we can ignore that - to match up we would need to ensure that the vCenter Server has been added with either the FQDN or hostname identically in both locations - if not then the lookup will fail. Personally I don&amp;rsquo;t see anything wrong with always using the FQDN :)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Adding a REST Host&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have no doubt that this has been done many times before on many other blogs, but for the sake of completeness I will document how I&amp;rsquo;ve added the REST host below.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b508ed3ad.png&#34;
	width=&#34;736&#34;
	height=&#34;593&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b508ed3ad_hu_e044397e68c7e299.png 480w, https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b508ed3ad_hu_978d3dd6a6f36a2a.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;124&#34;
		data-flex-basis=&#34;297px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b51869655.png&#34;
	width=&#34;736&#34;
	height=&#34;593&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b51869655_hu_aa5cc115a5dec6dc.png 480w, https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b51869655_hu_235e410e592ab8be.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;124&#34;
		data-flex-basis=&#34;297px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;This next step is me being lazy - I&amp;rsquo;m going to pass in the SSO administrator credentials. This is not best or even good practice - you should pass in user credentials or a role-limited vco-specific account.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b52c8511b.png&#34;
	width=&#34;736&#34;
	height=&#34;593&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b52c8511b_hu_cc9d691750b53aa4.png 480w, https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b52c8511b_hu_991ea62385f8cad5.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;124&#34;
		data-flex-basis=&#34;297px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;I haven&amp;rsquo;t included screenshots of the (3a) and (4a) wizard pages - I have accepted the defaults. Change if you need to !&lt;/p&gt;
&lt;h3 id=&#34;comparing-values&#34;&gt;Comparing Values
&lt;/h3&gt;&lt;p&gt;Our code will need to strip the protocol and the port (if either of them exist) from an URL, returning the hostname. We&amp;rsquo;ll use this on both the vCenter URL and every REST Host URL to see if they match. Since this is a straight forward bit of a code, we&amp;rsquo;ll put it in an action.&lt;/p&gt;
&lt;p&gt;The main configuration of the action is below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b701e087f.png&#34;
	width=&#34;701&#34;
	height=&#34;109&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b701e087f_hu_75774b22019f3c98.png 480w, https://enlow.co.uk/p/vrealize-orchestrator-finding-a-rest-host-from-a-vcenter-sdk-connection/images/img_5aa5b701e087f_hu_22f1e8af1342b9e1.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;643&#34;
		data-flex-basis=&#34;1543px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;As seen above, the action assumes an input named &amp;ldquo;vcenter&amp;rdquo; of type VC:SdkConnection and returns an output of type REST:RESTHost.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;23
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;24
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;25
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;26
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;27
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;28
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;29
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;30
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;31
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;32
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;33
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;34
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Trim&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;out&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;protocol&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;match&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;url&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;up&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;or&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;/&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gethostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;substring&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;indexOf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;://&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;indexOf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;:&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;indexOf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;/&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;err&#34;&gt;?&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;port&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;port&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;slash&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;port&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;substring&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vcenter_hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gethostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vcenter&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hosts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RESTHostManager&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;getHosts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;current_host&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hosts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rest_host&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;RESTHostManager&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;getHost&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;current_host&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rest_hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;gethostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;rest_host&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vcenter_hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rest_hostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;host&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;rest_host&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The &amp;ldquo;gethostname&amp;rdquo; function is responsible for stripping the URL down to the hostname. We use the RESTHostManager object to loop through configuration hosts and return the host if there is a match.&lt;/p&gt;
&lt;p&gt;Now when creating workflows that would require a REST Host object, we can retrieve the correct object from the sdkConnection property of the managed object, thereby removing the need to add another input to the workflow, and if you have a workflow against multiple vCenters this should really make life easier !&lt;/p&gt;
&lt;h3 id=&#34;next-steps&#34;&gt;Next Steps
&lt;/h3&gt;&lt;p&gt;We will take this on to do some vSphere tagging using the REST API :)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;h3 id=&#34;summary&#34;&gt;Summary
&lt;/h3&gt;&lt;p&gt;I&amp;rsquo;ve created an action for this and saved it in my github - the unencrypted action file can be found &lt;a class=&#34;link&#34; href=&#34;https://github.com/nelons/vco-content/blob/master/actions/getRestHostForvCenterServer.action&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Let me know your thoughts in the comments :)&lt;/p&gt;</description>
        </item>
        <item>
        <title>vRealise Log Insight and Orchestrator</title>
        <link>https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/</link>
        <pubDate>Fri, 15 Sep 2017 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/</guid>
        <description>&lt;p&gt;I&amp;rsquo;m a big fan of the vRealize suite as it really adds value to a vSphere deployment. In relation to this post, LogInsight is a great tool for providing log analysis and Orchestrator manages workflows to automate and orchestrate most/all of the infrastructure.&lt;/p&gt;
&lt;p&gt;A series of postsÂ  on vmware.com - &amp;ldquo;Self Healing Datacenter&amp;rdquo; - have examined how to connect Operations Manager to Orchestrator using a shim - the &lt;a class=&#34;link&#34; href=&#34;https://blogs.vmware.com/management/2017/02/self-healing-datacenter.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;first part of the series is here.&lt;/a&gt;Â The shim is also capable of taking input from LogInsight, though this isn&amp;rsquo;t covered by the articles.&lt;/p&gt;
&lt;p&gt;That webhooks are offered for LogInsight is great, but it is sad that there is no official tool to send events/data from one product in the vRealize suite to another. I&amp;rsquo;m interested in how and why things work (and also because it doesn&amp;rsquo;t appear to work quite right), so instead of using the shim presented in the series above I&amp;rsquo;m going to write my own in node.js so we can look at how this all works.&lt;/p&gt;
&lt;h4 id=&#34;environment&#34;&gt;Environment
&lt;/h4&gt;&lt;p&gt;In this environment we&amp;rsquo;ll be using vRealize LogInsight 4.3 and Orchestrator 7.2, both which have a straight forward and simple deployment - both are single servers (no clusters !) and both are configured to a vSphere 6.5 deployment.&lt;/p&gt;
&lt;p&gt;In vSphere we create a nested host to test against, and have put it in its own cluster. I&amp;rsquo;ve done this because some of the actions I want to take involve shutting the host down (not always gracefully) and I don&amp;rsquo;t have the spare physical hosts to do this (e.g. the auto-esxi VMs below are the hosts in the Nested cluster).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b5c970f67.png&#34;
	width=&#34;254&#34;
	height=&#34;292&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b5c970f67_hu_206120542faa7dde.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b5c970f67_hu_59dcc53e37581803.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;VMs acting as hosts in the same vCenter&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;86&#34;
		data-flex-basis=&#34;208px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;LogInsight has been set up with vSphere integration - all hosts (including the nested host) have been configured to send syslogs to the LogInsight address. A look at the &amp;ldquo;Hosts&amp;rdquo; page in the LogInsight Administration section shows that logs are being successfully received:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b618b0a5b.png&#34;
	width=&#34;172&#34;
	height=&#34;413&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b618b0a5b_hu_b4b368572c1c7d6c.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b618b0a5b_hu_317117695676fb97.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;Log Insight Hosts view&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;41&#34;
		data-flex-basis=&#34;99px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;integration&#34;&gt;Integration
&lt;/h4&gt;&lt;p&gt;It isn&amp;rsquo;t actually possible for LogInsight to start Orchestrator workflows, the closest we can come is by using the &amp;ldquo;webhook&amp;rdquo; functionality when setting up an alert - this will make an HTTP request to an URL with some information when something happens (below is an example of our LogInsight query for a host going into maintenance mode).&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8eca83848.png&#34;
	width=&#34;1036&#34;
	height=&#34;264&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8eca83848_hu_6d42d6f5bb8e6480.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8eca83848_hu_6fa70b7591d5b99.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;LogInsight maintenance mode event&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;392&#34;
		data-flex-basis=&#34;941px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;It is because the vRealize Orchestrator API requires some additional parameters that we can&amp;rsquo;t start Workflows, and when we look at the schema on the swagger API reference page (https://&lt;address&gt;:8281/vco/api/docs/index.html - where &lt;address&gt; is the FQDN/IP of your Orchestrator server), we can see what is required:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b6e24621e.png&#34;
	width=&#34;457&#34;
	height=&#34;544&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b6e24621e_hu_3adad7554fd64de1.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b6e24621e_hu_bed0bcf3d8c3b9d0.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;84&#34;
		data-flex-basis=&#34;201px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;webhook-shims&#34;&gt;WebHook Shims
&lt;/h4&gt;&lt;p&gt;The shim referenced in the &amp;ldquo;&lt;a class=&#34;link&#34; href=&#34;https://blogs.vmware.com/management/2017/02/self-healing-datacenter.html&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Self Healing Datacenter&lt;/a&gt;&amp;rdquo; series can be found as the &lt;a class=&#34;link&#34; href=&#34;https://github.com/vmw-loginsight/webhook-shims&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;&amp;ldquo;log insight webhook-shims&amp;rdquo; on github&lt;/a&gt;Â (this also works with vROPs). To test this I deployed a &lt;a class=&#34;link&#34; href=&#34;https://vmware.github.io/photon/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Photon OS instance&lt;/a&gt; and installed it via docker:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;systemctl enable docker&lt;/li&gt;
&lt;li&gt;systemctl start docker&lt;/li&gt;
&lt;li&gt;docker pull vmware/webhook-shims&lt;/li&gt;
&lt;li&gt;docker run -it -p 5001:5001 &amp;ndash;name lishims vmware/webhook-shims bash&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The public page for this docker container shows how to set it up -Â &lt;a class=&#34;link&#34; href=&#34;https://hub.docker.com/r/vmware/webhook-shims/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://hub.docker.com/r/vmware/webhook-shims/&lt;/a&gt; - and after this we need to configure the vRealize Orchestrator connection in the container. At the command line, enter the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;vi loginsightwebhookdemo/vrealizeorchestrator.py:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b890a083e.png&#34;
	width=&#34;730&#34;
	height=&#34;137&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b890a083e_hu_9e8b39d1e0b05165.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b890a083e_hu_cf8a8b097aa854b1.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;532&#34;
		data-flex-basis=&#34;1278px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;When this file is saved we can start the server within the container:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;./runserver.py&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992c1c799e96.png&#34;
	width=&#34;700&#34;
	height=&#34;52&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992c1c799e96_hu_ba299e759b4b3b6e.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992c1c799e96_hu_53e26cd1ff153ba6.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;1346&#34;
		data-flex-basis=&#34;3230px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;As per the INFO message above, if we browse to http://&lt;address&gt;:5001 (where &lt;address&gt; is the FQDN/IP of the server running the shim) we get a guidance screen on how to use the software - scroll down to view the advice on how to integrate with vRealize Orchestrator.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b8c729290.png&#34;
	width=&#34;673&#34;
	height=&#34;184&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b8c729290_hu_a2749073004af65f.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992b8c729290_hu_e7fa1b6f5418fc22.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;365&#34;
		data-flex-basis=&#34;877px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Now we can return to our LogInsight query and set up an alert based upon it. Select the Alert button on the UI and the following window will appear:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f20ec106.png&#34;
	width=&#34;648&#34;
	height=&#34;489&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f20ec106_hu_da9f87d750ba0543.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f20ec106_hu_7393a1b303de8800.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;132&#34;
		data-flex-basis=&#34;318px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Select the Webhook notify option and put in the formatted address of the webhook server:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;http://address : port / endpoint / vro / workflow-id&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Aha, we don&amp;rsquo;t have a workflow set up so we don&amp;rsquo;t know what worfklow-id to type in here - let&amp;rsquo;s do this now. Open up the vRealize Orchestrator client and create a new workflow - we&amp;rsquo;re going to keep this one simple and just write something in the log, the schema for which is below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f6168d50.png&#34;
	width=&#34;358&#34;
	height=&#34;137&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f6168d50_hu_581609d11b6dc95b.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f6168d50_hu_80c2df626feb960a.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;261&#34;
		data-flex-basis=&#34;627px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;When we look at the details of the workflow we see the ID to use the alert:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f486dc1b.png&#34;
	width=&#34;435&#34;
	height=&#34;94&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f486dc1b_hu_1c275dee01ce4ce4.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f486dc1b_hu_445ffa51a6782dbc.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;462&#34;
		data-flex-basis=&#34;1110px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;So now we have a workflow id we can create our LogInsight alert. Go back to the LogInsight alert configuration page, update the webhook and URL and save.&lt;/p&gt;
&lt;h4 id=&#34;workflow-problems&#34;&gt;Workflow problems
&lt;/h4&gt;&lt;p&gt;Time to put a host (that is configured to send syslog to our LogInsight server) into Maintenance Mode - which I did I 0753 in the screenshot below:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8fe5c0a99.png&#34;
	width=&#34;808&#34;
	height=&#34;196&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8fe5c0a99_hu_770e57a82c9360fe.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8fe5c0a99_hu_963a6912448e63ff.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;412&#34;
		data-flex-basis=&#34;989px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;We see the following workflow implementations:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f800db70.png&#34;
	width=&#34;253&#34;
	height=&#34;208&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f800db70_hu_bca500ec77f2fd7a.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_597d8f800db70_hu_b03521abb44e8bff.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;121&#34;
		data-flex-basis=&#34;291px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Woah - we only put the host into maintenance mode once and the workflow was started 10 times - what could have happened ? The sequence of what happens is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;LogInsight matches the query and notifies shim server via webhook.&lt;/li&gt;
&lt;li&gt;Shim server receives request and formats a vRealize Orchestrator API call. Sends to vRealize Orchestrator&lt;/li&gt;
&lt;li&gt;vRealize Orchestrator starts the workflow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you were watching the console of the Photon OS container then you would have seen that for every workflow invocation a new request was sent by the webhook shim code. So this excludes vRealize Orchestrator from causing this, but is the shim code receiving a new notification for every workflow ?&lt;/p&gt;
&lt;p&gt;I did toy with the idea of setting up port mirroring via a distributed switch and using Wireshark to check only one request was sent, but this seems unnecessarily complex. Â The is another way :)&lt;/p&gt;
&lt;h4 id=&#34;nodejs&#34;&gt;Node.js
&lt;/h4&gt;&lt;p&gt;We can spin up a very simple node.js server that logs out every request that is made to it. Our server code looks as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;include&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;http&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;module&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;http&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;require&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;http&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;create&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;webserver&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;http&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;createServer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;function&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;req&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;respond&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;any&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;incoming&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;http&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;writeHead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;200&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;text/plain&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;n&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Request Received.&lt;/span&gt;&lt;span class=&#34;se&#34;&gt;\n&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;listen&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;5001&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;log&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;what&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;that&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;we&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;started&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;listening&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Server running at 127.0.0.1:5001&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;When we put a host into maintenance mode now we can see that we only receive one email and that our notification monitor only receives one request from Log Insight. So the problem is somewhere in the shim server. But in the spirit of creating stuff and learning something new, let&amp;rsquo;s write our own shim server !&lt;/p&gt;
&lt;p&gt;The main body of our server function is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;responseCode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;500&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Get&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Body&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body_array&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;ne&#34;&gt;Array&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;req&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;data&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;chunk&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;request_body_array&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;push&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;chunk&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;req&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;end&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;request_body_array&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;request_body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body_array&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;responseCode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;handle_request&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;req&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;url&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;writeHead&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;responseCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;text/plain&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;res&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This is really straight forward and will receive the full request and call handle_request (which I&amp;rsquo;m not going to detail Â here), which will then invoke the call_vro function with appropriate parameters.&lt;/p&gt;
&lt;p&gt;In our call_vro function we will need to set up the parameters for the Orchestrator call:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;23
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;24
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;25
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;26
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;27
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;28
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;29
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;30
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;31
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;32
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;33
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;34
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;35
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;36
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;37
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;38
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;39
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;40
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;41
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;42
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;creds_base64&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vro_username&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;:&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vro_password&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;toString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;base64&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;messages_value&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Buffer&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;request_body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;toString&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;base64&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body_json&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JSON&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;request_body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vro_execution_context&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;parameters&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;messages&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;description&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Base64 encoded JSON of LogInsight messages&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;scope&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;local&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;n&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;					&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;messages_value&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;alertName&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;scope&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;local&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;string&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;n&#34;&gt;string&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;					&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body_json&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;AlertName&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;},&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;hitCount&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;scope&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;local&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;number&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;n&#34;&gt;number&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;					&lt;span class=&#34;n&#34;&gt;value&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;request_body_json&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;HitCount&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;workflow_request_body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JSON&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;stringify&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vro_execution_context&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The code above sets up the basic authentication string and defines the parameter arrayÂ for the request. We are going to provide three parameters for the workflow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;messages - the messages passed by LogInsight. These will be Base64 encoded so Orchestrator will need to decode them.&lt;/li&gt;
&lt;li&gt;alertName - the name of the alert that was configured in LogInsight.&lt;/li&gt;
&lt;li&gt;hitCount - the number of times this alert was triggered.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As our alert should be triggered on every invocation we won&amp;rsquo;t worry about hitCount for now - but we should make a note to test this later.&lt;/p&gt;
&lt;p&gt;After the parameters have been set up, they are convered to a JSON string for the request. We can see below in the request header set up that we are declaring our content is JSON.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;23
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;24
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;25
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;26
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;27
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;28
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;29
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;30
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;31
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;32
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;33
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;34
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;35
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;36
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;37
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;38
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;39
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;40
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;41
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;42
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;43
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vro_auth_options&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;host&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vro_server&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;port&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vro_port&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;path&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;/vco/api/workflows/&amp;#39;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;workflow_id&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;/executions&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;method&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;POST&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;rejectUnauthorized&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;headers&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;  &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;s1&#34;&gt;&amp;#39;Accept&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;application/json&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Type&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;application/json;v=5.1.1&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;s1&#34;&gt;&amp;#39;Content-Length&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;workflow_request_body&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;length&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;s1&#34;&gt;&amp;#39;Authorization&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;Basic &amp;#39;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;creds_base64&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;};&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;auth_data_array&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;ne&#34;&gt;Array&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;callback&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;data&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;chunk&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;auth_data_array&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;push&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;chunk&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;error&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;chunk&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;ERROR = &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;err&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;message&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;on&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;end&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;function&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;auth_data&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;auth_data_array&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;join&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;statusCode&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;202&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_data&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;length&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;				
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;				&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;res&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JSON&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;auth_data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Workflow &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;workflow_id&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; successfully started&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;Workflow execution response: &amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;statusCode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;req&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;https&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;request&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vro_auth_options&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;callback&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;req&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;write&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;workflow_request_body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;req&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;end&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This code sets up the connection, defines the functions for what happens when the request errors or is complete and then makes the connection (https.request at the bottom). If we receive an error code of 202 then all is good !&lt;/p&gt;
&lt;p&gt;Mental note: current status codes for starting a workflow:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992bce4eadb4.png&#34;
	width=&#34;419&#34;
	height=&#34;304&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992bce4eadb4_hu_54c2e2000c8dcb47.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_5992bce4eadb4_hu_11d13950656bb6f8.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;137&#34;
		data-flex-basis=&#34;330px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;trying-it-out&#34;&gt;Trying it out
&lt;/h4&gt;&lt;p&gt;When we put a host into maintenance mode now we can see that we only get one Orchestrator workflow generated for each alert. But if we look at Log Insight, the alert is examined every 5 minutes:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676dc3108b.png&#34;
	width=&#34;949&#34;
	height=&#34;82&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676dc3108b_hu_6040bbf713cbcaf1.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676dc3108b_hu_f0183c83b297d4a.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;1157&#34;
		data-flex-basis=&#34;2777px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;So what happens if we put two hosts into maintenance mode before the alert is examined ?&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676c61936f.png&#34;
	width=&#34;959&#34;
	height=&#34;49&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676c61936f_hu_a5ce9366b27419af.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676c61936f_hu_508dc36d3397c21e.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;1957&#34;
		data-flex-basis=&#34;4697px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;This is the console of the server:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b6767780017.png&#34;
	width=&#34;963&#34;
	height=&#34;198&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b6767780017_hu_91a3675e0a3ae85e.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b6767780017_hu_bfdd6d2a13b41134.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;486&#34;
		data-flex-basis=&#34;1167px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Looking at the request that has been passed we can see that there are messages for both hosts, but we only have one workflow started:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676a9522fc.png&#34;
	width=&#34;260&#34;
	height=&#34;59&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676a9522fc_hu_4ff4fe7e3055e777.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b676a9522fc_hu_ab685f292024b4f7.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;440&#34;
		data-flex-basis=&#34;1057px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;We need to look at how we pull out the information contained in the &amp;lsquo;messages&amp;rsquo; input variable. First, we need to download and install a plugin that will allow us to decode base 64 strings. This can be obtained from &lt;a class=&#34;link&#34; href=&#34;https://github.com/vmware/o11n-plugin-crypto&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Â https://github.com/vmware/o11n-plugin-crypto&lt;/a&gt; and installation is straight forward from the Control Center. After installation, the vCO service needs to be restarted (not the server) - the message stating the service needs to be restarted doesn&amp;rsquo;t disappear immediately, but it does go :)&lt;/p&gt;
&lt;p&gt;Then we need to modify our workflow to accept these parameters:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b677a38601a.png&#34;
	width=&#34;370&#34;
	height=&#34;231&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b677a38601a_hu_761507801c5f1432.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b677a38601a_hu_2b1297642ed74e40.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;160&#34;
		data-flex-basis=&#34;384px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve also added an attribute to the workflow with the name &amp;ldquo;hosts&amp;rdquo; and type &amp;ldquo;Array/string&amp;rdquo; - but you can omit this and comment out the lines that reference this attribute. We can now add a scriptable task with the following:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;23
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;24
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;25
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;26
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Decode&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;string&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;and&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;parse&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;into&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;a&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JSON&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;objecct&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;decoded_str&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;CryptoEncoding&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;base64Decode&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;messages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;li_obj&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;JSON&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;parse&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;decoded_str&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Create&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;array&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hold&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;our&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hosts&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;detail&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;hosts&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;ne&#34;&gt;Array&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;item&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;li_obj&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;messages&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Get&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Host&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;for&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;each&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;field&lt;/span&gt; &lt;span class=&#34;ow&#34;&gt;in&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;item&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;fields&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;field&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;name&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;__li_source_path&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;field&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;k&#34;&gt;break&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Debugging&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Write&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;out&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;host&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;System&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34; has entered maintenance mode.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;o&#34;&gt;//&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Add&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;array&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;hosts&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;push&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;hostname&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This is what we see now in the Logs section for the workflow when we put two hosts into maintenance mode for the same alert interval - we can now handle more than one host, and identify which host has gone into maintenance mode.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b6f1dd75453.png&#34;
	width=&#34;382&#34;
	height=&#34;138&#34;
	srcset=&#34;https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b6f1dd75453_hu_3cfce9a4460e39e9.png 480w, https://enlow.co.uk/p/vrealise-log-insight-and-orchestrator/images/img_59b6f1dd75453_hu_85d9fafe5e786c94.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;276&#34;
		data-flex-basis=&#34;664px&#34;
	
&gt;&lt;/p&gt;
&lt;h4 id=&#34;summary&#34;&gt;Summary
&lt;/h4&gt;&lt;p&gt;So we can now decode the messages we receive from LogInsight and work with multiple messages - I&amp;rsquo;ve left the node.js console printing out the contents of the request (line 34) in order to help identify useful fields of information. This needs some tidying up to be useful (and a solution for storing username/passwords in the node.js file should be found) but hopefully is a good proof of concept of what is capable.&lt;/p&gt;
&lt;p&gt;As usual, the code is available on github - &lt;a class=&#34;link&#34; href=&#34;https://github.com/nelons/loginsight_webhook_shim&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://github.com/nelons/loginsight_webhook_shim&lt;/a&gt;. Feel free to use/abuse in any way you like, let me know if I&amp;rsquo;ve made a mistake or if you found this useful.&lt;/p&gt;</description>
        </item>
        <item>
        <title>Using Orchestrator to automatically upgrade Tools</title>
        <link>https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/</link>
        <pubDate>Wed, 08 Mar 2017 00:00:00 +0000</pubDate>
        
        <guid>https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/</guid>
        <description>&lt;p&gt;One of the main challenges in every (non-small) place I&amp;rsquo;ve worked is keeping VMware Tools updated, and with Change Management processes this becomes a little bit more complicated. There is a setting on each VM to upgrade Tools when the VM is booted and this is a good way to keep Tools updated on those VMs that aren&amp;rsquo;t mission critical and require manual intervention.&lt;/p&gt;
&lt;p&gt;In this post we&amp;rsquo;ll look at creating an action and a workflow to configure this setting, and pushing it as a context setting in the Flex Web Client.&lt;/p&gt;
&lt;p&gt;This leads to the issue of how this setting is enabled - firstly as part of the initial push (you don&amp;rsquo;t want to enable this manually for 100&amp;rsquo;s (or more) VMs) and with newly created VMs. Although this can be set on a VM template or &amp;ldquo;Gold Build&amp;rdquo; (or equivalent terminology), this can still lead to human error so we&amp;rsquo;ll also look creating a workflow to set this for a cluster and scheduling this using the Flex Web Client.&lt;/p&gt;
&lt;h4 id=&#34;upgrade-tools-action&#34;&gt;Upgrade Tools Action
&lt;/h4&gt;&lt;p&gt;To configure a VM to upgrade Tools we need to create a new configuration specification and set the tools configuration appropriately. Our actionÂ will return the Task for the configuration (note: this can be null) and will take two inputs - the VM to configure and whether we are automatically upgrading Tools. Here is a screenshot of the action configuration:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586577d88fffe.png&#34;
	width=&#34;321&#34;
	height=&#34;122&#34;
	srcset=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586577d88fffe_hu_dfc26034d28fe23a.png 480w, https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586577d88fffe_hu_90c644766cca1ce7.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;vco-automatically-upgrade-tools-action-parameters&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;263&#34;
		data-flex-basis=&#34;631px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The script of the action is as follows:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-gdscript3&#34; data-lang=&#34;gdscript3&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;n&#34;&gt;task&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vm&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;null&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;toolsconfig&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;VcToolsConfigInfo&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;autoupgrade&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;==&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;true&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;toolsconfig&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;toolsUpgradePolicy&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;upgradeAtPowerCycle&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;n&#34;&gt;toolsconfig&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;toolsUpgradePolicy&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;manual&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;k&#34;&gt;var&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vmconfig&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;VcVirtualMachineConfigSpec&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;vmconfig&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tools&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;toolsconfig&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;n&#34;&gt;task&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;vm&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;reconfigVM_Task&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;vmconfig&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;task&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;In the code snippet above, we ensure that the &amp;ldquo;vm&amp;rdquo; variable contains a valid VM. We create a new ToolsConfigInfo object which will contain the tools settings that we wish to apply and then create a new VirtualMachineConfigSpec object and assign the ToolsConfigInfo object to it. Thus when we call the reconfigVM_Task() function with the configuration object, the VM is only reconfigured with the settings we have provided.&lt;/p&gt;
&lt;p&gt;Now we have an action, we can create a workflow that will invoke it and then wait for the task to complete. This is the schema diagram:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586580bdbfde6.png&#34;
	width=&#34;493&#34;
	height=&#34;223&#34;
	srcset=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586580bdbfde6_hu_34819274c9bea1d3.png 480w, https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586580bdbfde6_hu_3f8de459a17593aa.png 1024w&#34;
	loading=&#34;lazy&#34;
	
		alt=&#34;vco-automatically-upgrade-tools-workflow-schema&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;221&#34;
		data-flex-basis=&#34;530px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The workflow (and action) can be downloadedÂ from the file at the end of this post.&lt;/p&gt;
&lt;h4 id=&#34;cluster-workflow&#34;&gt;Cluster Workflow
&lt;/h4&gt;&lt;p&gt;Now we have an action to make the changes, we can put together a workflow that will look at all VMs in the cluster and configure them. The schema is as follows:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586ad1836cd71.png&#34;
	width=&#34;642&#34;
	height=&#34;350&#34;
	srcset=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586ad1836cd71_hu_1701fa6ae8e0cd23.png 480w, https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_586ad1836cd71_hu_6a3526f4e637306f.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;183&#34;
		data-flex-basis=&#34;440px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;The workflow will get all VMs in the cluster and for each one:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Only upgrade Windows VMs (&amp;ldquo;Upgrade VM ?&amp;rdquo; decision)&lt;/li&gt;
&lt;li&gt;Check if the configuration setting currently matches what we want it to. (&amp;ldquo;Decide setting&amp;rdquo; script).&lt;/li&gt;
&lt;li&gt;Change the setting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The meat of the process is in the &amp;ldquo;Decide setting&amp;rdquo; script item - we will look at what the setting should be, and if the current setting does not match then we will change it. This also means that if we wish the VM to update Tools manually and it is set to automatically update at power on, the setting will be changed to update manually.&lt;/p&gt;
&lt;h4 id=&#34;setting-as-a-context-action&#34;&gt;Setting as a context action
&lt;/h4&gt;&lt;p&gt;To set this as a context action on the cluster within the Flex Web Client, we need to look at the Orchestrator pages in the Web Client. The server page will have a Manage screen and a Context Actions page:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_589a518eb890b.png&#34;
	width=&#34;631&#34;
	height=&#34;211&#34;
	srcset=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_589a518eb890b_hu_cdfc1973f570fcdd.png 480w, https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/img_589a518eb890b_hu_2cdace01328541d1.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;299&#34;
		data-flex-basis=&#34;717px&#34;
	
&gt;&lt;/p&gt;
&lt;p&gt;Next we need to add a new one - select the workflow to add and the type of object to associate it with - in this case we&amp;rsquo;re adding the workflow to set the upgrade for Tools for a single virtual machine, so we select the Virtual Machine object:&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;http://enlow.co.uk/wp-content/uploads/2017/02/add_context_workflow.png&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;&lt;img src=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/add_context_workflow.png&#34;
	width=&#34;727&#34;
	height=&#34;542&#34;
	srcset=&#34;https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/add_context_workflow_hu_d935da99e830b8f8.png 480w, https://enlow.co.uk/p/using-orchestrator-to-automatically-upgrade-tools/images/add_context_workflow_hu_80947f636d8418b0.png 1024w&#34;
	loading=&#34;lazy&#34;
	
	
		class=&#34;gallery-image&#34; 
		data-flex-grow=&#34;134&#34;
		data-flex-basis=&#34;321px&#34;
	
&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Press OK and all is done. You&amp;rsquo;ll need to reload the Flex Web Client in order to see it - it appears at the bottom of the actions menu for the object - under the &amp;ldquo;vRealize Orchestrator context actions&amp;rdquo; title.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s it !Â This workflow a prime candidate for being scheduled to ensure all your VMs are kept up to date.&lt;/p&gt;
&lt;p&gt;The workflows (and action) for this are available at my github repo - &lt;a class=&#34;link&#34; href=&#34;https://github.com/nelons/vco-content&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://github.com/nelons/vco-content&lt;/a&gt;.&lt;/p&gt;</description>
        </item>
        
    </channel>
</rss>
