<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://ben.neise.co.uk/feed.xml" rel="self" type="application/atom+xml" /><link href="https://ben.neise.co.uk/" rel="alternate" type="text/html" /><updated>2026-06-12T14:38:20+01:00</updated><id>https://ben.neise.co.uk/feed.xml</id><title type="html">ben.neise.co.uk</title><subtitle>Platform Engineering on Private and Hybrid Clouds.</subtitle><entry><title type="html">Four Reasons Your Cloud Platform Needs a Blog in 2024</title><link href="https://ben.neise.co.uk/2024/07/10/platform-blog.html" rel="alternate" type="text/html" title="Four Reasons Your Cloud Platform Needs a Blog in 2024" /><published>2024-07-10T09:00:00+01:00</published><updated>2024-07-10T09:00:00+01:00</updated><id>https://ben.neise.co.uk/2024/07/10/platform-blog</id><content type="html" xml:base="https://ben.neise.co.uk/2024/07/10/platform-blog.html"><![CDATA[<div class="info">My good friend <a href="https://www.linkedin.com/in/bryanross/">Bryan Ross</a> has extended upon this article on his <a href="https://newsletter.bryanross.me/p/the-communication-blueprint-every">Chief Therapy Officer blog</a></div>

<p><em>Blogs.</em></p>

<p>I appreciate that you’re reading one right now, but the word still seems quaint, old-fashioned. It’s all so very <em>turn-of-the-century</em>, so very <em>web 2.0</em>.</p>

<p>I’m going to describe some of the reasons why, even in 2024, you might want to have a blog for your platform. Or, if you already have a blog, some hints and tips for making the most of it, and maybe some encouragement to use it more.</p>

<!--more-->

<ul id="markdown-toc">
  <li><a href="#blogs-excel-at-providing-detailed-context" id="markdown-toc-blogs-excel-at-providing-detailed-context">Blogs excel at providing detailed context</a></li>
  <li><a href="#blogs-can-be-updated" id="markdown-toc-blogs-can-be-updated">Blogs can be updated</a></li>
  <li><a href="#blogs-encourage-your-engineers-to-think-of-customers" id="markdown-toc-blogs-encourage-your-engineers-to-think-of-customers">Blogs encourage your engineers to think of customers</a></li>
  <li><a href="#a-blog-personalises-your-platform" id="markdown-toc-a-blog-personalises-your-platform">A blog personalises your platform</a></li>
</ul>

<h2 id="blogs-excel-at-providing-detailed-context">Blogs excel at providing detailed context</h2>

<p>When you release a new feature, or make a change, your platform may have a banner, with a call to action. You might also post a message to Teams or Slack, with a summary of the change.</p>

<p>You’re also almost certainly sending out e-mails with a bit more context, maybe even to the right people. But we all know that long e-mails don’t get read, so we need to keep them short.</p>

<p>So where do people go when they need more information?</p>

<p>For those users who want to know <strong>why</strong> something is happening, blogs provide an excellent way of contextualising that information. Adding a link to your banner, notification, or e-mail means that people who want, can choose to get that context, and you’re not overwhelming those people who don’t need or want that material.</p>

<p>The blog post can provide all sorts of extra information. If it’s a new feature, why was it implemented? How do your customers go about using it? Is there a mechanism for providing feedback? If it’s a change to the way the platform works, then why was it implemented? What does the customer need to do? Are further changes planned?</p>

<p>A blog also gives your existing, and new customers an opportunity to view a record of the improvements which have been made to the platform. Remember, Static platforms are dead platforms. You should always be releasing new features, and updates. At the <em>very least</em> you should be applying patches, security fixes and making changes to conform to changing corporate guidance and legislation. If customers can’t see a history of changes, updates and improvements, it may cause them to worry that the platform is not well maintained, and unresponsive to user needs.</p>

<h2 id="blogs-can-be-updated">Blogs can be updated</h2>

<p>As soon as you hit the send button on an e-mail, that information is now <em>out there</em>. Even if you e-mail a follow-up, the original e-mail could be referenced without context, or forwarded-on. I’m sure you have been sent e-mails which were quickly followed-up by clarifications (one of my favourites involves a follow-up which had to explain to otherwise intelligent people that <em>“12:00 means afternoon, not midnight!”</em>). How many times have <em>you</em> sent something out, only to quickly get back a few replies all asking the same thing (or pointing out the same error!). If it’s not happened yet, it’s likely only a matter of time!</p>

<p>But … if your e-mail contains only the essential information, and includes a link to your platform blog, you can update the blog as many times as you like. Further context can be added, links to documentation can be updated … dates can (ahem) be changed. Anyone following the link from an e-mail with a subject line starting <code class="language-plaintext highlighter-rouge">Fwd: Fwd: Fwd:</code> will get still the most up-to-date details.</p>

<p>If you get questions (via e-mail, Slack, or comments on the post itself) you can add clarifying information directly to the post.</p>

<h2 id="blogs-encourage-your-engineers-to-think-of-customers">Blogs encourage your engineers to think of customers</h2>

<p>If you ask your platform engineers to write a blog post prior to the release of a new feature, they are forced to put themselves into the customer’s position.</p>

<p>I typically like to start all new product blog posts with the format:-</p>

<ul>
  <li>What is happening?</li>
  <li>Who is affected?</li>
  <li>Why is it happening?</li>
  <li>When is it happening?</li>
  <li>What does the customer need to do?</li>
</ul>

<p>If you structure your writing like that, and encourage your engineers to do the same, you’ll find that you very much need to see things from the point-of-view of the consumer.</p>

<p>Without taking this kind of approach, you can easily end up with engineers providing a laundry list of new features, backend-technologies, protocols, and version numbers which often means nothing to your customers.</p>

<p>Instead focus on the improvements. For example, it’s unlikely anyone will be interested in a new obscure security feature, but maybe it’s an audit requirement (and customers are always interested in passing audits, especially when compliance requires no work on their side).</p>

<h2 id="a-blog-personalises-your-platform">A blog personalises your platform</h2>

<p>Until the day that we’re all replaced by AI, the majority of us are still human. And humans naturally prefer interact with other humans.</p>

<p>A blog gives you the opportunity to personalise your platform, to give you and your team more character.</p>

<p>You can have a bit more of a voice on a blog than you can have via e-mail and documentation. You can be a bit more open about challenges you’ve faced. You can acknowledge that things are late, or imperfect (for now), in a way that you can’t really do in documentation.</p>

<p>You can even add photos, pictures and memes to show that you and your team are not an amorphous blob of corporate capability, but a small group of people, people who probably look-like, talk-like and act-like your customers.</p>

<p>Humanising your platform builds loyalty. People are more likely to forgive small issues if they’ve interacted with the people running the platform.</p>

<p>A blog also provides a direct avenue for interaction. A small number of people may comment, but - if they do - there are probably other people relieved that they did, and keen to see the answer in a public forum. Always try to reply to comments, and try to keep the responses positive; you’re not just replying to the person who left the comment, but all of the other people reading it too. The people who do comment are likely to tbe the ones who care the most about your platform, and - if brough onboard - will likely be able to advocate for you to other customers.</p>]]></content><author><name></name></author><category term="platform-engineering" /><summary type="html"><![CDATA[My good friend Bryan Ross has extended upon this article on his Chief Therapy Officer blog Blogs. I appreciate that you’re reading one right now, but the word still seems quaint, old-fashioned. It’s all so very turn-of-the-century, so very web 2.0. I’m going to describe some of the reasons why, even in 2024, you might want to have a blog for your platform. Or, if you already have a blog, some hints and tips for making the most of it, and maybe some encouragement to use it more.]]></summary></entry><entry><title type="html">Documenting your Household</title><link href="https://ben.neise.co.uk/2023/12/01/home-documentation.html" rel="alternate" type="text/html" title="Documenting your Household" /><published>2023-12-01T09:00:00+00:00</published><updated>2023-12-01T09:00:00+00:00</updated><id>https://ben.neise.co.uk/2023/12/01/home-documentation</id><content type="html" xml:base="https://ben.neise.co.uk/2023/12/01/home-documentation.html"><![CDATA[<p><img src="/assets/post-images/2023-12-01-home-documentation.png" alt="Interior of house, covered in sticky labels" class="center-image" /></p>

<p>While reading through my RSS feeds last week, I came across a <a href="https://news.ycombinator.com/item?id=38444577">HackerNews post</a> about <a href="https://luke.hsiao.dev/blog/housing-documentation/">Home Documentation</a>.</p>

<p>I’ve a huge fan of documenting all of the things, and I was currently revisiting both the content, and the platform on which I document, so I thought I’d add my 2¢.</p>

<!--more-->

<h1 id="requirements">Requirements</h1>

<p>I’m going to focus more on content, than the specific platform, but my requirements are probably fairly typical.</p>

<ul>
  <li>The solution needs to be available (and up to date/synchronised) on Windows, macOS laptops, iOS phones and Android</li>
  <li>Needs to be accessible and easily updated by the whole family. Needs to be WYSIWYG, no markdown, and <em>certainly</em> no checking things into Git! Luke’s solution is clever, but he’s either only using it for himself, or he lives in a house of developers!</li>
  <li>I’d prefer to avoid self-hosting, as it’s likely that the run book itself would need to contain instructions for fixing whatever self-hosted solution I ended up using. Using a trusted cloud provider also means I can use things like MFA.</li>
  <li>It shouldn’t cost me anything extra</li>
  <li>Ideally it shouldn’t require signing-up to another service</li>
</ul>

<p>I love <a href="https://www.notion.so/">Notion</a>, but paying for the the whole family for something they’d barely use irks me. <a href="https://www.onenote.com/?public=1">Microsoft OneNote</a> is <em>okay</em>, but the free-form format tends towards mess. So I settled on Microsoft Loop, which I get via my Microsoft 365 Family subscription, and whose iOS app has recently become generally available.</p>

<h1 id="what-does-the-document-contain">What does the document contain?</h1>

<h2 id="financial-information">Financial information</h2>

<p>Probably the most important section. I’m aware that I’m a single-point-of-failure in the household for knowing <del>exactly</del> roughly <em>where everything is</em>.</p>

<p>Also, it’s not nice to think about, but <a href="https://www.moneysavingexpert.com/news/2015/05/are-you-secretly-hurting-your-spouse-by-looking-after-the-family-finances/">bad things happen</a>, and this forms a bit of a living will.</p>

<p>So, what kind of things are stored here?</p>

<ul>
  <li><strong>Insurance details</strong> for the home and our cars. The next time you are insuring your home or car, also make sure to note down all of the details they require: driver’s license numbers, average mileage, the <a href="https://www.moneysavingexpert.com/insurance/car-insurance-job-picker/">job title and industry you tweaked to get the best rate</a>. Even though most comparison sites will store the details, you should also be checking rates for those companies which are not on the comparison sites.</li>
  <li><strong>Current and savings account details</strong>, who they are with, and what they are for.</li>
  <li>Our <strong>address history</strong>. The dates we moved in and out of each house.</li>
  <li><strong>Utilities</strong>. Who provides our gas, electric, internet. mobile phones and TV? What plans are we on. What’s the contract end date and is there an early termination charge</li>
  <li><strong>Subscriptions</strong>. Who are we paying for what. Yes… you know about Microsoft Game Pass, but did you know about <em>second</em> Microsoft Game Pass (because Microsoft don’t really support <a href="https://www.theverge.com/2023/7/14/23795351/microsoft-xbox-game-pass-friends-and-family-plan-preview-end">gaming families</a>).</li>
</ul>

<h2 id="home-maintenance">Home maintenance</h2>

<p>This section cotains more practical information about the house.</p>

<ul>
  <li><strong>Home insurance details</strong> (again! These are in the financial section, which is where <a href="https://support.microsoft.com/en-us/office/get-started-with-microsoft-loop-9f4d8d4f-dfc6-4518-9ef6-069408c21f0c">Loop Components</a> come in handy)</li>
  <li><strong>Replacement items</strong>. Which particular (Ikea) glasses and plates do we use? What was size of bin bags works best in the kitchen bin?</li>
  <li><strong>Bulb types</strong>. We have an old house, and use a suprisingly wide range of bulb types.</li>
  <li>Which <strong>paint colors</strong> did we use for each room?</li>
</ul>

<h2 id="vehicle-details">Vehicle Details</h2>

<ul>
  <li><strong>Insurance details</strong> (synchronised with the Financial section)</li>
  <li><strong>Car history</strong>. When did we buy the cars? Previous owners</li>
  <li><strong>MOT &amp; Service dates</strong></li>
</ul>

<h2 id="home-technology">Home Technology</h2>

<p>Like a lot of people that work in IT. I like playing around with various solutions. And while the family certainly appreciate the benefits of having, say, a PiHole; it’s not always appreciated as much when it breaks. And I’m out of the house. I’m sure a lot of us have had those phoencalls, wehere we try to describe from memory exactly which cable needs pulled.</p>

<ul>
  <li><a href="https://www.youtube.com/watch?v=t2F1rFmyQmY">What to do when the internet breaks</a></li>
  <li>Which particular application do you need to download to program that one color changing wifi bulb we use in the fireplace, which is inexplicably a different brand to all the others.</li>
  <li>What models of printer do we have, and what ink/toner do they consume? What’s the name of the mobile application that lets me print from my phone, and how do I set it up?</li>
  <li>Links to various web interfaces for internal services. The router admin page. The printer admin page.</li>
  <li>Links to various external web interfaces. Hive. Ring.</li>
</ul>

<h2 id="misc">Misc</h2>

<ul>
  <li>Our Christmas card list and addresses</li>
  <li>Travel documents</li>
  <li>Plant care instructions, indoor &amp; outdoor. Saves hanging onto those little plastic tags that tell you when <a href="https://www.youtube.com/watch?v=QETfA9_b7wM">it likes to feed</a>.</li>
</ul>

<h1 id="what-is-not-being-documented">What is not being documented?</h1>

<ul>
  <li><strong>Passwords</strong>. With all of that juicy personally-identifiable-data, the document is probably already a fairly big liability if it were to be compromised, but I think the advantages of having all of this in one place outweigh the risks. Besides, I was part of the <a href="https://www.equifax.co.uk/incident.html">Equifax breach</a> … all of this information is probably on the dark web anyway.</li>
  <li><strong>Scanned documents &amp; PDF files</strong>. Simply because I’ve not yet found a good way to embed them in Microsoft Loop. There’s probably something I can do with linking to OneDrive, but I’ve not yet worked it out. I tend to keep a OneDrive folder with scanned correspondence, and PDF files for things like the instruction manual for the dishwasher.</li>
</ul>

<h1 id="potential-improvements">Potential Improvements</h1>

<p>I love the idea of adding videos &amp; photos.</p>

<p>I’m also considering adding task boards for home improvements. It might not be quite as feature complete as Jira or Asana, but it satisfies some of those same requirements (ease of use).</p>

<p>Network diagrams. One of the things that Notion supports, which Loop does not yet are <a href="https://mermaid.js.org/">Mermaid diagrams</a>.</p>]]></content><author><name></name></author><category term="home" /><summary type="html"><![CDATA[While reading through my RSS feeds last week, I came across a HackerNews post about Home Documentation. I’ve a huge fan of documenting all of the things, and I was currently revisiting both the content, and the platform on which I document, so I thought I’d add my 2¢.]]></summary></entry><entry><title type="html">Platform Engineering - The Fundamentals of Developer Experience</title><link href="https://ben.neise.co.uk/2023/11/29/platform-engineering-fundamentals.html" rel="alternate" type="text/html" title="Platform Engineering - The Fundamentals of Developer Experience" /><published>2023-11-29T15:30:00+00:00</published><updated>2023-11-29T15:30:00+00:00</updated><id>https://ben.neise.co.uk/2023/11/29/platform-engineering-fundamentals</id><content type="html" xml:base="https://ben.neise.co.uk/2023/11/29/platform-engineering-fundamentals.html"><![CDATA[<p><img src="/assets/platform-engineer.png" alt="A developer wearing builders clothes and a hard hat, sitting at a desk in front of a computer" class="center-image" /></p>

<p>Teams launching new internal developer platforms often fall into the trap of creating technically-advanced solutions, using cutting edge tooling, but forgetting to think much about usability from the customer perspective. I think this is typically because these platforms been built by engineers who have inevitably been immersed in those specific technologies for so long that they’ve forgotten what it’s like to approach it for the first time.</p>

<!--more-->

<p>Having a complicated, clunky product that developers don’t see value in using, can result in low uptake, and - if left unfixed - may result in <a href="https://en.wikipedia.org/wiki/Shadow_IT">shadow IT</a>, competing platforms with similar functionality, or numerous “tactical solutions”. Sadly, once a platform has been labeled by it’s users as <em>broken</em>, it can be a difficult message to change.</p>

<p>Fortunately, there are some straightforward, fundamental things that you can help avoid this pitfall.</p>

<p>If you’ve been working in Platform Engineering for a while, then hopefully this may just help describe you are already doing. But, if you’re just getting started, or if you’ve built something and you’re struggling to gain traction, these tips might help you create a great platform that developers love.</p>

<h1 id="branding--communication">Branding &amp; communication</h1>

<p>In almost all companies, developers will have some degree of choice about which platform to use. As well as the public cloud staples, there might be different internal platforms, maybe some legacy thing that should have decommissioned long ago. There may be incentives to get them to use something particular, but smart engineers will always be able to find a reason to use their tool of choice.</p>

<p>Like it or not, those users will frequently judge your platform based on little more than your landing page. Or worse, they may not be aware of your platform at all. This is why it’s essential to have a cohesive, well publicised brand.</p>

<p>Human beings will attribute personality to anything (even a <a href="https://www.youtube.com/watch?v=uAwSVOlOgH8&amp;t=5s">pencil</a>). This is why companies like <a href="https://monzo.com/tone-of-voice/">Monzo focus so much on the language used to communicate with customers</a>.  Your users <strong>will</strong> attribute a personality to your platform, and it is within your power to help define this.</p>

<ul>
  <li>Your platform should have a good name. You should use this name consistently in internal documentation and communications.</li>
  <li>Your platform should also have a recognisable logo. Consider having vinyl stickers made. People love stickers, and it’s a great way of getting your platform noticed.</li>
  <li>It should be possible to find your platform easily, using it’s name, on your corporate intranet. You should have a landing page describing your product in clear terms. The landing page should also link to the customer-facing documentation</li>
  <li>You should engage with your customers. Your pipeline will depend on your specific organisation, but reaching out to Product Managers, Project Managers, Architects and other engineering teams will help you</li>
  <li>Speaking the same language as your customer, in the same forums, helps you to understand their problems better, and encourages them to see you as a trusted partner, rather than a reluctant provider.</li>
  <li>Publicise your long-term roadmap, acknowledging any common functionality gaps and helping people to identify when those features should be available</li>
</ul>

<h1 id="simplify-onboarding">Simplify onboarding</h1>

<p>Do people need to jump through multiple administrative hoops to use your platform? Do they need to spend ages configuring tools and environments? How easy is it for people to go from having an idea, to getting their application up-and-running?</p>

<ul>
  <li>Don’t rely on humans for (most) onboarding. Having your engineers hand-hold people is fine when you’re just starting out, but will soon become a bottleneck to adoption. Focus on being hands-off for as much of the process as possible.</li>
  <li>Use your organisation’s existing tooling for onboarding. Do you use SharePoint? ServiceNow? Can you integrate your onboarding into those existing mechanisms? That makes the process more discoverable for your users. Delegating this may also allow you to use their existing authentication, approval and attestation/auditing tooling.</li>
  <li>During the automated onboarding, don’t ask questions that you don’t need the answers to. It’s easy to fall into a trap of requesting a lot of information from a customer up-front “just in case”, but every question you ask increases the complexity of accessing your platform. Instead of asking for the customer’s e-mail address, cost center or is this maybe something that you can get from other sources like Active Directory?</li>
  <li>Similarly don’t request approvals with no real benefit. Approvals shouldn’t be used for visibility, and if you find yourself regularly approving requests from new customers without performing any real due-diligence, then it’s likely you are just adding delay to a process that doesn’t require it.</li>
  <li>Hide complex processes, especially those that can’t yet be automated. Perhaps your platform needs to integrate with a legacy system for which there is no practical API. You could instead raise a ticket to the appropriate team on behalf of your user. I’ve seen this called <a href="https://stackingthebricks.com/the-fine-art-of-flintstoning/">Flintstoning</a> or <a href="https://blog.danslimmon.com/2019/07/15/do-nothing-scripting-the-key-to-gradual-automation/">Do-nothing scripting</a>.</li>
</ul>

<h1 id="focus-on-customer-service">Focus on customer service</h1>

<p>Good customer service is one of those things that’s really easy to talk about, but very difficult to put into practice. Good platform engineers are hard to find, and good platform engineers who enjoy engaging with customers are even rarer.</p>

<p>What does customer service even mean in terms of building a platform?</p>

<ul>
  <li>Be where your customers are, and engage with them on their own terms. Do they use Slack? Then you should have a channel. Do they use Jira? Or Asana? Then you should consider tracking backlog items there. (I encourage you to make your own platform backlog open to your customers, letting them help to prioritise new features).</li>
  <li>Be diligent about answering questions and responding to requests quickly. Ideally respond with links to documentation! From your perspective, the customer’s question is just one of the many things you need to do that day, but oftentimes, that customer is now blocked waiting on a response from you. For every customer that escalates, or chases, you should assume that there are many more who simply work around you.</li>
  <li>Appreciate that the platform is often the “front door” for your customers to consume a number of services. You may not be directly responsible for backups, or monitoring, or observability; but as customers are consuming those services via your platform, then you will bear some responsibility for their service. Consider it in your best interest to help those teams to provide your customers a great service.</li>
</ul>

<h1 id="have-great-customer-facing-documentation">Have great customer-facing documentation</h1>

<p>The majority of your customers are developers, and developers <a href="https://hackernoon.com/nerds-dont-respond-to-marketing-try-technical-documentation-instead">love good documentation</a>.</p>

<ul>
  <li>Structure your documentation. The <a href="https://diataxis.fr/">Diátaxis</a> framework is a good start, but don’t be afraid of extending it to support your specific use-case. For example a “Getting started” guide, and an FAQ could probably exist within the framework, but it might be worth bringing them out to the forefront.</li>
  <li>Have a clear tutorial on your simplest possible use-case. For example, an imperative command-line to deploy an application or virtual machine. The tutorial doesn’t need to create anything useful, you’re just trying to encourage users to make that first step</li>
  <li>Use that tutorial as a springboard to link to more complex tutorials. Try to have some representative tutorials: using your API, creating complex architectures</li>
  <li>Constantly prune your documentation. Read through it yourself, check that hyperlinks are not stale, consolidate. Maintenance of documentation is like gardening, it will never be perfect or complete, and requires constant work to prevent deterioration.</li>
  <li>To support this, the platform team should be able to update the documentation with minimal friction. Sure… your solution which builds the documentation automatically from code might be really clever. But if the developers cannot make changes quickly, inertia will just make it more likely that your documentation goes stale. It might not be trendy, but Confluence and SharePoint exist for a reason.</li>
</ul>

<h1 id="conclusion">Conclusion</h1>

<p>There’s obviously more to building a great developer platform than the short list of tips above. But hopefully the advice will help you if you are either planning on building a new platform; or you are just getting ready to launch and wondering what you still need to do.</p>

<p>If you have been building platforms for a while, and have got any other tips, please feel free to add them in the comments below.</p>]]></content><author><name></name></author><category term="platform-engineering" /><summary type="html"><![CDATA[Teams launching new internal developer platforms often fall into the trap of creating technically-advanced solutions, using cutting edge tooling, but forgetting to think much about usability from the customer perspective. I think this is typically because these platforms been built by engineers who have inevitably been immersed in those specific technologies for so long that they’ve forgotten what it’s like to approach it for the first time.]]></summary></entry><entry><title type="html">The Bacon Test</title><link href="https://ben.neise.co.uk/2022/04/14/the-bacon-test.html" rel="alternate" type="text/html" title="The Bacon Test" /><published>2022-04-14T12:55:00+01:00</published><updated>2022-04-14T12:55:00+01:00</updated><id>https://ben.neise.co.uk/2022/04/14/the-bacon-test</id><content type="html" xml:base="https://ben.neise.co.uk/2022/04/14/the-bacon-test.html"><![CDATA[<p><img src="/assets/michelle-shelly-captures-it-TJzhTJ2U8Jo-unsplash.jpg" alt="bacon" class="center-image" />
Photo by <a href="https://unsplash.com/@newlayer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Michelle @Shelly Captures It</a> on <a href="https://unsplash.com/photos/TJzhTJ2U8Jo?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></p>

<p>It’s fair to say that the primary toolset used by our private-cloud engineers (vRealize Automation and vRealize Orchestrator) are not widely used, and we historically have not had have a large pool of experienced local talent from which to draw. We therefore tended to hire general IT people with a knack for solving technical problems. These people tend to be infrastructure engineers with a flair for automation.</p>

<!--more-->

<p>This gave us a problem when it came to designing a technical test which would allow us to fairly judge a candidate’s potential competence on a piece of software which they were unlikely to have had any prior experience.</p>

<p>To solve this problem, we came up with <em>The Bacon Test</em>. This is a take-home test normally issued after the first interview. The test is as follows…</p>

<blockquote>
  <p>In publishing and graphic design, Lorem ipsum is a filler text or greeking commonly used to demonstrate the textual elements of a graphic document or visual presentation. Replacing meaningful content with placeholder text allows designers to design the form of the content before the content itself has been produced. However, it’s very boring. What we’d like is the tasty functionality from https://baconipsum.com/json-api/ in a PowerShell, Python or Bash script, so that the output can be used in other scripts.</p>

  <p>The question is deliberately vague as we want to know how you approach the problem (and even how you provide the answer). However, don’t feel like you need to engineer an entire solution; this shouldn’t take more than a couple of hours.</p>
</blockquote>

<p>The lack of instructions gives people a lot of scope for answering the question. Someone at the start of their career, may provide a simple bash script. Someone with slightly more experience, a more comprehensive Python script. Someone more senior might provide an elegant, modular solution alongside some design documentation.</p>

<p>We’ve found that this has worked very well for us. It’s quick enough that people are more inclined to do it. It’s also obviously <em>not</em> real work that we’re trying to get done for free (we’re not <a href="https://www.edinburghlive.co.uk/news/edinburgh-news/brewdog-accused-stealing-marketing-ideas-16289137">Brewdog</a>!).</p>

<p>Reviewing the submission is more of an art than a science, and generally gives us some good discussion points for the second interview.</p>

<p>If they supplied code</p>
<ul>
  <li>Did it work?</li>
  <li>Is it commented?</li>
  <li>Is it of sufficient quality?</li>
  <li>How did they approach the problem?</li>
  <li>Which tools did they choose to solve the problem?</li>
</ul>

<p>Also, how did they submit the response?</p>
<ul>
  <li>Was it shared via their GitHub profile?</li>
  <li>E-mailed as an attachment?</li>
  <li>Pasted into the e-mail?</li>
  <li>Did they over-engineer the solution? Or under-engineer?</li>
  <li>Most importantly … did they enjoy it? This is after all a flavour of the work they will be required to do most days!</li>
</ul>

<p>We don’t judge people on how long they took to complete the exercise. So long as the candidate communicated any potential delays (<em>“I’m moving house”</em> / <em>“I’m going on holiday”</em> / <em>“I have a sick cat”</em>), we try to respect people’s free time, and their personal circumstances.</p>

<p>Over the years we have been using the bacon test; we’ve found that it has proven to be a fairly accurate barometer of - not just someone’s technical ability - but their approach to solving a problem.</p>

<p>And yes, we do also <a href="https://catfact.ninja/">offer a vegetarian option</a>!</p>]]></content><author><name></name></author><category term="team-management" /><summary type="html"><![CDATA[Photo by Michelle @Shelly Captures It on Unsplash It’s fair to say that the primary toolset used by our private-cloud engineers (vRealize Automation and vRealize Orchestrator) are not widely used, and we historically have not had have a large pool of experienced local talent from which to draw. We therefore tended to hire general IT people with a knack for solving technical problems. These people tend to be infrastructure engineers with a flair for automation.]]></summary></entry><entry><title type="html">Using the vRealize 7.x REST API to get a tenant’s Event Broker subscriptions</title><link href="https://ben.neise.co.uk/2018/02/14/using-the-vrealize-7-x-rest-api-to-get-a-tenants-event-broker-subscriptions.html" rel="alternate" type="text/html" title="Using the vRealize 7.x REST API to get a tenant’s Event Broker subscriptions" /><published>2018-02-14T10:37:07+00:00</published><updated>2018-02-14T10:37:07+00:00</updated><id>https://ben.neise.co.uk/2018/02/14/using-the-vrealize-7-x-rest-api-to-get-a-tenants-event-broker-subscriptions</id><content type="html" xml:base="https://ben.neise.co.uk/2018/02/14/using-the-vrealize-7-x-rest-api-to-get-a-tenants-event-broker-subscriptions.html"><![CDATA[<p>After migrating from vRealize Automation (vRA) 6.2, we’ve recently started the long-overdue work of investigating the new functionality introduced with the event broker. We’re still using the state-change triggered workflows for machine life-cycle integration between vRA and vRealize Orchestration (vRO), and that’s going to be a big-job to change; but I thought I could maybe look at one of our other requirements which was to ensure that changes to blueprints made using the GUI get stored in source control.</p>

<!--more-->

<p>I managed to configure a simple use-case which was a trigger which will fire whenever a change is made to a blueprint. I got everything working in our development environment, then wanted to move the work to the live environment.</p>

<p>Our normal process for promoting objects (blueprints, reservations, property definitions, etc.) is to use the REST API to GET the JSON from the development environment, then PUT/POST it to live. This ensures that the GUIDs are consistent, and saves someone having to recreate complex objects. We’ve got some internal PowerShell modules to help with this, and some Jenkins jobs to manage promotion.</p>

<p>As this was the first subscription we’ve created, we had none of this available, so my first task was checking that I could GET the JSON representing the event broker subscription which I’d just created.</p>

<p>The <a href="https://code.vmware.com/apis/164/vra-advanced-designer#!/get45operation/get_api_event_broker_subscriptions">documentation</a> suggested that I should be able to run the following operation:-</p>

<p><code class="language-plaintext highlighter-rouge">GET https://&lt;vraServer&gt;/advanced-designer-service/api/event-broker/subscriptions</code></p>

<p>However, when I tried this, in <a href="https://www.getpostman.com/">Postman</a> using a Tenant Administrator account, I got the following response:-</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span>
    <span class="dl">"</span><span class="s2">errors</span><span class="dl">"</span><span class="p">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="dl">"</span><span class="s2">code</span><span class="dl">"</span><span class="p">:</span> <span class="mi">50505</span><span class="p">,</span>
            <span class="dl">"</span><span class="s2">message</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">System exception.</span><span class="dl">"</span><span class="p">,</span>
            <span class="dl">"</span><span class="s2">systemMessage</span><span class="dl">"</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Access is denied</span><span class="dl">"</span><span class="p">,</span>
            <span class="dl">"</span><span class="s2">moreInfoUrl</span><span class="dl">"</span><span class="p">:</span> <span class="kc">null</span>
        <span class="p">}</span>
    <span class="p">]</span>
<span class="p">}</span>
</code></pre></div></div>
<p>When I tried using <code class="language-plaintext highlighter-rouge">administrator@vsphere.local</code>, the result was slightly better as I got an empty array.</p>

<p>The documentation <em>does</em> make some reference to per-tenant scoping:-</p>

<blockquote>
  <p><strong>Workflow Subscriptions</strong></p>

  <p>Workflow subscriptions use the event broker service to monitor the registered services for event messages in vRealize Automation, and then run a specified vRealize Orchestrator workflow when the conditions in the subscription are met.</p>

  <p>To configure the subscription, you specify the event topic, the triggering conditions, and the workflow that runs when triggered.</p>

  <p>Tenant administrators can create and manage the workflow subscriptions that are specific to their tenant. The system administrator can create and manage system workflow subscriptions. The created system workflow subscriptions are active for events in any tenant and for system events.</p>
</blockquote>

<p>So. on a hunch, I tried scoping the query, in much the same way as the other XaaS (Advanced Service Designer) queries:-</p>

<p><code class="language-plaintext highlighter-rouge">GET https://&lt;vraServer&gt;/advanced-designer-service/api/tenants/&lt;tenantId&gt;/event-broker/subscriptions/</code></p>

<p>In this case, as I was using the default tenant, the <code class="language-plaintext highlighter-rouge">tenantId</code> was simply <code class="language-plaintext highlighter-rouge">vsphere.local</code>. This worked perfectly, allowing me to GET the JSON.</p>

<p>Now, the next job is to wrap-up all of the CRUD operations into our PowerShell module!</p>]]></content><author><name></name></author><category term="vmware-aria-automation" /><summary type="html"><![CDATA[After migrating from vRealize Automation (vRA) 6.2, we’ve recently started the long-overdue work of investigating the new functionality introduced with the event broker. We’re still using the state-change triggered workflows for machine life-cycle integration between vRA and vRealize Orchestration (vRO), and that’s going to be a big-job to change; but I thought I could maybe look at one of our other requirements which was to ensure that changes to blueprints made using the GUI get stored in source control.]]></summary></entry><entry><title type="html">More re-organisation</title><link href="https://ben.neise.co.uk/2018/02/14/more-reorganisation.html" rel="alternate" type="text/html" title="More re-organisation" /><published>2018-02-14T10:37:07+00:00</published><updated>2018-02-14T10:37:07+00:00</updated><id>https://ben.neise.co.uk/2018/02/14/more-reorganisation</id><content type="html" xml:base="https://ben.neise.co.uk/2018/02/14/more-reorganisation.html"><![CDATA[<p>I’ve moved the site out of <a href="https://ghost.org/">Ghost</a> (where I’d managed to end up in some version <em>cul-de-sac</em>, which was going to require multiple intermediate migrations to get out of), and into <a href="https://jekyllrb.com/">Jekyll</a>.</p>

<!--more-->

<p>I’ll also be purging some older posts (I suspect people are no longer interested in training resources for vSphere 4!).</p>]]></content><author><name></name></author><category term="admin" /><summary type="html"><![CDATA[I’ve moved the site out of Ghost (where I’d managed to end up in some version cul-de-sac, which was going to require multiple intermediate migrations to get out of), and into Jekyll.]]></summary></entry><entry><title type="html">Using VMware vRealize Orchestrator to run a Jenkins job and get the results</title><link href="https://ben.neise.co.uk/2016/09/05/vro-jenkins.html" rel="alternate" type="text/html" title="Using VMware vRealize Orchestrator to run a Jenkins job and get the results" /><published>2016-09-05T19:10:48+01:00</published><updated>2016-09-05T19:10:48+01:00</updated><id>https://ben.neise.co.uk/2016/09/05/vro-jenkins</id><content type="html" xml:base="https://ben.neise.co.uk/2016/09/05/vro-jenkins.html"><![CDATA[<p><img src="/assets/jenkins.png" alt="jenkins" class="center-image" /></p>

<p><a href="http://www.vmware.com/products/vrealize-orchestrator.html">VMware vRealize Orchestrator</a> (vRO) is pretty flexible, but there are times when you still need to execute a job on <a href="https://jenkins.io/">Jenkins</a>. <!--more--> It’s pretty easy to <a href="https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API">create a Jenkins job which you can run by hitting a specific URL</a> and vRO can do this in a couple of lines of JavaScript:-</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">urlObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">URL</span><span class="p">(</span><span class="nx">yourJobUrl</span><span class="p">);</span>
<span class="nx">urlObject</span><span class="p">.</span><span class="nx">getContent</span><span class="p">();</span>
</code></pre></div></div>

<p>This works well enough, assuming that you don’t need to wait on the job to complete and/or check that it completed successfully. If you do need to to do either of those things, then you need to use vRO’s REST capabilities.</p>

<p>In this article, I’ll describe how to set up and use a Jenkins REST host in vRO. Before we start, I’m assuming you’re familiar (at least to some degree) with Jenkins, vRO and JavaScript.</p>

<h2 id="running-a-simple-jenkins-no-build-parameters">Running a simple Jenkins (no build parameters)</h2>

<h3 id="create-the-example-jenkins-job">Create the example Jenkins job</h3>

<ol>
  <li>I created a simple Jenkins job, which requires no build parameters. It returns a single cat fact from <a href="http://catfacts-api.appspot.com">catfacts-api.appspot.com</a>. To do this, I’m using the <a href="https://wiki.jenkins-ci.org/display/JENKINS/PowerShell+Plugin">PowerShell plug-in</a> to run a single-line of PowerShell (<code class="language-plaintext highlighter-rouge">((Invoke-Webrequest -Uri "http://catfacts-api.appspot.com/api/facts?number=1" -UseBasicParsing).content | ConvertFrom-Json).facts</code>). What the job does isn’t really important though, I just wanted something slightly more interesting than a random number generator, or a “Hello World!”.</li>
  <li>Under the <strong>Build triggers</strong> section, make sure that <strong>Trigger builds remotely (e.g., from scripts)</strong> is set. You should also <a href="http://randomkeygen.com">create an authentication token</a>.</li>
  <li><strong>Build</strong> the job in Jenkins to confirm that it works, the console output should look something like this:-</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Started by user Neise, Ben
Building remotely on ######## (#################################) in workspace #:\Resources\jenkins\workspace\###########\Generate Cat Fact
[Generate Cat Fact] $ powershell.exe "&amp; 'C:\Users\############\AppData\Local\Temp\#####################.ps1'"
Cat families usually play best in even numbers. Cats and kittens should be acquired in pairs whenever possible.
Finished: SUCCESS
</code></pre></div></div>

<h3 id="create-the-orchestrator-rest-host--rest-operation">Create the Orchestrator REST Host &amp; REST Operation</h3>

<p>We need to create a REST host object representing the Jenkins server, and a REST operation representing the specific job.</p>

<ol>
  <li>Run the vRO workflow <strong>Library\Configuration\Add a REST host</strong> and configure <strong>Host Properties</strong> as follows:
    <ul>
      <li>Name: <code class="language-plaintext highlighter-rouge">My Jenkins Server</code></li>
      <li>URL: <code class="language-plaintext highlighter-rouge">http://:8080/jenkins/</code> (use the URL and port of your Jenkins server)</li>
      <li>Connection timeout (seconds): <code class="language-plaintext highlighter-rouge">30.0</code> (you may wish to tune this for your specific requirements, but I’m leaving it as the default for now)</li>
      <li>Operation timeout (seconds): <code class="language-plaintext highlighter-rouge">60.0</code> (you may wish to tune this for your specific requirements, but I’m leaving it as the default for now)</li>
      <li>Configure <strong>Proxy settings</strong></li>
      <li>Use Proxy: <code class="language-plaintext highlighter-rouge">No</code> (Unless you have a proxy!)</li>
      <li>Configure <code class="language-plaintext highlighter-rouge">Host Authentication</code></li>
      <li>Host’s authentication type: <code class="language-plaintext highlighter-rouge">NONE</code></li>
    </ul>
  </li>
  <li>Now run the Orchestrator workflow <strong>Library\Configuration\Add a REST Operation and configure **Operation properties</strong> as follows:
    <ul>
      <li>Parent host: Select your new REST host <code class="language-plaintext highlighter-rouge">My Jenkins Server</code> (or whatever you called it)</li>
      <li>Name: <code class="language-plaintext highlighter-rouge">Generate cat fact</code></li>
      <li>Template URL: This should be the URL to your job. You should be able to see this below the <strong>Trigger builds remotely (e.g., from scripts)</strong> section in the Jenkins job configuration. It will look something like <code class="language-plaintext highlighter-rouge">/job/Generate%20Cat%20Fact/build?token=xxxxxxxxxxxxxxxxxxxxxxxxx</code></li>
      <li>HTTP Method: <code class="language-plaintext highlighter-rouge">GET</code></li>
    </ul>
  </li>
  <li>You can test this operation by right-clicking, then selecting <strong>Run workflow &gt; Invoke a REST operation &gt; Submit.</strong> It should run without errors (but it won’t wait for the Jenkins job to complete, or give you any output)</li>
</ol>

<h3 id="create-the-vro-workflow-which-will-run-the-jenkins-job-and-get-the-results">Create the vRO Workflow which will run the Jenkins job, and get the results</h3>

<p>Now we need an Orchestrator workflow which runs the operation, waits for it to complete and displays the status and output.</p>

<ol>
  <li>Using the Orchestrator client, create a new workflow. I’m going to call mine <strong>Cat fact</strong></li>
  <li>The workflow needs a single attribute of type <code class="language-plaintext highlighter-rouge">REST:RESTOperation</code>, this should be set to your REST operation. My operation is <code class="language-plaintext highlighter-rouge">Generate cat fact</code> and I named this attribute <code class="language-plaintext highlighter-rouge">generateCatFact</code>.</li>
  <li>The workflow needs a single scriptable task, the <code class="language-plaintext highlighter-rouge">REST:Operation</code> attribute named <code class="language-plaintext highlighter-rouge">generateCatFact</code> should be bound as an input. The script should be something like this.</li>
</ol>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">var</span> <span class="nx">jenkinsPollingIntervalMS</span> <span class="o">=</span> <span class="mi">1000</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">buildURL</span> <span class="o">=</span> <span class="dl">""</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">buildResult</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

<span class="cm">/*
    Create the request object. The two paramaters are:-
     - An array of values for the URL template paramaters. We have none, so this is null
     - Any content for POST or PUT operations. Ours is a GET, so this is also nulll
*/</span>
<span class="kd">var</span> <span class="nx">objRESTRequest</span> <span class="o">=</span> <span class="nx">generateCatFact</span><span class="p">.</span><span class="nx">createRequest</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span><span class="kc">null</span><span class="p">);</span>
<span class="c1">// Execute the REST operation</span>
<span class="kd">var</span> <span class="nx">objRESTResponse</span> <span class="o">=</span> <span class="nx">objRESTRequest</span><span class="p">.</span><span class="nx">execute</span><span class="p">();</span>
<span class="nx">System</span><span class="p">.</span><span class="nx">debug</span><span class="p">(</span><span class="dl">"</span><span class="s2">Status code: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">objRESTResponse</span><span class="p">.</span><span class="nx">statusCode</span><span class="p">);</span>
<span class="c1">// The location property gives us the URL of the queue item</span>
<span class="nx">System</span><span class="p">.</span><span class="nx">debug</span><span class="p">(</span><span class="dl">"</span><span class="s2">Location: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">objRESTResponse</span><span class="p">.</span><span class="nx">getAllHeaders</span><span class="p">().</span><span class="kd">get</span><span class="p">(</span><span class="dl">"</span><span class="s2">Location</span><span class="dl">"</span><span class="p">));</span>

<span class="c1">// Wait for job to be queued by looking for an "executable" property on the response</span>
<span class="k">while</span> <span class="p">(</span><span class="nx">buildURL</span> <span class="o">===</span> <span class="dl">""</span><span class="p">){</span>
    <span class="kd">var</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">objRESTResponse</span><span class="p">.</span><span class="nx">getAllHeaders</span><span class="p">().</span><span class="kd">get</span><span class="p">(</span><span class="dl">"</span><span class="s2">Location</span><span class="dl">"</span><span class="p">)</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">api/json</span><span class="dl">"</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">urlObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">URL</span><span class="p">(</span><span class="nx">url</span><span class="p">);</span>
    <span class="nx">result</span> <span class="o">=</span> <span class="nx">urlObject</span><span class="p">.</span><span class="nx">getContent</span><span class="p">()</span> <span class="p">;</span>
    <span class="c1">//System.debug(result);</span>
    <span class="kd">var</span> <span class="nx">objResult</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">result</span><span class="p">);</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">objResult</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="dl">"</span><span class="s2">executable</span><span class="dl">"</span><span class="p">)){</span>
        <span class="nx">System</span><span class="p">.</span><span class="nx">debug</span><span class="p">(</span><span class="nx">objResult</span><span class="p">.</span><span class="nx">executable</span><span class="p">.</span><span class="nx">url</span><span class="p">);</span>
        <span class="nx">buildURL</span> <span class="o">=</span> <span class="nx">objResult</span><span class="p">.</span><span class="nx">executable</span><span class="p">.</span><span class="nx">url</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">System</span><span class="p">.</span><span class="nx">sleep</span><span class="p">(</span><span class="nx">jenkinsPollingIntervalMS</span><span class="p">);</span>
<span class="p">}</span>

<span class="c1">// Now that the job's queued, we need to wait for it to be completed</span>
<span class="k">while</span> <span class="p">(</span><span class="nx">buildResult</span> <span class="o">===</span> <span class="kc">null</span><span class="p">){</span>
    <span class="nx">url</span> <span class="o">=</span> <span class="nx">buildURL</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">api/json</span><span class="dl">"</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">urlObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">URL</span><span class="p">(</span><span class="nx">url</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">result</span> <span class="o">=</span> <span class="nx">urlObject</span><span class="p">.</span><span class="nx">getContent</span><span class="p">()</span> <span class="p">;</span>
    <span class="kd">var</span> <span class="nx">objResult</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">result</span><span class="p">);</span>
    <span class="nx">System</span><span class="p">.</span><span class="nx">debug</span><span class="p">(</span><span class="nx">result</span><span class="p">);</span>
    <span class="nx">System</span><span class="p">.</span><span class="nx">debug</span><span class="p">(</span><span class="dl">"</span><span class="s2">Build result:</span><span class="dl">"</span> <span class="o">+</span> <span class="nx">buildResult</span><span class="p">);</span>
    <span class="nx">buildResult</span> <span class="o">=</span> <span class="nx">objResult</span><span class="p">.</span><span class="nx">result</span><span class="p">;</span>
    <span class="nx">System</span><span class="p">.</span><span class="nx">sleep</span><span class="p">(</span><span class="nx">jenkinsPollingIntervalMS</span><span class="p">);</span>
<span class="p">}</span>

<span class="nx">url</span> <span class="o">=</span> <span class="nx">objResult</span><span class="p">.</span><span class="nx">url</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">consoleText</span><span class="dl">"</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">urlObject</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">URL</span><span class="p">(</span><span class="nx">url</span><span class="p">);</span>
<span class="nx">result</span> <span class="o">=</span> <span class="nx">urlObject</span><span class="p">.</span><span class="nx">getContent</span><span class="p">();</span>
<span class="c1">// The result is the actual console output.</span>
<span class="nx">System</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">result</span><span class="p">);</span>
<span class="nx">System</span><span class="p">.</span><span class="nx">debug</span><span class="p">(</span><span class="dl">"</span><span class="s2">Build Result: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">buildResult</span><span class="p">);</span>
</code></pre></div></div>

<ol>
  <li>When run, the output should look something like this:-
    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[2016-01-05 10:17:10.850] [D] Status code: 201 [2016-01-05 10:17:10.850] [D] Location: http://##################:8080/jenkins/queue/item/27553/ [2016-01-05 10:17:18.995] [D] http://##################/jenkins/job/Orchestration/job/Generate%20Cat%20Fact/6/ [2016-01-05 10:17:20.035] [D] {"actions":[{"causes":[{"shortDescription":"Started by remote host ##.##.##.##"}]}],"artifacts":[],"building":true,"description":null,"duration":0,"estimatedDuration":2304,"executor":{},"fullDisplayName":"Orchestration ┬╗ Generate Cat Fact #6","id":"2016-01-05_10-17-18","keepLog":false,"number":6,"result":null,"timestamp":1451989038408,"url":"http://##################/jenkins/job/Orchestration/job/Generate%20Cat%20Fact/6/","builtOn":"########","changeSet":{"items":[],"kind":null},"culprits":[]} [2016-01-05 10:17:20.035] [D] Build result:null [2016-01-05 10:17:21.074] [D] {"actions":[{"causes":[{"shortDescription":"Started by remote host ##.##.##.##"}]},{}],"artifacts":[],"building":false,"description":null,"duration":2233,"estimatedDuration":2300,"executor":null,"fullDisplayName":"Orchestration ┬╗ Generate Cat Fact #6","id":"2016-01-05_10-17-18","keepLog":false,"number":6,"result":"SUCCESS","timestamp":1451989038408,"url":"http://##################/jenkins/job/Orchestration/job/Generate%20Cat%20Fact/6/","builtOn":"########","changeSet":{"items":[],"kind":null},"culprits":[]} [2016-01-05 10:17:21.074] [D] Build result:null [2016-01-05 10:17:22.114] [I] Started by remote host ##.##.##.## Building remotely on ######## (############# ######### ####### ##########) in workspace E:\Resources\jenkins\workspace\Orchestration\Generate Cat Fact [Generate Cat Fact] $ powershell.exe "&amp; 'C:\Users###########\AppData\Local\Temp\hudson6191574617805554949.ps1'" The life expectancy of cats has nearly doubled since 1930 - from 8 to 16 years. Finished: SUCCESS [2016-01-05 10:17:22.114] [D] Build Result: SUCCESS
</code></pre></div>    </div>
  </li>
</ol>

<h2 id="running-a-more-complex-jenkins-job-with-build-parameters">Running a more complex Jenkins job with build parameters</h2>

<h3 id="create-the-jenkins-job">Create the Jenkins job</h3>

<ol>
  <li>I created another job, using the same <a href="http://catfacts-api.appspot.com">cat facts api</a>, but this time it allows multiple cat facts to be returned.</li>
  <li>The job has a single string parameter named <code class="language-plaintext highlighter-rouge">facts</code>, this parameter is used in the job like so <code class="language-plaintext highlighter-rouge">((Invoke-Webrequest -Uri "http://catfacts-api.appspot.com/api/facts?number=:$env:facts" -UseBasicParsing).content | ConvertFrom-Json).facts</code></li>
</ol>

<h3 id="create-the-vro-rest-host--rest-operation">Create the vRO REST Host &amp; REST Operation</h3>

<ol>
  <li>We’re going to use the same REST host object, but create a new operation.</li>
  <li>Run the Orchestrator workflow <strong>Library\Configuration\Add a REST Operation</strong> and configure <strong>Operation properties</strong>
    <ul>
      <li>Parent host: Select your REST host</li>
      <li>Name: <code class="language-plaintext highlighter-rouge">Generate cat facts</code></li>
      <li>Template URL: As before, you can get the URL from under the <strong>Trigger builds remotely</strong> section on the Jenkins job configuration. You’ll need to also pass any parameters. In the example, we need to pass <code class="language-plaintext highlighter-rouge">facts</code>. The Orchestrator dialog explains the placeholder syntax requires that runtime parameters be surrounded by curly-braces, so you should end up with something like this <code class="language-plaintext highlighter-rouge">/job/Generate%20Cat%20Facts/buildWithParameters?facts={facts}&amp;token=xxxxxxxxxxxxxxxxxxxxxx</code></li>
      <li>HTTP Method: <code class="language-plaintext highlighter-rouge">GET</code></li>
    </ul>
  </li>
  <li>You can test this operation by right-clicking, then selecting <strong>Run workflow &gt; Invoke a REST operation &gt; Submit</strong>. It should run without errors (but it won’t wait for the Jenkins job to complete, or give you any output)</li>
</ol>

<h3 id="create-the-vro-workflow-which-will-run-the-jenkins-job-and-get-the-results-1">Create the vRO Workflow which will run the Jenkins job, and get the results</h3>

<ol>
  <li>Duplicate the <strong>Cat fact</strong> Orchestrator workflow we created above (on the right-click menu), name it <strong>Cat facts</strong>, and make the following changes:
    <ul>
      <li>Create a single input called <code class="language-plaintext highlighter-rouge">facts</code> of type <code class="language-plaintext highlighter-rouge">Number</code>.</li>
      <li>Bind <code class="language-plaintext highlighter-rouge">facts</code> to the <code class="language-plaintext highlighter-rouge">Scriptable task</code>. The scriptable task should have two inputs  - <code class="language-plaintext highlighter-rouge">facts</code> (a <code class="language-plaintext highlighter-rouge">Number</code>), and <code class="language-plaintext highlighter-rouge">generateCatFacts</code> (a <code class="language-plaintext highlighter-rouge">REST:RESTOperation</code>).</li>
      <li>In the scriptable task, change the line <code class="language-plaintext highlighter-rouge">var objRESTRequest = generateCatFact.createRequest(null,null);</code> to <code class="language-plaintext highlighter-rouge">var objRESTRequest = generateCatFact.createRequest([facts],null);</code>, this will now pass the REST operation an array containing a single element (the facts input). If you have multiple inputs, you simply add them as items in this array in the order in which they are required in the URL (which is defined in the REST operation).</li>
    </ul>
  </li>
  <li>Run the new vRO job, and enter a valid input (for <a href="https://catfacts-api.appspot.com/doc.html">this API</a>, something between 1-100). You should now get the Jenkins console output in your Orchestrator console. Obviously, outputting the job result and console output to screen is of limited use, but you are now able to parse those values and bind them to workflow outputs.</li>
</ol>]]></content><author><name></name></author><category term="vmware-aria-automation-orchestrator" /><summary type="html"><![CDATA[VMware vRealize Orchestrator (vRO) is pretty flexible, but there are times when you still need to execute a job on Jenkins.]]></summary></entry><entry><title type="html">vRealize Automation - Setting the Orchestrator Server using Custom Properties</title><link href="https://ben.neise.co.uk/2015/05/29/vra-setting-the-vro-using-custom-properties.html" rel="alternate" type="text/html" title="vRealize Automation - Setting the Orchestrator Server using Custom Properties" /><published>2015-05-29T13:24:49+01:00</published><updated>2015-05-29T13:24:49+01:00</updated><id>https://ben.neise.co.uk/2015/05/29/vra-setting-the-vro-using-custom-properties</id><content type="html" xml:base="https://ben.neise.co.uk/2015/05/29/vra-setting-the-vro-using-custom-properties.html"><![CDATA[<p><img src="/assets/vro_logo.png" alt="vcologo" class="center-image" /></p>

<p>We’re soon going to be implementing multiple <a href="http://www.vmware.com/uk/products/vrealize-orchestrator">vRealize Orchestrator</a> (vRO) servers in our <a href="http://www.vmware.com/uk/products/vrealize-automation">vRealize Automation </a>(vRA) development environment to allow people to choose different endpoints. Essentially if someone’s working on a workflow, that shouldn’t affect a different developer who is testing a template. So I wanted a way of allowing customers (in this case, developers) to choose from a list of Orchestrator endpoints.</p>

<!--more-->

<p>This might be useful in the following cases:</p>

<ul>
  <li>Allowing specific customers to use their own Orchestrators (for example in different domains)</li>
  <li>Having multiple Development Orchestrators at various stages of “done”. So workflow developers can break workflows without hampering anyone else’s ability to deploy machines.</li>
  <li>Using a Development Orchestrator from Production. For example some of our customer’s Blueprints can’t be tested in DEV as we don’t have the same networks available.</li>
</ul>

<p>Thankfully, using <a href="http://pubs.vmware.com/vCAC-61/topic/com.vmware.ICbase/PDF/vcloud-automation-center-61-custom-property-reference.pdf">vRA Custom Properties</a>, this isn’t too difficult to implement.</p>

<p>Before you start, you should be comfortable using Orchestrator with vRA. This isn’t a guide on how to set up vRA/vRO integration. Your vRO server must be set up with all the necessary prerequisites that it would need to work as an endpoint.  If you’ve done this once, you’ve hopefully documented the process, so it’s just a case of replicating it on another server.</p>

<h2 id="create-the-vro-endpoint-in-vra">Create the vRO Endpoint in vRA</h2>

<p>Assuming you haven’t already go multiple endpoints configured; the first thing you’re going to need to do is create one.</p>

<ol>
  <li>Log into your vRealize Automation portal</li>
  <li>Navigate to <strong>Infrastructure</strong> &gt; <strong>Endpoints</strong> &gt; <strong>Endpoints</strong></li>
  <li>Click <strong>New Endpoint</strong> &gt; <strong>Orchestration</strong> &gt; <strong>vCenter Orchestrator</strong>1. <strong>Name</strong>: Give it a useful name</li>
  <li><strong>Address</strong>: use the FQDN of the server</li>
  <li><strong>Credentials:</strong> Select existing credentials, or create new. Remember to use the format <em>username@domain</em></li>
  <li><strong>Custom properties</strong>: Create a new custom property named <strong>VMware.VCenterOrchestrator.Priority</strong> and give it a value. The value you give it depends on which order you would like vRA to attempt to use the server. You should probably set your most stable (production-ready) server with the lowest number.</li>
</ol>

<h2 id="create-the-vra-custom-property">Create the vRA Custom Property</h2>

<p>You can add custom properties that apply to provisioned machines to the following elements:</p>

<ul>
  <li><strong>Reservation</strong>, to apply the custom properties to all machines provisioned from that reservation</li>
  <li><strong>Business group</strong>, to apply the custom properties to all machines provisioned by business group members</li>
  <li><strong>Blueprint</strong>, to apply the custom properties to all machines provisioned from the blueprint</li>
  <li><strong>Build profile</strong>, which can be incorporated into any global or local blueprint, to apply the custom properties to all machines provisioned from the blueprint</li>
</ul>

<p>If you’re going to set it in multiple places, be aware of the <a href="http://pubs.vmware.com/vra-62/index.jsp?topic=%2Fcom.vmware.vra.iaas.cloud.doc%2FGUID-F45F332E-1003-45BC-BC05-0EA2FDE1B31F.html">order of precedence</a>.</p>

<ol>
  <li>Wherever you decide to create the custom attribute, click <strong>New Property</strong></li>
  <li>Create a new property with the Name <strong>VMware.VCenterOrchestrator.EndpointName</strong></li>
  <li>Either leave the <strong>Value</strong> blank  - or  - if you want set it to whatever should be the default Orchestrator.</li>
  <li>Check the <strong>Prompt user</strong> box, and click the green checkmark to save your change before clicking <strong>OK</strong></li>
</ol>

<h2 id="create-the-vra-property-dictionary-entry">Create the vRA Property Dictionary entry</h2>

<p>What we’ve done so far will create an empty text box on one or more blueprints, into which the user can enter an endpoint name. What we want to do next is provide them with a drop-down list of available endpoints.</p>

<ol>
  <li>In vRA navigate to <strong>Infrastructure</strong> &gt; <strong>Blueprints</strong> &gt; <strong>Property Dictionary</strong></li>
  <li>Click <strong>New Property Definition</strong>, set the <strong>name</strong> as <strong>VMware.VCenterOrchestrator.EndpointName</strong>.</li>
  <li>Set the <strong>Display name</strong> to something friendly like <em>Orchestrator</em>, and give it an appropriate description</li>
  <li>Set <strong>Control Type</strong> to <strong>DropDown</strong>, and click the <strong>Required</strong> check box</li>
  <li>Click the green checkmark to save your changes, then click <strong>Ok</strong>.</li>
  <li>Now, edit the <strong>Property Attributes</strong> of the <strong>Property Definition</strong> you just created. Click <strong>New Property Attribute</strong></li>
  <li>Set the <code class="language-plaintext highlighter-rouge">Type</code> to <code class="language-plaintext highlighter-rouge">ValueList</code>, and the name to <code class="language-plaintext highlighter-rouge">VMware.VCenterOrchestrator.EndpointName</code>.</li>
  <li>Set the <strong>Value</strong> to be a comma-seperated list of your Orchestrator endpoint names (copy and paste so that you know you’re getting them right!)</li>
  <li>Click the green checkmark to save your changes, then click <strong>OK</strong></li>
</ol>

<p><img src="/assets/SelectTheOrchestratorServer.png" alt="SelectTheOrchestratorServer" /></p>

<p>Now, test out a catalog request it should give you a drop-down list like this</p>]]></content><author><name></name></author><category term="vmware-aria-automation-orchestrator" /><category term="vmware-aria-automation" /><summary type="html"><![CDATA[We’re soon going to be implementing multiple vRealize Orchestrator (vRO) servers in our vRealize Automation (vRA) development environment to allow people to choose different endpoints. Essentially if someone’s working on a workflow, that shouldn’t affect a different developer who is testing a template. So I wanted a way of allowing customers (in this case, developers) to choose from a list of Orchestrator endpoints.]]></summary></entry><entry><title type="html">Auto-generating PowerShell documentation in MarkDown</title><link href="https://ben.neise.co.uk/2014/10/07/scriptdocumentationinmarkdown.html" rel="alternate" type="text/html" title="Auto-generating PowerShell documentation in MarkDown" /><published>2014-10-07T18:43:34+01:00</published><updated>2014-10-07T18:43:34+01:00</updated><id>https://ben.neise.co.uk/2014/10/07/scriptdocumentationinmarkdown</id><content type="html" xml:base="https://ben.neise.co.uk/2014/10/07/scriptdocumentationinmarkdown.html"><![CDATA[<p><img src="/assets/post-images/2014-10-07-scriptdocumentationinmarkdown.png" alt="Markdown logo" class="center-image" /></p>

<p>I don’t mind writing documentation for my scripts, but I find that most documentation writing exercises tends to suffers from two problems:-</p>

<ul>
  <li><strong>Duplicated effort</strong>  - I tend to document my script inline, (so that <code class="language-plaintext highlighter-rouge">Get-Help</code> will work), why do I need to document the same details elsewhere?</li>
  <li><strong>Keeping it up-to-date</strong>  - The only thing worse than <em>no</em> documentation, is clearly outdated documentation.</li>
</ul>

<!--more-->

<p>I had a folder full of PS1 scripts, each of which had the necessary headers. However, I needed to get this documentation into our repository of choice (a GitLab wiki).</p>

<p>So, in order to save me duplicating some effort, I wrote up a quick function that’ll read the inline documentation from all the PowerShell scripts in a folder, and output a markdown formatted document per script, as well as an index document which links to the others. This imports nicely into a GitLab wiki. At first I thought I’d be lucky, and someone would have created an <code class="language-plaintext highlighter-rouge">ConvertTo-Markdown</code> function, but of course a PowerShell object doesn’t map to a document in the same way that it maps to a table, or a CSV.</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kr">function</span><span class="w"> </span><span class="nf">GenerateScriptDocumentationInMarkdown</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="cm">&lt;#
    </span><span class="cs">.SYNOPSIS</span><span class="cm">
    Generates documentation for a folder-full of scripts using the integrated Get-Help CMDlets.
    
    </span><span class="cs">.DESCRIPTION</span><span class="cm">
    Generates a .markdown document for each PS1 script in a folder which has the necessary headers required by Get-Help. Also generates an index document which lists (and links to) all generated documents. Each file name  is preceded with "script_ps1_" so that they are listed together when viewing the Wiki documents.
    
    </span><span class="cs">.PARAMETER</span><span class="cm"> SourceScriptFolder
    Source folder where the scripts are located

    </span><span class="cs">.PARAMETER</span><span class="cm"> DocumentationOutputFolder
    Output folder where the documentation will be created

    </span><span class="cs">.PARAMETER</span><span class="cm"> DocumentationIndexPath
    The path to a file which will be created, with relative links to the documents which  were created
    
    </span><span class="cs">.EXAMPLE</span><span class="cm">
    GenerateScriptDocumentationInMarkdown -SourceScriptFolder "C:\Git\Lab\Project1\scripts"  -DocumentationOutputFolder "C:\Git\Lab\Project1.wiki\" -DocumentationIndexPath "C:\Git\Lab\Project1.wiki\scripts_Ps1.markdown"
    
    Generates a markdown document for each script in C:\Git\Lab\Project1\scripts in the folder C:\Git\Lab\Project1.wiki\ with an index document at C:\Git\Lab\Project1.wiki\scripts_Ps1.markdown
   
    </span><span class="cs">.NOTES</span><span class="cm">
    Ben Neise 06/10/14
    
#&gt;</span><span class="w">
    </span><span class="kr">param</span><span class="w"> </span><span class="p">(</span><span class="w">
        </span><span class="p">[</span><span class="n">Parameter</span><span class="p">(</span><span class="w">
            </span><span class="n">Mandatory</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">$true</span><span class="p">,</span><span class="w">
            </span><span class="n">Position</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w">
        </span><span class="p">)]</span><span class="w">
        </span><span class="p">[</span><span class="n">ValidateScript</span><span class="p">({</span><span class="w">
            </span><span class="n">Test-Path</span><span class="w"> </span><span class="bp">$_</span><span class="w"> </span><span class="nt">-PathType</span><span class="w"> </span><span class="s1">'Container'</span><span class="w">
        </span><span class="p">})]</span><span class="w"> 
        </span><span class="p">[</span><span class="n">string</span><span class="p">]</span><span class="w"> 
        </span><span class="nv">$SourceScriptFolder</span><span class="p">,</span><span class="w">

        </span><span class="p">[</span><span class="n">Parameter</span><span class="p">(</span><span class="w">
            </span><span class="n">Mandatory</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">$true</span><span class="p">,</span><span class="w">
            </span><span class="n">Position</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w">
        </span><span class="p">)]</span><span class="w">
        </span><span class="p">[</span><span class="n">ValidateScript</span><span class="p">({</span><span class="w">
            </span><span class="n">Test-Path</span><span class="w"> </span><span class="bp">$_</span><span class="w"> </span><span class="nt">-PathType</span><span class="w"> </span><span class="s1">'Container'</span><span class="w">
        </span><span class="p">})]</span><span class="w"> 
        </span><span class="p">[</span><span class="n">string</span><span class="p">]</span><span class="w"> 
        </span><span class="nv">$DocumentationOutputFolder</span><span class="p">,</span><span class="w">

        </span><span class="p">[</span><span class="n">Parameter</span><span class="p">(</span><span class="w">
            </span><span class="n">Mandatory</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">$true</span><span class="p">,</span><span class="w">
            </span><span class="n">Position</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">2</span><span class="w">
        </span><span class="p">)]</span><span class="w">
        </span><span class="nv">$DocumentationIndexPath</span><span class="w">
    </span><span class="p">)</span><span class="w">
    
    </span><span class="nv">$arrParameterProperties</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">@(</span><span class="w">
        </span><span class="s2">"DefaultValue"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"ParameterValue"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"PipelineInput"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"Position"</span><span class="p">,</span><span class="w">
        </span><span class="s2">"Required"</span><span class="w">
    </span><span class="p">)</span><span class="w">

    </span><span class="nv">$scriptNamePrefix</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"script_ps1_"</span><span class="w">
    </span><span class="nv">$scriptNameSuffix</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">".markdown"</span><span class="w">

    </span><span class="c"># Initialise a counter for the progress bar</span><span class="w">
    </span><span class="nv">$i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w">

    </span><span class="c"># Index header</span><span class="w">
    </span><span class="s2">"# PowerShell Scripts</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$DocumentationIndexPath</span><span class="w">

    </span><span class="c"># Get the scripts from the folder</span><span class="w">
    </span><span class="nv">$scripts</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-ChildItem</span><span class="w"> </span><span class="nv">$SourceScriptFolder</span><span class="w"> </span><span class="nt">-Filter</span><span class="w"> </span><span class="s2">"*.ps1"</span><span class="w">
    </span><span class="kr">foreach</span><span class="w"> </span><span class="p">(</span><span class="nv">$script</span><span class="w"> </span><span class="kr">in</span><span class="w"> </span><span class="nv">$scripts</span><span class="p">){</span><span class="w">
        </span><span class="nv">$i</span><span class="w"> </span><span class="o">++</span><span class="w">
        </span><span class="n">Write-Progress</span><span class="w"> </span><span class="nt">-Activity</span><span class="w"> </span><span class="s2">"Documenting scripts"</span><span class="w"> </span><span class="nt">-Status</span><span class="w"> </span><span class="p">(</span><span class="s2">"Script </span><span class="nv">$i</span><span class="s2"> of </span><span class="si">$(</span><span class="nv">$scripts</span><span class="o">.</span><span class="nf">count</span><span class="si">)</span><span class="s2">"</span><span class="p">)</span><span class="w"> </span><span class="nt">-CurrentOperation</span><span class="w"> </span><span class="p">(</span><span class="s2">"Documenting: </span><span class="si">$(</span><span class="nv">$Script</span><span class="o">.</span><span class="nf">BaseName</span><span class="si">)</span><span class="s2">"</span><span class="p">)</span><span class="w"> </span><span class="nt">-PercentComplete</span><span class="w"> </span><span class="p">(</span><span class="nv">$i</span><span class="w"> </span><span class="n">/</span><span class="w"> </span><span class="nv">$scripts</span><span class="o">.</span><span class="nf">count</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="nx">100</span><span class="p">)</span><span class="w">
        </span><span class="nv">$help</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Get-Help</span><span class="w"> </span><span class="nv">$script</span><span class="o">.</span><span class="nf">FullName</span><span class="w"> </span><span class="nt">-ErrorAction</span><span class="w"> </span><span class="s2">"SilentlyContinue"</span><span class="w">
        </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">getType</span><span class="p">()</span><span class="o">.</span><span class="nf">Name</span><span class="w"> </span><span class="o">-eq</span><span class="w"> </span><span class="s2">"String"</span><span class="p">){</span><span class="w">
            </span><span class="c"># If there's no inline help in the script then Get-Help returns a string</span><span class="w">
            </span><span class="n">Write-Error</span><span class="w"> </span><span class="nt">-Message</span><span class="w"> </span><span class="s2">"Inline help not found for script </span><span class="si">$(</span><span class="nv">$script</span><span class="o">.</span><span class="nf">FullName</span><span class="si">)</span><span class="s2">"</span><span class="w">
        </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
            
            </span><span class="c"># Set output filename </span><span class="w">
            </span><span class="nv">$outputFile</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nv">$DocumentationOutputFolder</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$scriptNamePrefix</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$script</span><span class="o">.</span><span class="nf">BaseName</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$scriptNameSuffix</span><span class="w">

            </span><span class="c"># Add the script basename and synopsis to the index </span><span class="w">
            </span><span class="s2">"## ["</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$script</span><span class="o">.</span><span class="nf">BaseName</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"]("</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$scriptNamePrefix</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$script</span><span class="o">.</span><span class="nf">BaseName</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">")"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$DocumentationIndexPath</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
            
            </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">synopsis</span><span class="p">){</span><span class="w">
                </span><span class="nv">$help</span><span class="o">.</span><span class="nf">synopsis</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$DocumentationIndexPath</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
            </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="s2">"No Synopsis</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$DocumentationIndexPath</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
            </span><span class="p">}</span><span class="w">

            </span><span class="c"># Add the script base name to the script specific document</span><span class="w">
            </span><span class="s2">"# "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$script</span><span class="o">.</span><span class="nf">BaseName</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w">

            </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">SYNOPSIS</span><span class="p">){</span><span class="w">
                </span><span class="s2">"## Synopsis"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                </span><span class="nv">$help</span><span class="o">.</span><span class="nf">SYNOPSIS</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">" </span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
            </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="n">Write-Warning</span><span class="w"> </span><span class="nt">-Message</span><span class="w"> </span><span class="s2">"Synopsis not defined in file </span><span class="si">$(</span><span class="nv">$script</span><span class="o">.</span><span class="nf">fullname</span><span class="si">)</span><span class="s2">"</span><span class="w">
            </span><span class="p">}</span><span class="w">
            
            </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">Syntax</span><span class="p">){</span><span class="w">
                </span><span class="s2">"## Syntax"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                </span><span class="s2">"</span><span class="se">``````</span><span class="s2">PowerShell</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">Syntax</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-String</span><span class="p">)</span><span class="o">.</span><span class="nf">trim</span><span class="p">()</span><span class="o">.</span><span class="nf">Replace</span><span class="p">(</span><span class="nv">$SourceScriptFolder</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"</span><span class="se">`r`n``````</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
            </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="n">Write-Warning</span><span class="w"> </span><span class="nt">-Message</span><span class="w"> </span><span class="s2">"Syntax not defined in file </span><span class="si">$(</span><span class="nv">$script</span><span class="o">.</span><span class="nf">fullname</span><span class="si">)</span><span class="s2">"</span><span class="w">
            </span><span class="p">}</span><span class="w">
            
            </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">DESCRIPTION</span><span class="p">){</span><span class="w">
                </span><span class="s2">"## Description"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                </span><span class="nv">$help</span><span class="o">.</span><span class="nf">DESCRIPTION</span><span class="o">.</span><span class="nf">Text</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
            </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="n">Write-Warning</span><span class="w"> </span><span class="nt">-Message</span><span class="w"> </span><span class="s2">"Description not defined in file </span><span class="si">$(</span><span class="nv">$script</span><span class="o">.</span><span class="nf">fullname</span><span class="si">)</span><span class="s2">"</span><span class="w">
            </span><span class="p">}</span><span class="w">

            
            </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">PARAMETERs</span><span class="p">){</span><span class="w">
                </span><span class="s2">"## Parameters"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                </span><span class="kr">foreach</span><span class="w"> </span><span class="p">(</span><span class="nv">$item</span><span class="w"> </span><span class="kr">in</span><span class="w"> </span><span class="nv">$help</span><span class="o">.</span><span class="nf">PARAMETERs</span><span class="o">.</span><span class="nf">PARAMETER</span><span class="p">){</span><span class="w">
                    </span><span class="s2">"### "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$item</span><span class="o">.</span><span class="nf">name</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                    </span><span class="s2">"- **Type**: "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$item</span><span class="o">.</span><span class="nf">Type</span><span class="o">.</span><span class="nf">Name</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                    </span><span class="kr">foreach</span><span class="w"> </span><span class="p">(</span><span class="nv">$arrParameterProperty</span><span class="w"> </span><span class="kr">in</span><span class="w"> </span><span class="nv">$arrParameterProperties</span><span class="p">){</span><span class="w">
                        </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$item</span><span class="o">.</span><span class="nv">$arrParameterProperty</span><span class="p">){</span><span class="w">
                            </span><span class="s2">"- **</span><span class="nv">$arrParameterProperty</span><span class="s2">**: "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$item</span><span class="o">.</span><span class="nv">$arrParameterProperty</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                        </span><span class="p">}</span><span class="w">
                    </span><span class="p">}</span><span class="w">
                </span><span class="p">}</span><span class="w">
            </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="n">Write-Warning</span><span class="w"> </span><span class="nt">-Message</span><span class="w"> </span><span class="s2">"Parameters not defined in file </span><span class="si">$(</span><span class="nv">$script</span><span class="o">.</span><span class="nf">fullname</span><span class="si">)</span><span class="s2">"</span><span class="w">
            </span><span class="p">}</span><span class="w">

            </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$help</span><span class="o">.</span><span class="nf">EXAMPLEs</span><span class="p">){</span><span class="w">
                </span><span class="s2">"## Examples </span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                </span><span class="kr">foreach</span><span class="w"> </span><span class="p">(</span><span class="nv">$item</span><span class="w"> </span><span class="kr">in</span><span class="w"> </span><span class="nv">$help</span><span class="o">.</span><span class="nf">EXAMPLEs</span><span class="o">.</span><span class="nf">EXAMPLE</span><span class="p">){</span><span class="w">
                    </span><span class="s2">"</span><span class="se">`r`n</span><span class="s2">### "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$item</span><span class="o">.</span><span class="nf">title</span><span class="o">.</span><span class="nf">Replace</span><span class="p">(</span><span class="s2">"--------------------------"</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span><span class="o">.</span><span class="nf">Replace</span><span class="p">(</span><span class="s2">"EXAMPLE"</span><span class="p">,</span><span class="s2">"Example"</span><span class="p">)</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                    </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$item</span><span class="o">.</span><span class="nf">Code</span><span class="p">){</span><span class="w">
                        </span><span class="s2">"</span><span class="se">``````</span><span class="s2">PowerShell</span><span class="se">`r`n</span><span class="s2">"</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nv">$item</span><span class="o">.</span><span class="nf">Code</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"</span><span class="se">`r`n``````</span><span class="s2">"</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                    </span><span class="p">}</span><span class="w">
                    </span><span class="kr">if</span><span class="w"> </span><span class="p">(</span><span class="nv">$item</span><span class="o">.</span><span class="nf">Remarks</span><span class="p">){</span><span class="w">
                        </span><span class="nv">$item</span><span class="o">.</span><span class="nf">Remarks</span><span class="w"> </span><span class="o">|</span><span class="w"> </span><span class="n">Out-File</span><span class="w"> </span><span class="nt">-FilePath</span><span class="w"> </span><span class="nv">$outputFile</span><span class="w"> </span><span class="nt">-Append</span><span class="w">
                    </span><span class="p">}</span><span class="w">
                </span><span class="p">}</span><span class="w">
            </span><span class="p">}</span><span class="w"> </span><span class="kr">else</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="n">Write-Warning</span><span class="w"> </span><span class="nt">-Message</span><span class="w"> </span><span class="s2">"Examples not defined in file </span><span class="si">$(</span><span class="nv">$script</span><span class="o">.</span><span class="nf">fullname</span><span class="si">)</span><span class="s2">"</span><span class="w">
            </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
    </span><span class="p">}</span><span class="w">
    </span><span class="n">Write-Progress</span><span class="w"> </span><span class="nt">-Activity</span><span class="w"> </span><span class="s2">"Documenting scripts"</span><span class="w"> </span><span class="nt">-Completed</span><span class="w">
</span><span class="p">}</span><span class="w">

</span><span class="n">GenerateScriptDocumentationInMarkdown</span><span class="w"> </span><span class="nt">-SourceScriptFolder</span><span class="w"> </span><span class="s2">"C:\Git\Lab\evp-vm-build\scripts"</span><span class="w">  </span><span class="nt">-DocumentationOutputFolder</span><span class="w"> </span><span class="s2">"C:\Git\Lab\evp-vm-build.wiki\"</span><span class="w"> </span><span class="nt">-DocumentationIndexPath</span><span class="w"> </span><span class="s2">"C:\Git\Lab\evp-vm-build.wiki\scripts_Ps1.markdown"</span><span class="w">
</span></code></pre></div></div>

<p>Not sure how useful this will be to other people, as it’s a pretty specific set of circumstances. I’m also not 100% satisfied with it, as the help object returned by Get-Help is a bit of a chimera of object types, which has made the code a bit ugly.</p>]]></content><author><name></name></author><category term="powershell" /><summary type="html"><![CDATA[I don’t mind writing documentation for my scripts, but I find that most documentation writing exercises tends to suffers from two problems:- Duplicated effort - I tend to document my script inline, (so that Get-Help will work), why do I need to document the same details elsewhere? Keeping it up-to-date - The only thing worse than no documentation, is clearly outdated documentation.]]></summary></entry><entry><title type="html">Using an Ubuntu CrashPlan appliance to backup a NAS</title><link href="https://ben.neise.co.uk/2014/07/24/using-an-ubuntu-crashplan-appliance-to-backup-a-nas.html" rel="alternate" type="text/html" title="Using an Ubuntu CrashPlan appliance to backup a NAS" /><published>2014-07-24T09:59:37+01:00</published><updated>2014-07-24T09:59:37+01:00</updated><id>https://ben.neise.co.uk/2014/07/24/using-an-ubuntu-crashplan-appliance-to-backup-a-nas</id><content type="html" xml:base="https://ben.neise.co.uk/2014/07/24/using-an-ubuntu-crashplan-appliance-to-backup-a-nas.html"><![CDATA[<p>I’ve recently upgraded some of my home setup; instead of <a href="http://windows.microsoft.com/en-gb/windows/windows-home-server">Windows Home Server 2011</a> managing everything, I’m now using a <a href="http://www.netgear.co.uk/home/products/connected-storage/RN10400.aspx#tab-techspecs">NetGear ReadyNAS 104</a>, to serve files and using Windows Server 2012 R2 for the other functions.</p>

<!--more-->

<p>Moving my files to the Network Attached Storage (NAS) fixed some of my issues (NFS performs better for serving media to XMBC), but it left me with a small problem: I previously used <a href="http://www.code42.com/crashplan/">CrashPlan </a>for backing up files from the Windows Home Server’s local disks. However, (on Windows), CrashPlan <a href="http://support.code42.com/CrashPlan/Latest/Backup/Mounting_Networked_Storage_Or_NAS_Devices_For_Backup">doesn’t support backing up NAS</a>. While there are a <a href="https://helpdesk.crashplan.com/entries/24338-Ability-to-backup-network-shares-Network-Attached-Storage-">couple of workarounds</a>, they are a little … inelegant.</p>

<p>I decided that the best solution would be to use an Ubuntu agent, running as a Hyper-V machine on the server to back-up the NAS. This headless appliance could be managed by the CrashPlan client running on a separate machine. The bulk of the work was already detailed in Bryan Ross’s articles <a href="http://www.liquidstate.net/how-to-manage-your-crashplan-server-remotely/">Installing CrashPlan on a headless Linux Server</a> and <a href="http://www.liquidstate.net/blog/technology/how-to-manage-your-crashplan-server-remotely/">How to Manage Your CrashPlan Server Remotely</a>, but I thought it’d be worth adding some specifics</p>

<ol>
  <li>Download <a href="http://www.ubuntu.com/download/server">Ubuntu server</a> and install on your platform of choice. I used Hyper-V and pretty much accepted all the defaults.</li>
  <li>Once the Ubuntu installation process has completed, log in and install NFS services sudo apt-get install nfs-common</li>
  <li>Install CrashPlan as per Bryan’s instructions <a href="http://www.liquidstate.net/blog/technology/installing-crashplan-on-a-headless-linux-server/">here</a>.</li>
  <li>On your Linux server, open CrashPlan’s configuration file with <code class="language-plaintext highlighter-rouge">sudo nano -w /usr/local/crashplan/conf/my.service.xml</code></li>
  <li>Search for the <strong>serviceHost</strong> parameter and change it from <code class="language-plaintext highlighter-rouge">127.0.0.1</code> to <code class="language-plaintext highlighter-rouge">0.0.0.0</code>. This allows CrashPlan to accept commands from machines other than the local host.</li>
  <li>Save the file and then restart the CrashPlan daemon with <code class="language-plaintext highlighter-rouge">sudo /etc/init.d/crashplan restart</code></li>
  <li>Install the CrashPlan client on the machine you’re going to use to manage it.</li>
  <li>Open the client configuration file. On Windows, the default location would be <code class="language-plaintext highlighter-rouge">C:\Program Files\CrashPlan\conf\ui.properties</code>. Look for the following line: <code class="language-plaintext highlighter-rouge">#serviceHost=127.0.0.1</code></li>
  <li>Remove the comment character (#) and change the IP address to that of your of your Ubuntu server. For example: <code class="language-plaintext highlighter-rouge">serviceHost=192.168.1.29</code></li>
  <li>On the server, create the folders where you’re going to mount the NFS shares and manually mount them to make sure they work. You’ll need to know the IP address to that of your NAS, and the path to the share(s). mkdir -p /mnt/nfs/videos sudo mount 192.168.0.13:/data/Videos /mnt/nfs/videos mkdir -p /mnt/nfs/pictures sudo mount 192.168.0.13:/data/Pictures /mnt/nfs/pictures mkdir -p /mnt/nfs/software sudo mount 192.168.0.13:/data/Software /mnt/nfs/software mkdir -p /mnt/nfs/ebooks sudo mount 192.168.0.13:/data/eBooks /mnt/nfs/ebooks</li>
  <li>Now we need to make sure that when the server is restarted, it will automatically re-mount these shares. Edit <strong>fstab</strong> with the following command:- <code class="language-plaintext highlighter-rouge">sudo nano -w /etc/fstab</code></li>
  <li>Add a line for each share you wish to mount, like this</li>
</ol>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>192.168.0.13:/data/Videos /mnt/nfs/videos nfs auto 0 0
192.168.0.13:/data/Pictures /mnt/nfs/pictures nfs auto 0 0
192.168.0.13:/data/Software /mnt/nfs/software nfs auto 0 0
192.168.0.13:/data/eBooks /mnt/nfs/ebooks nfs auto 0 0
</code></pre></div></div>
<ol>
  <li>Reboot the server and ensure that the NFS shares map correctly (you can see existing mounts by running the command <strong>mount</strong>)</li>
  <li>Now, on the client machine, open the CrashPlan GUI, and select the mount points which you wish to be backed-up.</li>
</ol>

<p>This is now working well  - although the change in method means that I need to send all of my data up to CrashPlan again, I was hoping that it’d be able to map the previously uploaded files to the same files on their new paths.</p>]]></content><author><name></name></author><category term="home" /><summary type="html"><![CDATA[I’ve recently upgraded some of my home setup; instead of Windows Home Server 2011 managing everything, I’m now using a NetGear ReadyNAS 104, to serve files and using Windows Server 2012 R2 for the other functions.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ben.neise.co.uk/content/images/2016/01/download.png" /><media:content medium="image" url="https://ben.neise.co.uk/content/images/2016/01/download.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>