Home > Uncategorized, vSphere > VMware Template Deployments–Part 1: Trying to modify

VMware Template Deployments–Part 1: Trying to modify

If you are someone local to me, you probably know I’ve been doing a good amount of VMware Template VM customizations to enhance deployments.  I’m trying to find the best balance of Microsoft unattended installation settings, batch/PowerShell scripting, GPO’s and more.

One of the issues that has been plaguing me, is that while I have Template Customization Specifications, they don’t seem to be taking place.  I know for sure I had these working in the past, and just couldn’t figure out what step I missed.  After some troubleshooting, I realized it wasn’t so much what I missed – but what I had changed.  I’ve started making the VMXNET3 virtual network adapter the default in my templates instead of the Intel E1000.

There is a known issue with the VMXNET3 network adapter, where when you clone the VM, it will create a new adapter.  This is because the existing adapter gets “moved” on the virtual PCIe bus, and gets a new PCI-ID as well as the new MAC from cloning.  This, Windows sees as a new device.  Not only is it a new piece of hardware, but it also logically becomes “Local Area Connection 2” in Windows.  This is what is happening at the ‘hardware’ level for the VM.

The reason the template is not deploying properly via the template customization wizard, is this “Local Area Connection 2”.  The system IS getting the Windows name that I’ve assigned in the Customization Specifications, but the IP address is not getting assigned, the domain is not being joined, Windows is not getting activated, etc.   The fact that the name is getting changed tells me the Customization Specifications are getting applied, just not working.  But when you realize that the network is not working, it makes perfect sense that all the rest – being network dependent – are not happening.

So first, I’ll provide some links that helped me get this far, and helped me get this resolved:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1020078
Deploying Windows 2008 R2 and Windows 7 templates with vmxnet3 renames the NIC as #2

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1010398
Configuring disks to use VMware Paravirtual SCSI (PVSCSI) adapters
(Not directly relevant, but I’ve also made the PVSCSI the default, and if I’m doing this much troubleshooting, might as well get the template “Golden Master”, right?)

http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=1179
Networking Error: IP address already assigned to another adapter

So what do you want to do?

1) The VMware KB 10020078 references a Microsoft HotFix for Windows 2008 R2/7 (pre-SP1 and post-SP1).  You’re going to want to get this, and apply it.  Hopefully your Golden Master template is going to be 2008 R2 SP1 by now.  Reboot.

2) Edit the VM – while running or not, and remove the Network Adapter in the VM.  Might as well do all of them.  If you do this while running, it will hot-remove the adapter and driver.  If you do it cold and boot up, it should simply not show it, but it might still be present as a “ghost adapter”.

3) The VMware KB 1179(an odd number, to be sure – but it is what is shown) references the whole “The IP address XXX.XXX.XXX.XXX you have entered for this network adapter is already assigned to another adapter” error that you get if you try to assign the same network address to the “Local Area Connection 2”.   You’re going to want to follow the steps listed there to “set devmgr_show_nonpresent_devices=1” then open Device Manager, click View –> Show Hidden Devices and remove all VMXNET* or Intel E1000 drivers if you see them as grayed out.  I saw none, other than the VMXNET3 that was already installed.

4) Go to RegEdit and browse to the HKLM\System\CurrentControlSet\Control\Network hive.

image

You’re going to see a number of {xxxxxx-xxx-xxx……..xxxx} keys and values.  These are the virtual NIC’s (note there’s more than one, which is the root of the issue!), and their associated bindings (IPv4, IPv6, QoS, VLAN’s, PPTP, Teredo, etc, etc).  Get rid of them all, we’re going to clear this up as though a NIC had never been installed.   Shutdown the VM.

5) While powered off, edit your VM and add in your Network Adapter, choosing VMXNET3, Connected, Connect at Power On, etc.  Boot the VM up.

6) Verify that Windows finds the new NIC, and adds it as “Local Area Connection” with no 2/3/4 suffix.  You should also now be able to use or re-use any IP address you like.  We’re back to good now.

7) You might as well read VMware KB article 1010398and migrate from LSI Logic SAS to ParaVirtualized SCSI (PVSCSI) for your HBA as well.  The general gist of this is:  Power off the VM, add a new disk using SCSI 1:0 to add a new HBA.  Change the HBA to PVSCSI.  Boot.  Let it install the drivers.  Shutdown.  Remove the new disk and HBA.  Change the existing HBA to PVSCSI.  Boot.

8) Shut down the VM and Convert to Template.  You should now be able to right click and “Deploy from Template”, selecting a “Template Customization”.   According to VMware KB 1012314, you want to use the FQDN for the Domain vs the NetBIOS domain.  You also want to specify the username for the join as <user>@<domain_FQDN> vs <domain_NETBIOS>\<user>

9) So now you’re having problems.  It’s still not joining the domain and stuff, and you’re not sure why.

image

“Remaining Windows rearm count: 0”.  You’ve had SysPrep run on this system more than 3 times.   There are a few ways around this (http://blog.millard.org/2012/04/making-skiprearm-work-for-you.html & http://kingofbytes.wordpress.com/2012/05/09/sysprep-errors-with-server-2008r2-skiprearm-and-slmgr-vbs-solution/).  But ultimately, you should probably rebuild your template from scratch.

So that’s what I’ve opted to do.  There likely ARE ways around this.  But I’ve also learned something specific – before you SysPrep your image, *CLONE* it.  You know how in the movies, everyone is always trying to steal the plates that print the $100 bills?  That’s your template, all SysPrep’ed and ready to go.  Now – how did they make those printing plates?  Smile  If you CLONE your VM before you do your SysPrep, if you later want to redo it, add things to it, take it to another site/company/location/etc, you still can – it has never been SysPrep’ed.   If you later try to modify your SysPrep created template, that’s like making a photocopy of a photocopy – it’ll work, but over time you’re going to see strange things come up.

Advertisements
Categories: Uncategorized, vSphere
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: