Forum
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Virtual Machine Exports

Virtual Machine Exports 2 months 3 weeks ago #1825

Hi Salvitore,

I am pleased to say that I deployed happily into production a couple of months back using XCP-ng 7.6 and all is well so thanks for all your help with the R&D stages to get me there. I'm extremely happy with the solution and I feel I really owe you a debt of gratitude.

I was hoping to pick your brain a bit in regard to best practice for regular VM exports... We have a script developed that exports virtual machines to a NAS storage with external USB. The script can perform hot or cold snapshot based exports but also just plain old offline cold exports that require a VM to be fully shutdown until manually turned back on.

I'm running in appliance mode and have a default vApp containing all the VMs that require starting in a controlled order but to shutdown and export my machines, I must remove them from the vApp before shutting them down or else HA resuscitates them before they get a chance to export which requires a bit of complex scripting that I would much rather avoid if possible.

Have you any guidance / advice that might simplify the process? ie temporarily exclude a VM from HA for the purpose of an export? I guess you could call it a feature request. I suppose the other option is to change to machine mode and set ha-lizard-enable to false for each VM getting exported but I feel that I would lose granular control over my start ordering.

Any ideas / advice is truly welcome.

Cheers,

Nathan

Please Log in or Create an account to join the conversation.

Virtual Machine Exports 2 months 3 weeks ago #1826

  • Salvatore Costantino
  • Salvatore Costantino's Avatar
  • Offline
  • Posts: 576
Hi Nathan,
Not knowing exactly how you perform your backups, I can only make some assumptions.

Assuming your backup job is scripted, I would suggest you programmatically disable HA before your backup job and then re-enable when complete. It can be done from the command line or a script. For example, if you are calling a backup script that automatically handles the exports, you can do something like this:

ha-cfg ha-disable && sleep 10 && <call your backup script here>; ha-cfg ha-enable

Also, as an aside, we do ship a robust backup utility as part of ha-lizard which can perform exports on running or stopped VMs automatically. It can be setup to run as a cron job on your desired schedule. You can pass in credentials to a CIFS NAS and set a retention policy on how many exports to keep on your NAS.

the script is located in /etc/ha-lizard/scripts/vm-backup.sh. You can pass in all arguments at the command line or specify a single configuration file that stores all of your desired settings. The tool is rather flexible and can take a number of arguments to suit most any automated backup requirement.

you can read all about it from the CLI with "/etc/ha-lizard/scripts/vm_backup.sh --help"
You would not need to shutdown any VMs with this tool.

Please Log in or Create an account to join the conversation.

Virtual Machine Exports 2 months 2 weeks ago #1828

Hi Salvitore,

Our backup scripts are run as a cron scheduled task and make use of the vm-export feature of XenServer.

I have considered pre and post hooks of ha-cfg ha-disable and ha-cfg ha-enable but exporting 2TB of VMs can take as long as 8 hours which means that HA would be off for long periods of time.

I wans't aware that there was a backup script bundled... I'll take a look at it.

Cheers,

Nathan

Please Log in or Create an account to join the conversation.

Virtual Machine Exports 2 months 2 weeks ago #1829

Just took a look at the bundled export script and it is basically the same as our own although we have three modes.
1. Hot Snapshot Export (Perform the snapshot with the VM running, export the snapshot.)
2. Cold SnapShot Export (Shut down the VM, perform the snapshot, start the VM, export the snapshot.)
3. Cold Export (Shut down the VM and export fully while off.)

Our servers cater to a wide variety or operating systems for different purposes so there are situations where we require virtual machines to be shutdown gracefully and remain off while exporting. Doing live snapshots alone is not quite enough so I'll just continue to remove the machines from the vApp prior to exporting.

Cheers
Nathan

Please Log in or Create an account to join the conversation.

  • Page:
  • 1