Posts

Showing posts with the label Validation

Powershell to Validate IP Configuration (Address, Gateway, Subnet Mask, DNS)

I'm working on a VM deployment script for one of my customers.  As you might expect, input validation is incredibly important, as we want to filter out a malformed configuration before starting the actual deployment.  To that end, I put together a bit of PowerShell that I'm pretty proud of; this script does a basic sanity check on a network configuration . It does a fair amount of work.  Firstly, it checks to ensure that the IP Address, Gateway, Subnet Mask, and all DNS Servers are being supplied as valid IP addresses.  PowerShell makes this trivial to do, as you can cast a string as an [ipaddress] object and PowerShell will parse it for you.  If it's a string that can't be parsed (such as [ipaddress]"JasonIsAwesome!" which is a string that most people would agree is inherently incomprehensible*), it'll throw an Exception and thus end the execution of the script.  So, that most basic input validation is over in a blink... but wait, there's more! Since ...

Validating HA by Inducing a PSOD

After installing an ESXi cluster, of course you want to validate its functionality.  vMotion/DRS are easy to validate, but how about HA?  Just pull the power cable out of the back of one of your ESXi hosts, right? Well, that will do it... but it's also a bit risky.  I've seen host configurations fail to come back from an unexpected power failure and I've heard stories of hardware damage stemming from such an event.  So, a power failure is probably not the best option... so what else can you try? You could always induce a Host Isolation event .  Simply disconnect all of the network cables from the ESXi host, which will trigger the specified HA response.  That works, but it's a bit of a pain, as you're likely going to need to unplug several cables and keep track of exactly where they belong.  If you're remote, you'll need to involve the network team to get them to shut down specific ports (and you'd better hope that there's no miscommunication rega...