Posts

Getting started with VMWare PowerCLI

Image
Hi all! Welcome to my blog. In this post I wanted to show newcomers to VMWare, on how to get started with automating vSphere. I will go through installing the PowerShell module and logging into a vSphere server to start sending commands! You should ideally have a Windows 10 workstation with PowerShell version 5 or above. You can check your PowerShell version by typing $PSversiontable. We need to enable the workstation to allow scripts to run. Run the "Set-ExecutionPolicy -ExecutionPolicy Unrestricted" command. You need to use good judgment about running scripts, never run a script that you dont understand or know where it came from. The next step for us to do is check to see if we can reach the internet using PowerShell. Try running the command "Find-Module -Name VMWare.PowerCLI" (without the quotes). You should receive the output similar to the screenshot below. The "Find-Module" commandlet will attempt to get information about a

Complete a migration assessment of an on-premise vSphere environment.

Image
Hey, Welcome to my blog on assessing and moving on-premises server workloads, into the Azure cloud using Azure migrate and Azure site recovery.  The process starts off by assessing the VMWare environment using Azure migrate. You download and configure an appliance that collects information about your vCenter server and it's virtual machines. This stage is important because the collector appliance provides information to Azure for which it will then generate a report. You can then use this report to assess cloud readiness, running costs and migration methods. Some migrations will work better using IaaS (Virtual machine in a vNet) and some with PaaS offerings (Azure SQL databases and App service plans). There are a few things we need to have before we begin and migration projects have two phases. The first is discovering and assessing workloads so you can plan what needs to be migrated to Azure and how you are going to do it. The second is utilising Azure Site Recovery to conf

Azure ARM Templates - Design, validate and deploy

Image
Hi! As I write this blog post England have just been knocked out of the world cup so if you happen to be French and reading this, congratulations! In this post I go through the basics of an (ARM) azure resource manager template in Visual Studio and explain the various parts that make up the template. We will then go through the validation of the template so that deployment goes through smoothly and then deploy it to a subscription in Azure. Before we get started, you may want to get Visual Studio community edition installed or if you can, the full version of VS 2017. Other options are available such as Visual Studio Code. I find VS 2017 to be the best editor which includes intellisense. When writing and editing in JSON, intellisense helps to pick out syntax to prevent you from getting stuck on what to type. It's very difficult to remember all the structure and syntax if you don't write or edit templates that often, intellisense helps a lot here. The structure

VM Tools fail to upgrade with vix error 21007

Image
The reason for the failure in my findings, is because the virtual machine hardware version is old and needs upgrading. Perform a compatibility upgrade on the VM and then try the tools again. This is the error you may get from PowerShell, the same is true using the vSphere web client: This is how you fix it in the vSphere web client:

Configure Azure Multi-factor authentication (MFA)

Image
     In today's world of cloud technology, security is a an ever growing requirement. In Microsoft Azure, you can enhance the security for your cloud platform by enabling MFA, often referred to as 2-step verification. MFA enables a secondary method of authentication for your Azure tenant, in the form a text message, phone call or mobile app code.      Many platforms on the internet use this technology, including Facebook, Google and Apple. It only makes sense to enable this for your own user base, for the purpose of enhanced network security and the protection of your data and applications in the cloud and if you wish, on-premises networks too! Even if attackers manage to guess the password for one of your users, its completely useless as without the secondary verification method, they will not get in. Image source:  https://docs.microsoft.com/en-us/azure/active-directory/authentication/concept-mfa-howitworks MFA requirements MFA requires Azure AD Premium licenses t

Deploy Multiple VMs in Azure using PowerShell

This script will enable the deployment of several virtual machines to Azure in an automated fashion. I already have certain parts of my infrastructure in Azure, such as the virtual network, resource group and a subnet. You will need to create these first before using this script. The scripts deploys a set of Windows Server 2016 data center VMs, these are the steps: Imports the AzureRM module. Prompts for a login for Azure. A function has been created that defines the parameters for the deployment called "Provision-AzureVM", a single parameter has been defined called $VMName. The script then deploys a set of VM's based on the names contained in the array "$VMs" by calling the function as mentioned above. To use the script you need to modify the variables in the function mark under # Variables. You then need to define the names of virtual machines in the VMs array. You could also add more required parameters at the beginning of the function to

Deploy Multiple VM's with PowerCLI and a vCenter Custom Spec.

This blog post assumes you have a working vCenter server with at least one host, datastore, network etc...requirements are listed below:  What is required:  Admin access to a running vCenter environment, preferably a lab! Powershell v5 and PowerCLI 6.5. A premade template, EG Windows Server 2016. A vCenter custom spec for the configuration of guest operating systems. Details of my lab are below. I am fortunate to have access to real servers where I work but a computer with enough disk space and maybe 16gb of ram will suffice. You may not be able to run as much simultaneously. My Lab: Dell PowerEdge server 128GB RAM VMware Workstation Pro 12 3 Virtual Machines located inside VMware Workstation.  2 ESXi Servers, 1 Active Directory domain controller. My vCenter server appliance (VCSA.contoso.com) is running on one of my virtual ESXi servers. The Environment: Active Directory and DNS: 10.1.1.1 DHCP provided by VMware workstation network manager. vCenter Se

VM NIC is disconnected after deploying from a Template

Today I had a problem deploying some virtual machines and applying a custom spec to them in vCenter server 6.5. It turns out the virtual machine hardware on the VM I cloned as a template, was OLD and needed updating. Check to make sure your VM Tools installation is also upto date!

Windows SIM fails to create catalog for Windows 10 image

I found an interesting blog post by a guy named Ben R.N. who solved an issue I was having whilst attempting to load a Windows 10 image to Windows SIM in order to create a new customised install.wim. His post goes as follows: "When the Windows System Image Manager fails catalog creation with 0xC1420127 or 0xC1420117 I am currently in the process of setting up an unattended installation of Windows 10. Therefore, I'm using the System Image Manager to create the Unattend.xml file, and to do that, I need a catalog file that corresponds to the WIM I'm deploying. The SIM can generate a catalog from a WIM, but in my case, it failed with codes 0xC1420127 or 0xC1420117, depending on what I tried. Eventually, I discovered that for the SIM to create a catalog, you need to satisfy three conditions: Use install.wim from the \sources folder on the original installation media. A captured WIM does not work because, evidently, it doesn't actually contain the stuff that go