close($fh);
}
-# For use on the HN
+# For use on the HN. Derive the VE record from its VEID.
sub localVe($)
{
my ($veid) = @_;
my ($ve) = @_;
die "No VE record for saveConfigs" if (!defined($ve));
- # Copy configuration and other scripts belonging to VE into VE's snapshot
+ # Copy configuration and other scripts belonging to VE into VE's snapshot.
+ # Do this in a manner similar to that supported by vzdump for consistency.
my $snapprivate = $ve->{'snapprivate'};
mkpath "$snapprivate/etc/vzdump";
my $conffile = $ve->{'conffile'};
die "Failed to make snapshot of filesystem for VE $veid"
if (!defined($ve->{'snaproot'}));
+ # Save the VE configuration from its hosted HN into the filesystem. If
+ # /etc is backed up, so will the VE configuration.
+ saveConfigs($ve);
+
# Make and exec the backup command. Do it in a chroot to the snapshot
- # of the VE's root dir so that any relative path information in the
+ # of the VEs root dir so that any relative path information in the
# backup command is accurate. This does mean that each VE needs rsync,
# etc.
my $cmd = "chroot ".$ve->{'snapprivate'}." ".join(' ', @ARGV);