VMware Cloud Community
pyeatman
Contributor
Contributor

backing up VMs

Hi, I was asked to look into the perl scripts vmsnap and vmres. We have at trial ESXi 3.5 server and want to experiment with these but I am not finding these scripts included on the server nor available online eventhough this website

http://www.vmware.com/support/esx25/doc/releasenotes_esx250.html#vmsnap

says:

Using the vmsnap and vmres Commands

The vmsnap and vmres commands are standard implementations of the ESX Server perl APIs. They

are provided on the install CD for the convenience of our customers and operate separately from the

ESX Server product. As we refine and improve these scripts they will be posted on the

ESX Server download page.

If backup script improvements are of interest, please check the

ESX Server download page periodically.

Seems they are a thing of the past. Threads that mention these in the forums are dated in 2005 or 2006. Have other scripts/tools/techniques replaced these?

Thanks,

Paul

Tags (2)
0 Kudos
10 Replies
lamw
Community Manager
Community Manager

Here is a backup script that supports both ESX/ESXi 3.5+ that you might find useful: http://communities.vmware.com/docs/DOC-8760

Good luck.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

0 Kudos
weinstein5
Immortal
Immortal

I did not realize those were still around - they were originally crerated for ESX 2.x - I do not think they will work with ESX/ESXi since they rely on creating a REDO Log -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
pyeatman
Contributor
Contributor

Thanks for pointing out this script. I am reading up on it.

I keep seeing Remote Commandline for 3i servers. As I'm exploring scripted (non-VIC) options, does RCLI offer any reasonable backup methods?

Thanks again!

0 Kudos
lamw
Community Manager
Community Manager

RCLI provides a set of tools that can be used to create a script that could potentially backup your VM(s). This allows you to remotely manage your ESX/ESXi host and specifically with ESXi since you do not have the Service Console anymore.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

0 Kudos
pyeatman
Contributor
Contributor

Thank you. Do you have any opinions/comments between RCLI approach and the script you pointed out. Is the script essentially using an RCLI approach? I see lines such as

vmkfstools -i "$/$" -d 2gbsparse "$/$"

Thanks!

0 Kudos
lamw
Community Manager
Community Manager

My opinion on testing both solutions, not specifically "vmkfstools" but I've used other commands locally and using the RCLI. I've found the main driver for me to use some of the local commands is performance/speed with the RCLI, it's not the fastest, it'll get the job done. I've heard there will be improvements and fixes to some of the known bugs in the next release. If you don't mind that, technically you can create a script that uses the RCLI to run backups of your VMs.

The other issue that you may run into is the lack of certain pieces of information from what the standard RCLI toolkit gives you, for example I recently talked to someone that has a VM whose VMDK's are spread across two different datastores. Using the standard RCLI toolset, you will not be able to get this information, it's obtainable but you'll have to create a custom script that uses the VI API and Perl to extract that information. Currently my backup script will look at the .vmx file and retrieve all relevant VMDK(s) mapped to the VM and then figure out if the VMDK is stored locally within the VM directory or look at other datastore and pass in the right params prior to backing up the VM.

If you write a script specific to your environment and assume certain things, you may not run into issues but if you generalize and you don't check for certain params or use cases, you could run into some trouble.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

0 Kudos
pyeatman
Contributor
Contributor

Thanks, again!

When you mention "local commands" or "locally", I'm thinking these are not options for me on a 3i server. This is from the admin guide

"VMware Service Console – A command‐line interface for configuring an

ESX Server 3 host. For an ESX Server 3i host, use the Remote CLI."

Am I understanding this correctly?

0 Kudos
lamw
Community Manager
Community Manager

Well on ESXi, there is a very limited type of console which does include "some" of the normal CLI tools like "vmkfstools", but again this is a limited environment and it's unsupported by VMware and it could also void your warranty. It's really used if you have issues and VMware techs needs to get in to extract logs/etc and it allows them a way to get in.

The primary option for managing ESXi is using the RCLI and VI Perl Toolkit which is what the Admin guide is referring to, you can also look into powershell if you're going to be managing this in a Windows environment.

My script does require you to open up the unsupported SSH console, but like I said, you can probably script a backup process just using the RCLI that would work for both ESX/ESXi.

Hopefully this answers your questions.

=========================================================================

--William

VMware ESX/ESXi scripts and resources at:

0 Kudos
pyeatman
Contributor
Contributor

Yes, thanks for the reply. I haven't run across the VI Perl Toolkit before and so will look into this.

So, it seems my options are to write my own script, adapt yours for RCLI, or use unsupported SSH console on the ESXi server.

For

adapting your script, I believe I would need to add things like the

--server option for commands like vmkfstools and entirely replace

commands like mkdir with the equivalent RCLI command.

You said

the unsupported SSH console has a limited command set but it sound like

all the commands in your script are supported.

Thanks again!

0 Kudos
lamw
Community Manager
Community Manager

Yes, if you're looking at using either the RCLI or VI Perl Toolkit, you'll have to make quite a few changes and a good way to start is just playing with the default tool set and look in the RCLI/VI Perl Toolkit forums. Both toolset uses the VI API which is definitely more powerful in automating a whole range of tasks via the CLI and you can definitely create more elaborate scripts than what's already provided by VMware. That is one of the goals, is by exposing this API via the VI Perl Toolkit, you can create a whole range of scripts that can automate pretty much any task your heart desire, it does require some understanding of the object model used in the VI API.

Good luck

=========================================================================

--William

VMware ESX/ESXi scripts and resources at: