VMware Cloud Community
yannara
Contributor
Contributor

Template isn´t a template

I´ve created a template of a fresh installed VM (Windows Server 2008 R2). After that I deployed a VM from this template. To this VM I did some changes (patches and SQL server installation). Okay, everybody is happy.

Then, I created another VM from this template - suprise -> it isn+t a fresh install, it is the same patched SQL server! And my fresh installation is gone.

What I did wrong???

Reply
0 Kudos
15 Replies
Troy_Clavell
Immortal
Immortal

you created a new template off the deployed VM that you installed SQL and patches?  After deployment you powered down the guest and Template--Convert to template?

Reply
0 Kudos
yannara
Contributor
Contributor

No Troy. Let me clarify.

1. I installed a fresh VM with no additional installations.

2. I converted it to the template.

3. I deployed a VM from that template.

4. I instelled SQL and some patches on VM.
5. I deployed another VM from the original template. This VM has the same SQL and patches. Why in hell? :smileygrin:

I´m probably doing something wrong when creating a template, but what?

Reply
0 Kudos
nielse
Expert
Expert

And you still have the template AND the SQL VM in your inventory? Are you sure you didn't convert the template back to the VM and then moved on?

@nielsengelen - http://foonet.be - VCP4/5
Reply
0 Kudos
yannara
Contributor
Contributor

What is SQL VM? Smiley Happy

I don´t convert template back to VM, no way.

Now I tried a different method:

1. Install fresh VM

2. Clone to template (not convert to template).

3. Deploy a new VM from template = error .vmdk is busy or not available.

I´m I really doing something wrong here, or does templates works at all in vSphere 5? I gone through step-by-step guide of vCenter template section, and it seems simple, but just doesn´t work.

Reply
0 Kudos
nielse
Expert
Expert

SQL VM is/was the VM where you did install the SQL service on Smiley Happy

Can you attach a screenshot or log containing the error you received?

As far as I know the way templates work in vSphere 5 is still the same as in 4. Install a VM and either convert or clone it to a template from which you can than deploy new machines.

@nielsengelen - http://foonet.be - VCP4/5
Reply
0 Kudos
Rubeck
Virtuoso
Virtuoso

If you selected the "Edit Virtuel Hardware (Experimental)" and extended the disk during the deployment wizard, your newly deployed VM will end up using the .vmdk connected to the template...  Maybe this is what happend?

This has been and still is a bug in VC2.x and VC4.x..... Experimental features is not something that you want to use 🙂

/Rubeck

Reply
0 Kudos
yannara
Contributor
Contributor

Kim Rubeck wrote:

If you selected the "Edit Virtuel Hardware (Experimental)" and extended the disk during the deployment wizard, your newly deployed VM will end up using the .vmdk connected to the template...  Maybe this is what happend?

This has been and still is a bug in VC2.x and VC4.x..... Experimental features is not something that you want to use 🙂

/Rubeck

I always go through the "Edit Virtual Hardward Experemental" settings, but what do you mean by extending a disk?

Reply
0 Kudos
Rubeck
Virtuoso
Virtuoso

I mean, if you choose to grow the size of the virtual disk during deployment...

/Rubeck

Reply
0 Kudos
yannara
Contributor
Contributor

Kim Rubeck wrote:

I mean, if you choose to grow the size of the virtual disk during deployment...

/Rubeck

Yes, I do manipulate disk after deploying VM from template. Here is extended discription of my actions, including disk management.

1. Install fresh VM with 25gb disk, using thin provision.

2. Convert VM to template.

3. Deploy a new VM from template, changing disk size from 25 to 100gb.

4. Boot new VM to getpart linux to change system partition from 25 to 100fb.

5. Reboot back to OS, using 100gb partition.

6. Install patchs and SQL to VM.

7. Deploy new VM from template.

8. Recognizing that this lates VM has installations from the 6.step.

So, this might be a bug, huh? How should I handle this challenge, that I need different VM with different size of system disk.

Reply
0 Kudos
Rubeck
Virtuoso
Virtuoso

You have to increase the disk after the VM has been deployed...

Or reconfigure the template VM with the needed size..

But please verfiy if this is indeed the issue..  Deploy a VM and change the disk size. When deployed check the VM settings to see what .vmdk the new VM has attached. If this is the .vmdk used by the template VM itselt, remove it.. (Dont delete ofc)

(Just tried it on a vCenter 4.1 U2 to verify. Here the issue still exists for sure)

/Rubeck

Reply
0 Kudos
yannara
Contributor
Contributor

Kim Rubeck wrote:

You have to increase the disk after the VM has been deployed...

Or reconfigure the template VM with the needed size..

But please verfiy if this is indeed the issue..  Deploy a VM and change the disk size. When deployed check the VM settings to see what .vmdk the new VM has attached. If this is the .vmdk used by the template VM itselt, remove it.. (Dont delete ofc)

(Just tried it on a vCenter 4.1 U2 to verify. Here the issue still exists for sure)

/Rubeck

Offcourse I´m increasing the disk after the deployment! I don´t think that this issue is my stupidity. Even there is no logic in this issue, or it just is a bug, and serious one!

Last scenario gives me the best laughs, and one of my application server is corrupted now perfectly because of this.

1. Install fresh VM with OS and 25gb thin in Datastore A

2. Clone to Template.

3. Deploy new VM to Datastore B

4. Resize the disk to 200gb with gpart linux.

5. Install applications.

6. Aknowledging, that the 200gb resides in Datastore A, insted of B.

7. Shut down VM, move 200gb vmdk to Datastore B.

8. 200gb vmdk hard disk is white iconed, cannot be added to VM.

Please explain Smiley Sad

Reply
0 Kudos
yannara
Contributor
Contributor

And also imagine, how many days I´ve wasted because of this Smiley Sad

Reply
0 Kudos
nielse
Expert
Expert

I am not sure but somehow I see something going wrong.

The steps that should work (somewhat a copy/paste):

1. Install fresh VM with OS and 25gb thin in datastore A

2. Clone the VM to template

3. Deploy the template to a new VM to datastore B

4. Change the disk size from the new VM to 200GB (which is on datastore B)

5. Boot the VM on datastore B and resize the disk with gparted

6. Reboot the VM and make sure it boots

7. Install applications

8. Aknowledging, that the 200GB new VM resides in datastore B and that the template is still on datastore A being 25GB

@nielsengelen - http://foonet.be - VCP4/5
Reply
0 Kudos
yannara
Contributor
Contributor

Niels Engelen wrote:

I am not sure but somehow I see something going wrong.

The steps that should work (somewhat a copy/paste):

1. Install fresh VM with OS and 25gb thin in datastore A

2. Clone the VM to template

3. Deploy the template to a new VM to datastore B

4. Change the disk size from the new VM to 200GB (which is on datastore B)

5. Boot the VM on datastore B and resize the disk with gparted

6. Reboot the VM and make sure it boots

7. Install applications

8. Aknowledging, that the 200GB new VM resides in datastore B and that the template is still on datastore A being 25GB

Yes, steps 1-7 was done just like that, but I didn´t make sure the step 8 because I was fully relying on VMware technology... fool me :smileygrin:

Reply
0 Kudos
yannara
Contributor
Contributor

I think I have to change my way of thinking, so since now I will be satisfied of having always 25gb drive in system drive, and additional stuff, like database and server application will always go in a different virtual hard disk. Besides, isn´t this a best practise?

I´ll practise once again doing one VM for template, then deploy new VM, change stuff, create another VM, change stuff and make sure the stuff changed is saparated, like it should be. If not, I´ll investigate the paths to disks in config file.

I´ll get back if needed, thanks! And any thoughts are very welcome! :smileycool:

Reply
0 Kudos