It ‘s already many years since my last blog article. What happened? Too busy with work, family, VMUGBE, so in short : too busy to contribute. But I decided to share something after some mails back and forth with our famous LucD . I ‘m currently writing a tool (in PowerShell/PowerCLI) to solve a problem we have for a few years. In the past we used a tool from our storage provider for VDI to clone our windows 7 VMs. This is no longer available. Alternatives would cost a lot more and as my budget was limited, I was forced to be as creative as I can get.
I found out that William Lam wrote a module . You can find more on this https://www.virtuallyghetto.com/2018/04/new-instant-clone-architecture-in-vsphere-6-7-part-1.html
This started me thinking: Can I use this to deliver 1000 windows 10 desktops ? So I started experimenting. It was a long way with many hurdles but today I have something that works. Still not production yet , but in my test environment there are currently running 50 VMs that were created with my tool.
How does it work ?
- Select datacenter A or P
- This triggers :
- get all datastores of selected datacenter
- get all VLANs of selected datacenter
- get all Templates of selected datacenter and all VMs with name like tmpl
- Get all customization profiles
- ShowName Range based on basename, datacenter, amount of VMs
- 2. Change Template
- info: show detailed info about template (Powerstate,Guest,CPU,Mem,Host, Location,Datastore,..)
- Amount : amount of VMs to deploy
- 3. VLAN: all VLANs in that datacenter
- info : show free IPs per VLAN
- 4. Customization profiles
- 5. Datastore: Datastores available for that datacenter. When Selecting other than template: show warning
- Free: Datastore report with amount of free space
- 6. Choose from which the numbering should start
7. Dry Run: check the naming of VMs and remove them from queu when VM already exists
8. Clone and Customize :
- start cloning with Instant-Clone Module from William Lam
- after cloning :
- shutdown VM
- Set value a custom field ‘Customization’ to Yes
- connect and set selected VLAN
- set Customization per VM (to trigger Sysprep after boot)
- Move-VM to specified folder to keep it all clean
- Customize : when all VMs are cloned: set customization on all VMS, power on and wait
- Set value of custom field ‘Customization’ to Done
This blog was mainly to inspire everyone. If you like it , let me know and I can write another blog with more details.