Is there an equivalent to [NOSNAP][NOBAK] for Exported VMs?
-
@propsoft Your best bet might be to review the documentation so that you're aware of what options you have available. https://docs.xcp-ng.org/management/backup/
Specifically https://docs.xen-orchestra.com/backups#exclude-disks
.
This is during a backup operation only though, if you're trying to export the VM to XVA etc, you'd get the entire VM and its disks.
-
It might be easier to simply have XO operate your backups, exclude these disks that are larger than the 2TB - 8Mb capacity. Continuous Replication may work for this, but I'm not sure off hand.
I'm assuming these are iSCSI drives, and are on a SAN.
-
@DustinB said in Is there an equivalent to [NOSNAP][NOBAK] for Exported VMs?:
I'm assuming these are iSCSI drives, and are on a SAN
The live ones are a either external USB drives passed thru to a specific guest (because they exceeded the 2TB limit currently on XCP-ng), or an internal NVME high capacity drive.
However, my test one is simply a virtual second disk on local storage.
I appreciate that '[NOBAK]' relates to backup only (which we don't currently use XO for, the data is backed up and encrypted as part of an overnight schedule on the guest itself).
I mistakenly thought that '[NOSNAP]' would hopefully exclude a drive from Exporting, but it didn't, which is fair enough.
In fact, it didn't exclude it from a snapshot either under XCP-ng 8.3 from the command line (xe vm-snapshot command), which surprised me as I thought this "[NOSNAP]" feature was implemented in the server itself, rather than clever bits added into XO.I can't test it yet, but I've an idea that might work for our unusual situation without messing up the rest of the overnight too much, I think the 'xe vm-snapshot' command will create a logical snapshot (which includes references to all the local disks) instantly, without taking up much space at all, as from what I remember, the command was pretty much instant.
I can then get the script to run "xe vm-disk-list" just for the snapshot (rather than the guest VM) to obtain a list of all drives associated with it, and any that contain "[NOEXPORT]" it can issue a "xe vdi-forget" for that drive's UUID.This should leave me with a logical snapshot that does NOT reference the drives where the names contain "[NOEXPORT]", so I can then export that logical snapshot to the target drive.
That's the theory anyway, and as it's only using 'xe' running locally on each server, it would probably work on the older XCP-ng / XenServer servers too, without having to get XO involved.
Hopefully I will get time to try it out when the servers aren't in use tomorrow at 1am.
It's just a theory though, so may end up back at square one -
@propsoft Using a different tool to backup your data from within a VM isn't unusual. It just adds complexity if you need to restore the VM (data excluded).
I might re-evaluate your approach if at all possible to take advantage of the tools available at your disposal, and only use your separate tools to backup data within these larger data stores and use XO to backup the VM, and exclude these disks with the [NOBAK] configuration on the given disk.
-
@DustinB I am currently experimenting with XO's backup - it's certainly comprehensive.
But unlike the current situation we've had for years, where there's a monthly ".xva" export which we can easily restore to any server (even at a different location) followed by a data restore, it is going to take some time to learn about the different features and different approach with XO.
I've created a backup job, and it exported to my local NAS without issue, even creating a ".xva" - so I intend restore that test to a different XCP-ng server to see how easy it is, then see how the incremental backups perform.In the meantime, I tried my test script last night and it worked on my local setup perfectly (I had to add one more step to my logic above, xe snapshot-param-set is-a-template=false "uuid=$sViaSnapshotUuid")
So feeling confident I ran it on one of the 'live' servers in the early hours, but it failed because the server has the external "SCSI 4:0:0:0" drive which stops snapshots from working
I'll continue with the automated system already in place on the live setup, where each XenServer/XCP-ng does its own monthly export and each guest does its own encrypted backup as that's been working and rock solid for years (except for servers with external drives), but will invest spend time learning about the XO backup features you suggested as they look as though such an approach might work with these awkward drives that are currently stopping snapshotting, even with "[NOSNAP]" set.
Cheers!
-
I'm clearly doing something wrong with XO though.
Left it backing up the VM about 2am this morning on my home test setup.
Said it worked OK.So I deleted the VM and restored back to the same server... the restore says "Successful" but the VM isn't there. Haven't even got as far as trying to restore to a different server yet!
-
@DustinB Even though XO wasn't able to restore its own backup, fortunately XCP-ng Center was able to restore it from the .xva in the 'xo-vm-backups' folder that XO backup created:
The restored backup shows the drive name starts "[NOBAK]" so it wasn't excluded by XO when it first backed it up (presumably because it was a regular 'vm-export' type):
I'm guessing only subsequent incremental backups are going to exclude the "[NOBAK]" drive, i.e. the initial Full backup has to include drives marked "[NOBAK]"?
And do you have any idea why XO couldn't restore the backup it created the night before?
The only change was that I deleted the VM before trying to restore, but it can't be that the VM has to already exist on the server before XO can restore it surely?Thanks
EDIT: Realised after watching Oliver's video, I should have used 'Delta' as the backup type >.<
Will try the experiments again -
@propsoft An Export is not the same thing as a Backup. An export is going to give you everything that is needed to make that VM operational on whatever hypervisor you're using.
As to why you're seeing "VM not found!" I don't know if that is a XO alert or something you added into the screenshot, I've never seen that so I can't speak to it.
-
As to why you're seeing "VM not found!" I don't know if that is a XO alert or something you added into the screenshot, I've never seen that so I can't speak to it.
I didn't add the text, all I did was highlight it with the red surround.
Just testing the backups again using the 'Delta' method and '[NOSNAP][NOBAK] Data drive' as the name of the second drive , feeling more hopeful about this one though.
I'm starting to like XO the more I use it, would be good to move to this instead of switching between 2 different XCP-ng Center EXEs. depending on the XCP-ng version on the host so I really hope I can get this to work.
The scheduled hourly snapshot while the guest is running looks a great feature, although I need to learn to walk with this first before I go that far
-
This post is deleted!