VMware Cloud Community
andrea_annoe1
Contributor
Contributor

Impossible to backup VM without VBC

Hi to all,

(Intro: I don't have a SAN)

I have try to create a perl script :

1) stop services DB

2) create a snapshot

3) restart a services DB

4) copy file of virtual_machine into backup directory

5) commit a snapshot

At 4) I have a problem to copy file .vswp , then I have set Reservation Memory to MAX Ram of VM --> file .vswp = 0GB

I have modify virtual_machine.vmsd cancel label of Snapshot file and setting :

snapshot.numSnapshots

= "0"

snapshot.current

= "0"

When I try to restart VM from a backup file: vmware-cmd -s register virtual_machine.vmx get an error:

VMControl error -999: Unknown error: SoapError: ServerFaultCode(1588) : (Invalid datastore format '[]virtual_machine.vmx'.)

Please help me!!

Thanks in advance Andrea.

Tags (3)
0 Kudos
7 Replies
andrea_annoe1
Contributor
Contributor

I have register correctly the virtual_machine but from VI client "edit setting" don't recognize Size of disk "virtual_machine-flat.vmdk"

0 Kudos
beagle_jbl
Enthusiast
Enthusiast

The following are the only files you need to backup/restore (while in snapshot/hot mode or in suspend mode).

  • virtualmachine.vmx -Primary configuration file of the virtual machine that stores settings of the virtual machine

  • virtualmachine.vmxf -Supplemental configurations file of virtual machines that are in a team

  • virtualmachine.vmdk -Virtual disk file, which stores the information of virtual machine's hard disk drive

  • virtualmachine-flat.vmdk -Virtual disk file, which stores the actual data of virtual machine's hard disk drive

  • virtualmachine.nvram -Contains BIOS information about the virtual machine

When you do the restore the Virtual Maxhine in question has to be "powered off".

If you do those things there should be no problem.

WillemB
Enthusiast
Enthusiast

You can still backup VM's like VCB but you will not get the same level of action as VCB. VCB has been created to solve the complex problem your attempting to solve.

Ever thought of accepting downtime and bringing down or suspending a VM and then copying it to safety?

I think your trying to boldly go where no man has gone before. If you do succeed to do this I believe many will be very interested. (including me Smiley Happy)

0 Kudos
beagle_jbl
Enthusiast
Enthusiast

We back up all our VM's this way. We have scripts that put all the VM's in "Hot" mode by taking a snapshot, then HP Dataprotector is used to copy the non-snapshot VMDK files to LTO tape, and once those are backed up a script is run to merge the snapshots (I hate how VM uses the term "delete" snapshot - which makes sense but could obviously be misinterpreted). We have had no issues with backups or restores using this method, and preferred it to VCB. Most backup software vendors will have a documented method for scripting live backups without using VCB. You don't need to use the backup software though, you could simply copy the files manually or by script using ANY method, then merge the snapshots when done.

andrea_annoe1
Contributor
Contributor

Hi Beagle,

I save the file (while in snapshot/hot mode or in suspend mode).

  • virtualmachine.vmx -Primary configuration file of the virtual machine that stores settings of the virtual machine

  • virtualmachine.vmxf -Supplemental configurations file of virtual machines that are in a team

  • virtualmachine.vmdk -Virtual disk file, which stores the information of virtual machine's hard disk drive

  • virtualmachine-flat.vmdk -Virtual disk file, which stores the actual data of virtual machine's hard disk drive

  • virtualmachine.nvram -Contains BIOS information about the virtual machine

and dimension are equal to original.

When I try to restore :

1) vmware-cmd -s register /full_path/virtual_machine.vmx and in VirtualCenter appear virtual_machine in power off.

2) I try to open edit setting of virtual_machine in VirtualCenter and appear Disk "undefined disk dimension"

3) I try to start VM and the missing of snapshot disk I have an error --> it's necessary some modify on .vmx .....Is it correct?

Can you tell me about this modify that you apply on .vmx?

...can you tell with an example?

This is an original virtual_machine.vmsd is necessary for restore????

vmxsnapshot.lastUID = "62"

snapshot.numSnapshots = "1"

snapshot.current = "62"

snapshot0.uid = "62"

snapshot0.filename = "virtual_machine-Snapshot62.vmsn"

snapshot0.displayName = "virtual_machine"

snapshot0.description = ""

snapshot0.createTimeHigh = "277858"

snapshot0.createTimeLow = "1833461523"

snapshot0.numDisks = "1"

snapshot0.disk0.fileName = "virtual_machine-flat.vmdk"

snapshot0.disk0.node = "scsi0:0"

snapshot.needConsolidate = "FALSE"

snapshot0.type = "0"

Thanks Andrea.

0 Kudos
beagle_jbl
Enthusiast
Enthusiast

I am a little confused by the complexity of your restore - maybe I do not understand what you are trying to accomplish. Are you trying to take a backup and then do a restore and then apply a snapshot to get you back to current state? I am not sure why you would want to do that. If you need to backup files within the VM then it's still probably best to use whatever methods you would have used with a physical server (backup software and agents, file copies, etc.).

To do a basic restore from a backup, whether taken from suspend or a live backup, your VM CANNOT have any snapshots currently running for this restore method. Those must be merged(aka "deleted") before doing a restore. You will be restoring the VM to the point it was last backed up. You will not be able to apply a snapshot or maintain a snapshot during a restore.

If you are doing an in-place restore you simply need to

A) Ensure all snapshots have been merged (aka "deleted") for the VM in question.

B) Shutdown/power-off the VM.

C) Copy the files to the appropriate path and you must overwrite the 5 existing files(listed below by function)

D) Power on the VM. No need for any additional commands or configs.

Virtual machine's configuration data:

- /vmfs/volumes/<UU-id>/virtual machine/virtualmachine.vmx

- /vmfs/volumes/<UU-id>/virtual machine /virtual machine.vmxf

Virtual machine's virtual disk's file:

- /vmfs/volumes/<UU-id>/virtual machine/virtualmachine.vmdk

- /vmfs/volumes/<UU-id>/virtual machine/virtualmachine-flat.vmdk

Virtual machine BIOS configuration file:

- /vmfs/volumes/<UU-id>/virtual machine/virtualmachine.nvram

0 Kudos
Couldn_t_Find_D
Contributor
Contributor

For me problem vanished once I started using the full path of .vmx file

0 Kudos