VMware Cloud Community
Dandollars
Contributor
Contributor

Virtual Machine Preparation Best Practices.

Hello All,

Provisioning of virtual machines on my infrastructure takes like 30mins for the virtual machine to be provisioned completely. I did the necessary preparation on the virtual machine before converting to a template but i dont really know why it takes that long before the VM is provision successfuly.

Question: I need to know the steps to take when preparing a virtual machine so i know what i am doing wrong.

Tags (2)
0 Kudos
11 Replies
willonit
Hot Shot
Hot Shot

That doesn't sound like an abnormal amount of time. If this is a Windows machine, sysprep takes a significant amount of that time. The clone time is typically more of a storage constraint than anything with vRA or your template. A few things to look in to, are you using VAAI supported storage? Is VAAI enabled? Are your templates on a datastore where VAAI is optimized when cloning to another datastore? Try some clones in vCenter with out vRA and see how long it takes. Compare the amount of time to clone to a different datastore than the template is on and the same datastore. What have you already done to the virtual machine before creating a template?

0 Kudos
Dandollars
Contributor
Contributor

1. Disable I/O devices on the bios.

2. installed vmware tools.

3. added the vm disabled the firewall.

4. changed the IP of the vm and also added it to a domain.

5. adjust vm for best perfomance

6. installed guest agent for windows.

7. ran sysprep

0 Kudos
pratt26
Enthusiast
Enthusiast

‌In my VRA environment, we complete most server builds in under 20 minutes (2008 and 2012) This includes many extras outside of just the cloning process and domain join. My recommendation is to manually deploy from template using a customization spec and time it. It should not take longer than 10 minutes. Can you please post your results afterward.

also, since you asked. My steps to have a golden template:

Keep it as plain as possible:

.Net framework (needed for SCOM)

Disable UAC (until build is done)

0 Kudos
Dandollars
Contributor
Contributor

Please find below the unattended script i am using. I created it with a Windows System Image Manager.

<?xml version="1.0" encoding="utf-8"?>

<unattend xmlns="urn:schemas-microsoft-com:unattend">

    <settings pass="specialize">

        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <ComputerName>*</ComputerName>

            <TimeZone>West Central Africa</TimeZone>

        </component>

        <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <Identification>

                <JoinDomain>UJN</JoinDomain>

                <UnsecureJoin>true</UnsecureJoin>

            </Identification>

        </component>

    </settings>

    <settings pass="oobeSystem">

        <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <InputLocale>en-US</InputLocale>

            <SystemLocale>en-US</SystemLocale>

            <UILanguage>en-US</UILanguage>

            <UILanguageFallback>en-US</UILanguageFallback>

            <UserLocale>en-US</UserLocale>

        </component>

        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <OOBE>

                <HideEULAPage>false</HideEULAPage>

                <HideLocalAccountScreen>false</HideLocalAccountScreen>

                <HideOEMRegistrationScreen>false</HideOEMRegistrationScreen>

                <HideOnlineAccountScreens>false</HideOnlineAccountScreens>

                <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>

            </OOBE>

            <AutoLogon>

                <Password>

                    <Value>VQBuAGkAagBvAHMAQAAxADIAMwBQAGEAcwBzAHcAbwByAGQA</Value>

                    <PlainText>false</PlainText>

                </Password>

                <Enabled>true</Enabled>

                <LogonCount>2</LogonCount>

                <Username>Administrator</Username>

            </AutoLogon>

        </component>

    </settings>

    <cpi:offlineImage cpi:source="wim://layer3-pc/users/ejike/desktop/wim/winserv2012/sources/install.wim#Windows Server 2012 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

</unattend>

And it is not working.@pratt26pratt26

0 Kudos
pratt26
Enthusiast
Enthusiast

Hi,

Can you give a little more detail about your provisioning process? How are you calling the unattended files?

0 Kudos
Dandollars
Contributor
Contributor

I created a new customization specification on vSphere where i checked use a custom sysprep answer file, then i uploaded this sysprep file.

During the creation of the blueprint i inputted the name of the customization specification i created on vSphere in the customization spec field.

What i really want to achieve with this, is to give user the out of box experience and make sure they create a password for the administrator.

I don't know if i can do this any other way maybe using the custom properties. Please advice

0 Kudos
pratt26
Enthusiast
Enthusiast

I added your customization spec to my lab and I certainly see what you are talking about. It took forever. This seems like a problem with your sysprep file (honestly don't know much about the format in these) why don't you remove the options one at a time until you figure out which one is causing the build process to take so long. Please let us know, I would be interested to hear.

0 Kudos
GrantOrchardVMw
Commander
Commander

"What i really want to achieve with this, is to give user the out of box experience and make sure they create a password for the administrator."

If there was another way to achieve this, could you use the default sysprep?

Grant

Grant http://grantorchard.com
0 Kudos
Dandollars
Contributor
Contributor

I can use the default sysprep but i want the user to be able to have access to the machine from a remote desktop without having to give him/her a password. This means, they will have to use their login details or be able to create a password for for the machine before or during provisioning.

0 Kudos
willonit
Hot Shot
Hot Shot

From a high-level here is what you want to do

1. Create a password property in the property dictionary. Make sure the input type is property so the password won't be shown in plain text

2. Add the property to your blueprints and make it visible to the user

3. Create a vRO workflow that collects that property at the machine provisioned lifecycle event. Use the Guest Script Manager‌ to execute a "net user" command on the provisioned VM. You can set the Administrator password to the one the user supplied.

I think that is going to be the closest to what you are trying to achieve. You can also take a look at Adding Local Admin Without the Guest Agent where I add the requesting someone user as a local admin to the requested machine.

0 Kudos
Dandollars
Contributor
Contributor

I have noot ben able to do this

  • Create a vRO workflow that collects that property at the machine provisioned lifecycle event
  • Use the Guest Script Manager to execute a "net user" command on the provisioned VM

Please i need more help thanks.

0 Kudos