Skip to content
iland Cloud Official Site
iland Cloud Official Siteiland Cloud Official Site
  • Why iland
    • Submenu
      • Column 1
        • iland secure cloud console
          Secure Cloud Console
          iland compliance
          Compliance
          iland proven technology
          Cloud Platform
          iland pricing
          Pricing

      • Column 2
        • iland Security
          Security
          iland global regions
          Cloud Regions
          iland networking
          Cloud Connectivity
          iland interactive tour
          Interactive Tour

      • WHY CHOOSE iland
      • OverviewYour business is unique, your cloud should be too.
      • About ilandThe making of a market leader.
      • LeadershipMeet our experienced & knowledgeable executive team.
      • News & MediaFind out what’s new and happening at iland.
      •  
      • CareersYour future starts here. Join the #ilandlife today.
      • Technology PartnersGreat partnerships are built on great technologies.
      • Customer StoriesDiscover why customers are choosing iland Cloud.
      • BlogTips, tricks, opinions, and news from iland experts.
  • Products & Services
    • Products & Services
      • PRODUCTION HOSTING
      • Secure Cloud Overview
      • Secure Public CloudRun VMware natively. No refactoring required.
      • Secure Private CloudDedicated cloud for performance and security.
      • Object StorageS3-compatible storage for long-term retention.
      • BACKUP
      • Secure Backup Overview
      • Secure BackupSecure cloud backup for no-compromise data protection
      • Microsoft 365Complete data protection for Microsoft 365
      • DISASTER RECOVERY
      • DRaaS Overview
      • DRaaS with VeeamSimplified Disaster Recovery for your unique business
      • DRaaS with ZertoContinuous availability for 24×7 IT resilience
      • AutopilotFully-managed disaster recovery as a service.
      • DRaaS for Physical ServersReplicate physical servers to iland.
      • MANAGED SECURITY
      • Managed Security Overview
      • Continuous Risk ScanningDiscover and monitor vulnerabilities
      • Managed SIEMManaged security information and event management
      • Managed EDRManaged endpoint detection and response
      • Managed FirewallSimplify and improve network edge security
      • SUPPORTING SERVICES
      • Cloud Labs
      • Cloud Connectivity
      • Colocation/Bare-Metal
      • Managed Services
      • Migration Services
      • 24x7x365 Support
      • Strategy, Assessment & Planning
  • Solutions
    • Solutions Submenu
      • INDUSTRY
      • Education
      • Financial
      • Government
      • Healthcare
      • Column 2
        • iland Health Solutions

          Keep IT healthy.

          See our healthcare expertise.

          What's next in finance?

          Transform & modernize your IT.
          Learn More
          Learn More
  • Partners
    • Partners Submenu
      • Overview
      • Become a Partner
      • Login to Portal
  • Resources
    • Resources Submenu
      • Events
      • Webinars
      • News & Media
      • Whitepapers
      • Podcast
      • Datasheets
      • Customer Stories
      • Innovation Blog
  • Support
    • Support Submenu
      • Contact Support
      • Success Center
      • API Documentation
Search:
  • Console Login
  • Contact Us
Header Right Menu
Free Trial
  • Why iland
    • Secure Cloud Console
    • Compliance
    • Cloud Platform
    • Pricing Model
    • Security
    • Cloud Regions
    • Cloud Connectivity
    • Interactive Tour
    • WHY CHOOSE iland
    • OverviewYour business is unique, your cloud should be too.
    • About ilandThe making of a market leader.
    • LeadershipMeet our experienced & knowledgeable executive team.
    • News & MediaFind out what’s new and happening at iland.
    •  
    • CareersYour future starts here. Join the #ilandlife today.
    • Technology PartnersGreat partnerships are built on great technologies.
    • Customer StoriesDiscover why customers are choosing iland Cloud.
    • BlogTips, tricks, opinions, and news from iland experts.
  • Products & Services
    • PRODUCTION HOSTING
    • Secure Cloud Overview
    • Secure Public CloudRun VMware natively. No refactoring required.
    • Secure Private CloudDedicated cloud for performance and security.
    • Object StorageS3-compatible storage for long-term retention.
    • BACKUP
    • Secure Backup Overview
    • Secure BackupSecure cloud backup for no-compromise data protection
    • Microsoft 365Complete data protection for Microsoft 365
    • DISASTER RECOVERY
    • DRaaS Overview
    • DRaaS with VeeamSimplified Disaster Recovery for your unique business
    • DRaaS with ZertoContinuous availability for 24×7 IT resilience
    • AutopilotFully-managed disaster recovery as a service.
    • DRaaS for Physical ServersReplicate physical servers to iland.
    • MANAGED SECURITY
    • Managed Security Overview
    • Continuous Risk ScanningDiscover and monitor vulnerabilities
    • Managed SIEMManaged security information and event management
    • Managed EDRManaged endpoint detection and response
    • Managed FirewallSimplify and improve network edge security
    • SUPPORTING SERVICES
    • Cloud Labs
    • Cloud Connectivity
    • Colocation/Bare-Metal
    • Managed Services
    • Migration Services
    • 24x7x365 Support
    • Strategy, Assessment & Planning
  • Solutions
    • INDUSTRY
    • Education
    • Financial
    • Government
    • Healthcare
    • Column 2
  • Partners
    • Overview
    • Become a Partner
    • Login to Portal
  • Resources
    • Events
    • Webinars
    • News & Media
    • Whitepapers
    • Podcast
    • Datasheets
    • Customer Stories
    • Innovation Blog
  • Support
    • Contact Support
    • Success Center
    • API Documentation
  • Contact Us
  • Console Login
  • Free Trial
Tags: Cloud Services
Author: iland
Date: September 28, 2016

Automating the iland cloud using Microsoft Powershell and PowerCLI – Part One

GearsWe often get questions from customers about the best way to automate their cloud environments. As iland provides Infrastructure-as-a-Service based on VMware vCloud Director, we expose a RESTful API that can be used to automate things at the vCD level.

We also offer a higher level REST API for the iland cloud console which exposes other services that iland has curated into the console, such as vSphere performance data, security and compliance data, disaster recovery services with Zerto, etc.

More information on the iland REST API is available here.

As well as RESTful APIs, another set of tools which leverage these APIs has proved extremely popular over the past few years.

Microsoft Powershell, and the extensions provided by VMware as PowerCLI, provide an excellent environment to automate a VMware-based cloud infrastructure such as that provided by the iland Secure Cloud platform.

Anyone who has done any development during their careers should be able to understand the syntax of PowerCLI for simple scripting or full-blown applications.

Microsoft provide an excellent integrated scripting environment (ISE) that enables a PowerCLI developer to easily discover commands, known as cmdlets, and interrogate the data that is returned from these. The IntelliSense capability helps to automatically complete commands and object names.

I don’t propose to go into great detail about how to get PowerCLI running, but suffice to say it can be downloaded from Microsoft and VMware websites. In recent news, Powershell, which traditionally only ran on Windows operating systems due to its dependence on .NET, has just been ported to both Linux and Apple Mac. PowerCLI cmdlets for Linux and Mac should be available soon. In the meantime, I use PowerCLI running on Windows 10 on my Mac inside VMware Fusion.

Powershell ISE can be made to automatically load all the PowerCLI cmdlets using the profile feature, whereby you can specify all the PowerCLI. There are several additional PowerShell functions that have been written by ecosystem members that can be included in this way, and can be downloaded from various forums and blogs on the Internet.

Pic2

PowerCLI can be used for a variety of automation tasks. Generally speaking, there are a small number of main functions:

  • GET – retrieve information about stuff
  • SET – change attributes
  • NEW – create new things (but also ADD)
  • REMOVE – to delete things
  • START/STOP/SUSPEND for virtual machine operations
  • CONNECT/DISCONNECT to login/out of a vCloud environment

The full set of PowerCLI cmdlets can be found at: http://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FOverview.html

Simple GET cmdlets
A good starting point is querying the vCloud environment using GET commands. As the name suggests, this gets information without changing anything, so is safe for beginners!

Before we can do anything, we’ll need to connect to the vCloud environment, using the same URL as indicated by the iland cloud console interface when you choose to interact with vCloud Director.
The PowerCLI cmdlet Connect-CIserver is used with –server, -user, -password and –org to specify those details.

Pic3-1
Having successfully connected, you can start running GET commands. Many of the vCloud cmdlets have ‘CI’ in front (cloud infrastructure), to differentiate them from vSphere/vCenter cmdlets. So, Get-CIVM instead of Get-VM.

In the example below, Get-OrgVdc is used to get information about our two Org Virtual Data Centres, both of which are Pay As You Go.

Then, Get-CIVapp is used to list all the vApps that are currently deployed. Finally, listing all the VMs using Get-CIVM.

Pic4

You can use the format table command (ft) to format the output neatly, and specify the column headings you’d like to see.

Pic 5

Rather than using individual cmdlets on the command line, you can start to produce scripts that perform a similar function to the above.

In the example below, $vApps is an array that contains all the vApps and their configuration data, while $VMs is an array for all the VMs that are discovered. $vApp and $VM are then objects which contain individual data.

Pic 6

The IntelliSense feature within Powershell ISE allows you to see what information is stored within an object.

Pic 7
When the script is executed, the following output is produced.  Rather than writing to the screen, it could be exported to an Excel or CSV file.

Pic 8

Automating the deployment of vApps
PowerCLI can be used to deploy new vApps from existing vApp templates within the vCloud catalog. This could be either from your own catalog or from the Public catalog offered by iland. The cmdlet get-civapptemplate will show you all the vApp templates available.

Pic 9

In this example we want to deploy the Travel App vApp template from my Test catalog, and call the new vApp ‘Travel App 1’.

Pic 10

This short script deploys the new vApp in a matter of minutes. By default, the vApp will be powered off.

Pic 11

We may want to make some changes to the VMs within the vApp once deployed. For example, I may want to give the ‘MySQL server’ 4GB of RAM – it currently has only 750MB.

Unfortunately, there isn’t a nice, easy Set-CIVM cmdlet, so we need to do some jiggery-pokery using extension data. Fortunately, a quick trundle round the Internet found the commands to use.

Pic 13

And, we can see that the RAM value has been increased on the ‘MySQL server’ VM.

Pic 13

Finally, the vApp can be started up.

Pic 14

Hopefully, this short article has been useful to whet the appetite for Powershell and PowerCLI.

Watch this space for more articles on this exciting topic!

For further reading, I can recommend my old VMware friend and colleague, Alan Renouf and his blog site at http://www.virtu-al.net/ – what he doesn’t know about PowerCLI isn’t worth knowing!

Categories: IaaS, VMwareBy ilandSeptember 28, 2016
Tags: Cloud Services

Author: iland

iland has been helping customers transform their mission critical applications to the Secure Cloud for hosting, protection, and recovery for over two decades. During that time, we have learned a great deal about exceeding customer expectations from every aspect of the cloud journey.

Post navigation

PreviousPrevious post:Infographic – The State of IT Disaster Recovery in the UKNextNext post:Recovery Times – Key to any DR Plan

Related Posts

What Our Customers Have to Say About 2022’s Most Pressing Cloud Challenges
June 10, 2022
Have you thought about IaaS? iland Secure Cloud is the one for you.
November 5, 2020
Why do you need a global footprint for your cloud?
October 26, 2020
Accelerate IT Initiatives with cloud-based infrastructure from iland
August 6, 2020
Award Season: This Just In
June 29, 2020
Avoid Common Cloud Migration Challenges
June 15, 2020
iland, an 11:11 Systems Company
PRODUCTS & SERVICES
  • Secure Cloud
  • Backup
  • Disaster Recovery
  • Managed Security
  • Cloud Connectivity
  • 24x7x365 Support
  • Compliance
  • Free Trials
COMPANY
  • Why iland
  • Cloud Platform
  • Customer Stories
  • Careers
  • Leadership
  • Technology Partners
  • News & Media
  • Contact Support
CLOUD LOCATIONS
  • Dallas, TX
  • Los Angeles, CA
  • Northern Virginia
  • Toronto, Canada
  • London, UK
  • Manchester, UK
  • Amsterdam, NL
  • Singapore
  • Melbourne, AU
  • Sydney, AU
CONNECT
  • LinkedIn
  • Twitter
  • Facebook
  • Youtube

© 2022 iland™ All Rights Reserved | Privacy Notice

Go to Top