As part of a larger project I've been working on a set of scripts which configure a freshly-installed ESX (or ESXi) system into Virtual Center (after first attempting to remove previous VC state and clean state from the host). Currently they follow a typical post-boot configuration pattern:
- Set ESX password
- Add to Virtual Center cluster
- Configure Virtual Switches
- Configure Port Groups
- Add NFS partitions
- Add iSCSI partitions
- Configure NTP
- Configure VMotion
Before trying, modify esx-master.ps1 and esx-profile.ps1 to local conditions (or your password will be set to "CHANGEME").
Command: esx-autoconfigure.ps1 "hostname|ip-address"
As this is my initial foray into PowerShell, please excuse any idiosyncracies.
This is a work-in-progress - feedback welcome. Points awarded for the best suggestions in the next few days.
lance
(See boot/config doc).
My comments are as follows:
1.http://www.vmware.com/landing_pages/toolkit_contest.html
2. Cool,
I've been working on something similar for a project at work (not to mention for my book).
3. I'm a judge for #1, so I'll refrain from commenting directly on your code in case you decide to submit it, which I suggest you do.
Author of the upcoming book:
Managing VMware Infrastructure with PowerShell
Co-Host, PowerScripting Podcast (http://powerscripting.net
)
Some suggestions:
- configure or check DNS and gateways before steps 3/4/7/8. Critical for clustering, HA and DRS!
- configure the firewall
- (eventually) configure some advanced ESX settings. See for example a recent discussion about NFS.MaxVolumes
- check (and eventually configure) licensing before using clustering with HA/DRS/vMotion
- configure (or adjust) resource pool(s). Adding an ESX server will increase the available resources.
Very nice, you should definately enter the comp.
Alan Renouf
VMware, Citrix, Microsoft Consultant
UK
My Blog
iberc,
I'm doing a large roll-out of esxi. I have been working on the exact same as what you're doing. If I can add anything across what you got i may post it.
You're scripts look to be more portable. This is my first dive into significant scripting not to mention powershell. The envronment i'm building for is very homogenous so the work reflects it. this is definately work in progress. these files on their own need to be edited etc and linked.
I've been looking for awhile now for configuration of ESXi via powershell and it seems very limited. Most resources are directed at management of existing.
Message was edited by: olan025
Lance works for VMware, no $5000 for him, for us 3rd prize is we're fired
My cover has been blown. - l
Looks great!
Lance, do you know Aiden Dalgleish? He's a PSO Consultant from the UK and already created a hell of a lot scripts for installing. Talk to him, he's got some cool stuff!
Duncan
My virtualisation blog:
http://www.yellow-bricks.com
If you find this information useful, please award points for "correct" or "helpful".
Hal,
How about making an exception to allow me a sneak peak at your new book? My scripting needs to be tuned up as you can tell i'm a beginner if you looked at my earlier attachments.
I'm making changes and updates to those, if anyone does care for them post it. otherwise my stuff is pretty basic compared to Lance's functionalized code.
This document was generated from the following thread: How To: Configure freshly booted ESX with PowerShell