Category: Powershell

Automate VMware VM Deployment – Template creation with Packer

Automation is something that I have tried to incorporate as much as possible within my solutions.  The benefits are obvious and often the work behind it is the most interesting, even if it ends up being just a few lines of PowerShell.  Infrastructure as Code is one of the areas I have had on my to-do list for a while and I have finally started dipping my toe into it this year. I’ve discussed previously how I like to handle deploying appliances and VMs using PowerCLI and an existing VM template but I want to take that a stage further...

0

Windows 2008 End of Support – VM report

So hopefully everyone has already long dealt with the upcoming end of support date for Windows 2008 as detailed by MS here right? Paying for extended support might be an option at this late stage but good to know exactly what you are dealing with. I have used the following powercli code to query all vCenters for a report on 2008/2008r2 VMs to identify any stragglers or virtual servers that app owners have been too busy to update or mitigate. Change the variables to suit your environment and comment out the filter (highlighted lines below) if you want to use...

0

Documentation – vSphere Clusters

I have put this function together for the purpose of documenting cluster settings.  Used it a fair bit to gather information on environments that I have come accross that have not been well documented.  In can be used as is but I’m fiddling around with it to produce some further information so likely to be updated in the near future. Hopefully of some use – connect to vCenter from POWERCLI and run the function. get-clusterdetails  

0

Documentation – ESXi Host vMotion IPs

I’ve recently had to audit and document several vSphere environments.  Multiple hosts had been configured manually and there were some mistakes in the IP settings.  I put together this POWERCLI function to report back on these settings and will now use it for documentation moving forward.  Hopefully of some use to others too. Connect to a host or vCenter and give it a go.  

0

Documentation – ESXi Host Hardware and Build Details

I don’t know many people that enjoy writing documentation but it is a nessesary evil and can give you the opportunity to be creative with how you produce it. Often I will need to document a point in time install for ESXi hosts so have put together the below PowerCLI function to obtain some hardware and build information back.  Running Get-HostDetails after connecting to a host or vCenter There are loads of good examples available but this works well for me. Output as below

0

Deploy VMs using Templates, customisation specs and POWERCLI

Who doesn’t love a bit of automation these days, I certainly like to use code snippets and shortcuts whenever I can.  Recently I’ve been deploying some VMs in my homelab and thought I would share some of the POWERCLI I use. I have a Windows 2016 template stored in vCenter that I have recently patched and tweaked to my satisfaction and deploy that with a temporary customization spec to deploy and do the initial config (IP settings and domain join). The key commands to use here to get the IP settings are Get-OScustomizationNicMapping Set-OSCustomizationNicMapping Only started playing with these recently...

1