Computer Programming

Insurance customer: Datacenter Exit

towers4

All technical resources working within the migration space should be touching up on their Powershell skills. By adding Powershell to your arsenal it allows the user to greatly expedite a vast quantity of technical tasks ranging all the way from discovery to remediation.

 

What is Powershell?

Windows Powershell is a powerful tool for system engineers to automate and simplify tasks within the windows framework. Almost any windows task can be automated via Powershell and by extension of PowerCLI it brings the same functionality to automate and simplify within vSphere.

SO what is PowerCLI? Vmware created PowerCLI on Windows Powershell to bring the same functionality that windows engineers enjoy to VMware users. PowerCLI Provides over 700 cmdlets that allow engineers to automate, simplify and configure tasks.

PowerCLI can simply be added to your toolbox by downloading and installing the VMware PowerCLI module from a PowerShell session.

SO what areas can Powershell assist with when working on a migration project?

pexels-thisisengineering-3861959.jpg

  • Discovery: Powershell (Powercli) allows a user to access to a number of systems and collate data; the main system we will talk about during this series of blog posts is vCenter.

  • Analysis: Like above; by being able to pull extensive data from a multitude of sources and collate it together the user can then manipulate the data to filter and identify specific sets and subsets of data.

  • Pre-migration checks: Nearly all the pre event checks (from a technical / infrastructure POV) can be performed via Powershell. Once a script has been put together this step can now be completed by running a single line of code. This can then return the results to the user in a choice of format to show failure and success that occur during the checks.

  • Migration execution: There are different ways at looking at this step. In some cases (V2V) the whole migration can be handled by Powershell on its own by utilising the Move-VM command. This can in the ideal environment allow for 0 downtime VMware to Vmware migrations. Then there are the big migration tools which most have Powershell modules available which allows the user to add further elements of automation; this can be to reduce the amount of manpower required to run the process or adding pre & post steps to the process. This means in some cases that the start to finish process (including validation checks) can be accomplished with the click of a single button.

  • Validation Checks and configurations: You can perform all VM health checks via Powershell by connecting to the vCenters and running either individual commands or a pre-built script. A few examples of checks that can be done:

  • Check the network adapter settings (mac, adapter type, target network)
  • VM tools status and version
  • VM hardware settings
  • VM in correct cluster, datastore, network, folder, vCenter
  • VM hard disks have all been provisioned correctly (thin/thick)
  • Check VM IP is registered correctly in DNS

Where should you start?

pexels-polina-zimmerman-3747120.jpg

There are many available resources online to start your journey on mastering Powershell but I can't recommend enough the book 'Learn Powershell in a month of lunches' which with just dedicating an hour a day for a month should leave you completely capable of creating your own automated capabilities.

Once you have the basics nailed there's no better way to progress than diving in the deep end and starting to automate and script your own repetitive tasks. Start with small individual processes and slowly scale up to encompass much wider scale change tasks.

What next?

Over the next few weeks I will be expanding on the ways that Powershell & PowerCLI can be used to assist with your migration events and will dive into what particular commands should utilised and how you can use these to create your own scripts.

The next blog entry will discuss how we can perform health checks from the command line.

Author Daniel

Comments (1)

Leave a Reply

Your email address will not be published.