VMware Cloud Community
ToTheCloud
Contributor
Contributor

VMware Customization Wizard + Sysprep

Hello,

I have a few questions on what the best practices are for cloning a VM.  I have read in a couple of places now that syspreping the machine isn't as much of a big deal as it used to be back in the day due to hardware dependencies and new light being shed on the machine SID (apparently it doesn't matter if it is changed or not anymore).  Here are a few questions I have when it comes to creating a duplicate machine inside the realms of VMware.

1. Can you just clone a machine and roll with it without doing sysprep and then just rename the machine upon power-on?

2. Is sysprep worth running with the VMware Customization wizard?  It looks like that simply runs sysprep for you and saves you the pain of creating custom unattend files.

3. If you use the VMware Customization wizard, is there anyway to execute a custom script during the customization process?  I would like to execute a script to ensure my drives do not change letters upon deployment.

Thanks in advance for your feedback!

-ToTheCloud

0 Kudos
4 Replies
MKguy
Virtuoso
Virtuoso

It's true that apparantly, the whole SID changing thing was a waste of time all along as explained by http://blogs.technet.com/b/markrussinovich/archive/2009/11/03/3291024.aspx .


1. Can you just clone a machine and roll with it without doing sysprep and then just rename the machine upon power-on?

From the virtualization side, sure. It's not like the vSphere components are aware if something like sysprep has been done to a VM.  From the Windows OS side, consider thr article mentioned above. I personally still prefer to have the system sysprepped.

2.  Is sysprep worth running with the VMware Customization wizard?  It  looks like that simply runs sysprep for you and saves you the pain of  creating custom unattend files.

It's just like you say, the VMware customization feature is basically just a convenient sysprep workflow. You could do a lot more with custom scripts via PowerCLI though.

3. If you use the  VMware Customization wizard, is there anyway to execute a custom script  during the customization process?  I would like to execute a script to  ensure my drives do not change letters upon deployment.

You can put a script doing that on the template VM and then simply make the sysprep RunOnce option execute it.

As part of a more advanced automated deployment script, you could also utilize the Invoke-VMScript PowerCLI cmdlet to execute custom scripts on the VM at any time (as long as VMware tools run), at least.

I do something like this with Invoke-VMScript to partition/extend disks after custom deployments:

http://communities.vmware.com/message/2154246#2154246

-- http://alpacapowered.wordpress.com
0 Kudos
ToTheCloud
Contributor
Contributor

I'm looking for a script that will execute before the OS boots up.  In particualr, I am trying to keep my drives from changing letters during the sysprep deployment.  I would like to use the VMware Customization wizard as it pretty much does everything I need to do, except for the issue of drives changing around when the system gets generalized.

Have any ideas on how to prevent this?

Thanks for the response!

-ToTheCloud

0 Kudos
MKguy
Virtuoso
Virtuoso

I'm looking for a script that will execute before the OS boots up.

You lost me. You can't execute anything in the Guest before it boots up obviously. Or what exactly do you want the script to do where?

The first time a cloned/template-deployed VM boots up, it will just be exactly like the source. Sysprep takes place each time after this. This would mean the drive letters get messed up each time you power on the source VM in the first place and you or should just fix whatever goes wrong here in the source, or create a RunOnce script directly into the source itself.

Can you elaborate on that drive-changing issue a bit more? What does your source disk layout look like and what changes? I've never experienced anything like this, but I generally only use single-disk templates though.

Also, why can't you change the letters after sysprep?

-- http://alpacapowered.wordpress.com
0 Kudos
ToTheCloud
Contributor
Contributor

Like you said, after we deploy a VM from the template, sysprep runs and scrambles up the drive letters.  Unfortunately, we have a couple of services that run immediately upon start-up that seem to not gracefully respond to the scrambled drive letters.

I thought I had read somewhere that it was possible to execute a script once the machine was done finishing the sysprep process, but before the machine actually booted into windows.

Sorry about the questions, I haven't had too awful much experience with the new unattended sysprep ways of server 2008.

Thanks for the help, I really appreciate it! Smiley Happy

-ToTheCloud

0 Kudos