How to take backup of Vagrant box without reboot ?

37 views
Skip to first unread message

Adminbirds

unread,
Nov 26, 2019, 2:59:35 AM11/26/19
to Vagrant
Hi

we have 33 vagrant box running on our physical machine. I need to take entire VM backup to our backup server.

I found this 


Creating as package then copy it to remote location (vagrant package). But while doing vagrant package the box went down, is there is any option to take vagrant package with --no-reboot option.

For 100 GB box it took more than 2 hours to converting as package. we can't afford downtime :-)

One more question, I'm copying the current vmdk files & to remote folder, VM's is in running state, does it cause any data corruption for the box ? while syncing the data to remote location.

Simply my question is how we can take entire vm box backup without reboot box ? anybody knows the answer, please help ;-)

Jim McGinness

unread,
Nov 26, 2019, 5:16:51 PM11/26/19
to Vagrant
I realize that some of the things vagrant can do seem almost magical, there is nothing magical about backing up a VM. It's almost certainly not wise to try to use vagrant package to perform a backup.

If you're taking advantage of vagrant, then what you should be aiming for is the ability to recreate the VM but perhaps in a different location or even with a different provider. Careful separation is needed between system and application software -- which vagrant can install in a consistent fashion -- and user configurations and data -- which have to be handled separately, unless they follow a pattern you can develop vagrant recipes for. One example is keeping an SQL database attached to an application on a separately mounted volume.

Vagrant has no facilities in itself to aid in making backups. It does not take snapshots or communicate with databases and file systems to establish quiescent backup points. The operating system of the guest VM and its VM host may offer such facilities and you would need to use those to get usable backups of a running system. It would most likely all be a separate apparatus from vagrant. If you are serious about no-downtime backups that can actually be recovered, I suggest that you may need to invest in a commercial software solution and the choices vary depending on what OS your guest and host are running, and on what hypervisor. If you were thinking vagrant package was a solution, I'd be remiss in letting you go on thinking that you could just roll your own backup system without additional help.

Alvaro Miranda Aguilera

unread,
Nov 29, 2019, 8:40:56 PM11/29/19
to vagra...@googlegroups.com
why you need backups of vagrant vms ?


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/add0d9ca-0089-42b8-a426-0b4c04278c72%40googlegroups.com.


--
Alvaro

Adminbirds

unread,
Nov 30, 2019, 3:19:34 PM11/30/19
to vagra...@googlegroups.com
Our Dev & QA infra setups are made with vagrant box.

It configured on 4 physical Dell server's, with 33 vms - CentOS 

most of the vm's are MySQL mongo nginx Kafka elastic search ,Apache storm etc.


if anything goes wrong main physical servers,we need to recover all the vm's so need the snapshot of that vm's as package for quick recovery..just like aws ami/snapshots





Jim McGinness

unread,
Nov 30, 2019, 5:34:46 PM11/30/19
to Vagrant
You are asking in the wrong place. The problem you have is to design your deployment to support your need for recovery. While vagrant might possibly play a role in that, depending on loose enough time-to-recover goals, it cannot help with backing up the live data in a way that will allow recovery.

Alvaro Miranda Aguilera

unread,
Dec 5, 2019, 2:43:36 PM12/5/19
to vagra...@googlegroups.com
hello

i would suggest review the way you are doing this and try see it using the right tools

you could replace vagrant with terraform to manage such environment.

and you could use source control to manage any change to infra or app running.

if anything goes wrong you just recreate everything and deploy latest changes.

if there is anything you need to have backups, then i am not sure this is dev or qa as seems more like a prod

how you handle prod? i would assume is a problem solved since you may need business continuity




--
Alvaro

Reply all
Reply to author
Forward
0 new messages