VMware Cloud Community
Pete987
Contributor
Contributor

Howto Clone a VM that has a Mapped Raw LUN?

We have a few machines with runaway snapshots and we are too scared to do delete all snap shots (we have no other way of recovering if this causes any problems for the VM). So based on advice from this forum we have using the clone feature. This has owrked perfectly until we came to a server with mapped raw lun.

Is there a way to clone (and therefore remove the snapshots) a VM with mapped raw lun?

We dont have enough free space on the current LUN, so we are cloning to other LUNs. Would freeing up space on the current LUN and cloning to the current lUN solve my problem?

Appreciate any tips

0 Kudos
12 Replies
LarsLiljeroth
Expert
Expert

Hi

We have had many runaway snapshot on upto 20 GB and we have always been sucessfull deleting them.

So i would just do it.

P.S Do a backup of some sort first.

// Lars Liljeroth

-


*If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

// Lars Liljeroth -------------- *If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
0 Kudos
Pete987
Contributor
Contributor

Thanks, is there anything to consider when deleting all snapshots on SQL servers with mapped raw lun? Will 32gb free on this LUN be enough to handle the snapshot deletion?

This server is very critical and without any DR i am reluctant. Is there another way?

car-sql01 Yes

1.2G Oct 20 2008 New

5.8G Jun 1 18:32 New

5.1G Oct 20 2008 car-sql01-000001-delta.vmdk

27G Jun 5 15:33 car-sql01-000002-delta.vmdk

The Mapped Raw LUN only contained data, could i create a new Virtual Disk, move the files from one disk to another and delete the Mapped raw Lun and then change the drive letter of the new drive to that of the old drive. I am sure windows server would be happy. But, what effect would this have on my snapshots and how would my clone/snaposhot deletion behave?

0 Kudos
LarsLiljeroth
Expert
Expert

Hi

The main thing is that it will take along time....and vCenter will timeout and say that it has failed. But it will still run on the host.

The space needed when deleting snapshots is equal to the amount of data changed during the deletion. And since the 25GB is 10 days

old i would say 32 GB is enough.

The other options i see is snapshot of the LUN on SAN level if that is possible. Cloning does not include RDM as far as i know.

But still it is very important to do a backup before you start. You could do a SQL backup and if the OS is not RDM you could shutdown the vm and copy the

vmdk.

br.

/Lars

-


*If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

// Lars Liljeroth -------------- *If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
0 Kudos
avlieshout
VMware Employee
VMware Employee

BEWARE!.

You have multiple snapshots. When performing a DELET ALL on snapshots, you might run out of diskspace.

When deleting, changes are comitted to the parrent disk. In your case the 27GB (000002-delta) snapshot will be committed first to the 5.1GB (000001-delta) snapshot, which in turn will increase significally! After this, the 000001-delta files will be committed to the original vmdk. Delta files will be deleted only after all commits are done. For the snapshots to commit, addional consolidation helper snapshots are necessary, which will need space on your lun, and if you have an "active" SQL server they can grow quick too.

To be safer you can first delete only the 000002-delta snapshot. After this is done delete the 000001-delta snapshot.

Maybe you want to make sure since it is an SQL server that you stop the SQL server temporarily after hours so that diskchanges are minimalized.

Remember the task will run for a long time and your virtual center task will time out. Connect the VIC directly to the ESX server to view the task on the host.

btw If you have the RDM in Physical compatibility mode. The RDM is not affected by the snapshot. You could temporarily remove the RDM, Clone the VM and afterwards reconnect the RDM to the clone.

-Arnim van Lieshout

-


Blogging:

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
Pete987
Contributor
Contributor

Thanks for the tips. I have decided to play it super safe. We have an outage windows scheduled tonight so i want to make sur ei get it done inside the window, safely.

  1. I am moving a server off the lUN to bring total free space to 90+gb

  2. I have created a new Virtual Disk on another LUN and i am copying the data from the data dir to the new disk (this is in additon to regular backups)

  3. I will then power the server down and do Delete All Snap Shots

The Raw Disk is set to Virtual and i know nothing about these so i am not going to change anything on it.

Just thought, could i have tried using the Export VM feature of the converter software? Or would this have the same result as the clone?

0 Kudos
avlieshout
VMware Employee
VMware Employee

Normally when I run into a large snapshot, I advice not to go for the "delete all" option. In turn I use the VMware Converter to create a "clean" clone. This process is much quicker than deleting the large snapshot.

However since an RDM is involved, running the VM through VMware converter would transform the RDM into a regular vmdk. Which is probably not what you want in this case.

If you want to copy the data to another disk, making an image may be a faster solution. You could even run it through converter as I said above to create a temporary backup VM.

Remember, deleting such a snapshot takes HOURS!. If you say to me tomorrow that it took 8 hours or so, I am not supprised. I've been there before, but on the other hand it never failed to me.

Good luck. I guess it will be a loooooong night for you.

-Arnim van Lieshout

-


Blogging: http://www.van-lieshout.com

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
avlieshout
VMware Employee
VMware Employee

One other advice. Connect the VIC directly to the ESX host to remove the snapshot.'

I always do this to eliminate virtual center as a point of failure and it would time out anyway.

-Arnim van Lieshout

-


Blogging: http://www.van-lieshout.com

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
Pete987
Contributor
Contributor

OK I used the Vconverter export feature, it worked and it took 7 hours Smiley Happy But it converted the disks to a virtual disk, which is what all of our other servers have. What are the impications of this disk conversaion? The server appears to be running fine today.

I was planning to delete the original tonight and recover piles of disk space, but before i do i am worried about your comment +However since an RDM is

involved, running the VM through VMware converter would transform the

RDM into a regular vmdk. Which is probably not what you want in this

case."+

Aside from the concern you raise about the disk conversion, i thought this worked fine?

0 Kudos
avlieshout
VMware Employee
VMware Employee

My comment was only the emphasize that when you run it through converter, the RDM would get converted to a virtual disk, and I didn't know the reason for having that RDM disk.

A regular virtual disk (vmdk) is fine. If there is no special reason for having that RDM, you should stay with the virtual disk.

There are no implications as far as I know due to conversion. If the server is running fine, you can delete the old files and reclaim diskspace. Glad you got rid of that snapshot.

To avoid such situation in the future monitor for snapshots. I monitor for snapshots that get older than 1 week.

-Arnim van Lieshout

-


Blogging:

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos
Pete987
Contributor
Contributor

Thanks for everyone's help. I will wait until tomorrow and delete the original.

We have decide to not use snapshots on live DB servers, and we will use snapshot only part of the infrastructure change process whcih will have a specified end life for each snapshot, within a few days of creation. swe are going to upgrade to esx 3.5, our undersanding is that even though we are using snapshots incorrectly (longterm) some of the difficulties using them with DB servers has been addressed in newer versions of esx?

thanks again.

0 Kudos
LarsLiljeroth
Expert
Expert

Hi

Good to hear it went well ! We do snapshot on all our production server once a week for disaster backup.

Some snapshot are not deleted after this. So we run a Powerschell script every monday that lists all servers with snapshots.

By doing this we make sure not to get large snapshots.

// Lars Liljeroth

-


*If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

// Lars Liljeroth -------------- *If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
0 Kudos
avlieshout
VMware Employee
VMware Employee

We use snapshots all the time too. Even on SQL servers.

But we only use them if we want to change something on the system. After change is succesfully applied we delete the snapshots.

For monitoring we use an SQL report generated every day by SQL reporting server.

-Arnim van Lieshout

-


Blogging: http://www.van-lieshout.com

Twitter:

If you find this information useful, please award points for "correct" or "helpful".

Arnim van Lieshout Blogging: http://www.van-lieshout.com Twitter: http://www.twitter.com/avlieshout If you find this information useful, please award points for "correct" or "helpful".
0 Kudos