Proxmox How To Backup and Restore VMs to a NAS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
keeping back of copies of computers and data is extremely important to give you some perspective I was once told by an insurer that companies that don't recover their computer systems within a month usually go out of business now hopefully you'll never have to face that scenario but you do need to be prepared fortunately proxmox V has a built-in backup solution and you can use this with an NFS or RB share on a Nas for instance but how do you back up and restore your VMS to a remote share well if that's something that you're interested in finding out then stick around and watch this video as that's what we'll be going over now because this video is specifically about the build-in backup solution for proxmox ve I'm going to assume you already have a remote share configured that foxm ve can connect to every file server and Nas will have different ways to configure NFS and SNB shares for instance so it simply isn't possible to cover them all but I do have another video available that shows you how to set up NFS shares in tress for instance that fox MOX V can use now in order to back up our virtual machines proxmox is going to need somewhere to actually store the backup files and there are quite a few options available now what we're going to be doing is to connect proxmox to a share on a Nas so to do that we go to Data Center and then we click on storage now in my case I do have a cluster setup but the process is exactly the same if you're using a standalone not because of the way that the actual user interface is defined so to actually attach this to anas what we're going to do is click on ADD and then what we need to select is well typically either NFS or SMB SL siips just depends on how you've actually set up that share so in my case for the sake of this video we're going to go with NFS so I'm going to click on that then what it needs is an ID for the actual uh storage so I'm going to make this a bit easier to identify by calling it backups then what I need is to provide either the IP address or fully qualified domain name of the actual Nas itself so that's what mine is in the lab and then what I then need to do is tell it what actual share to connect to by selecting uh an option in this export field here so I'm going to click on the drop down menu it connects over uh to my actual Nas and it's showing me various shares available so I've got one here which has been called PVE backup so I'm going to select that for the content by default it's selecting dis image so I I need to deselect that because all we're interested in is actual backup files and that's what this is Fey D backup file so we'll select that and then I'll just click somewhere else and then that's it we've defined what content we can store on this actual share now I'll just deselect Advanced because one of the options you get with advanced is to actually pick the NFS version now one thing to bear in mind is that that is something that's actually order negotiated uh when the actual connection gets done so I'm just going to leave it at the default I could lock it down to a specific version the only trouble is if later down the line we get a new version of NFS well I could be stuck with an all of version so I'd rather just leave it to order negotiation then what we've got up here is an option for nodes so what you can do is you can actually restrict this share two specific nodes if you want in the cluster but I want all of my virtual machines to be backed up so I'm going to leave that uh actually set uh by the default which is to allow all nodes to actually connect and then by default this is actually set to enable so it will connect so all really need to do now is just click on the add button and then off it goes and it will actually connect uh to that NFS share now you can see at the moment there's a little question mark where it's trying to connect and there there it goes it's now actually connected to my NFS share so all three of the actual nods are connected to that and I can click on that just to check yep we've got a connection now so that gives me now somewhere to actually store backup files now configuring proxmox to back up your virtual machines to in s is pretty straightforward really what you want to do is go to Data Center and then click on backup and then here you can actually create backup job so do that we click on ADD and then we're on the general tab where we've got a nde option which by default is set to all so all of the actual nodes in your cluster in this case uh would be included in the job what you can do is click on the drop- down menu but the only problem I found is that you can't select multiple actual nodes so it's it is a bit deceptive I mean we've got like server one at the top there selected if I select two I'm holding down the shift key sometimes it looks as though it's actually selecting multiple ones but in this case it's not anyway but the key point is you can't actually set up a job to cover multiple nodes it's either all of your nodes or one specific um actual server which is a bit of a shame I'll just click on that so if I click on the control key you can see it looks as though I've actually selected two servers there but no it's only picking one but in any case what we want is all of our actual nodes includ uded because the virtual machines could be moving around over the course of time anywhere from one no to another as part of AA for instance so for me it makes sense to have a job covering any uh anything and everything basically then we've got storage option now in my case by default it's actually picked the backups folder click on the drop- down menu and I could actually select somewhere else so I wanted to but that is where I actually want to send these backup jobs to so I'll leave that set as backups now the scheduling option you got quite a few choices here and typically what I like is to back up everything every day I mean if you got very critical um systems then maybe you want to do it on a regular period of time throughout the day so maybe you want to do it every two hours rather than say at 9:00 at night every day thing to point out is that it's actually pretty straightforward once you have a look at these because if if I select every day 2100 what I can do is actually could change that to or300 for example cuz this is all in military time it's not your AM and PM that's something to bear in mind but it's quite easy to change that time so I find it's easy to probably pick one of the examples that they've got and then just modify it to suit you for example but what we're going to do is just an example here we'll just pick this one which is 9:00 900 p.m. on a night every day now we've got an option for the selection mode which by default is set to include it selected VMS so you've actually got to pick which VMS fortunately you can actually um select individual virtual machines but typically you'd have one to actually do everything the reason being is that as you add virtual machines to the cluster well we don't want to get them uh missed out of a backup job so it makes more sense to do that now if you've already got a lot of virtual machines on your computer the flip side would probably I would say exclude selected virtual machines in which case you want everything backed up except specific ones so there might be certain virtual machines that you don't want to have backed up in which case you would exclude those but in this case we're going to go with all as as I say I don't want to run the the risk of you know introducing a virtual machine into the cluster that just doesn't get backed up and consequences could be quite severe putting it bluntly we then got an option two to send emails so you'd have to put some email in here email address here of where you want these to sent to and by default it's actually sent uh set to notify always now there is another option here of to actually only send emails if there's a failure that is quite useful in the sense that if everything's working all Ticky Boo and you're not having any problems then you won't get tons and tons of emails the only drawback is if the actual email system itself has a problem it thinks it's sending emails off but you're not actually receiving those emails well if you go with the option of on failure only the email might get sent but you won't necessarily receive it in which case you won't necessarily know if your backup's actually failed so I'd say it probably makes more sense and just stick with that default of notify always or it's entirely up to you what you want to go with we then got an option for compression Now the default is actually to go with a kind of a balanced approach of uh having fast compression in other words that way the actual jobs don't take as long to actually back up your virtual machines but it's also got good compression so that way you get smaller file sizes one thing I'd say though is that if you're already doing compression on your Nas for example bear in mind is that you're going to have the computer here whichever nord's doing the backup trying to compress the file then sending it off to the nas which internal and try and compress the file again you kind have a bit of a battle going on there it is possible to actually make things worse by compressing a compressed file but you're going to get the latency and the job's going to take longer so might be more sensible to actually test this on the actual Nas test it without any compression on the nas for example and do your compression within the backup job and then as a comparison leave the Nast to do the compression then disable the actual compression here just to see which is the better strategy we then got an option for M Now the default setting is Snapshot which probably makes a lot more sense because the alternatives are suspend and stop now snapshot what that means is it's going to take a snapshot of the virtual machine and then it'll back that up that's less disruptive if you do suspend and stop well it is disruptive so it's a bit of a trade-off because it means it's it's going to take a snapshot of the virtual machine in a specific moment in time so there might be something gets missed for example as part of the backup process but as I said I think that tradeoff is better because you just don't get your virtual machines getting turned off while you're trying to actually do these backups Now by default we've got this job set to enabled but you can actually disable that if you like and right at the bottom I'll just Des select Advanced and then select it again because that's an advanced option we've got an option here called repeat missed in other words it tries to repeat a job if it's been missed the only thing to bear in mind is that if you're running your backups at night when there's nobody around then you don't get any disruption to your users especially if you've only got one network card all that heavy backup data that's being transferred across the network doesn't really impact anybody now if something goes wrong and you fix it the next day if you've got this option actually ticked you run the risk of all of a sudden the backups and kicking in during the day and causing problems for your users so it's entirely up to you if you want to go with that I'm just going to leave that set um to disabled now the next tab is probably one of the more important things to think about and that is in terms of actual retention of your actual backup jobs it does actually make sense to actually keep multiple copies of backups just in case one gets corrupted or you're into ransomware problems and so on but the only drawback is you're then going to be using up a lot of storage space so you've got an option just to keep all backups but then potentially at some point you're actually going to run out dis space out on your Nas for example otherwise you can actually start setting retention and it it really depends on what you want to do I mean when you're talking about storing data uh on your virtual machines which I prefer not to do the problem you're going to have is that you'll want to keep a lot of actual backups because you never know how far back someone's going to have to go and to retrieve a certain file for example so that's why I prefer to actually have the virtual machines with as little data on them as possible virtual machines would connect to some remote share to be able to get their data that way I'm only concerned about the actual virtual machine itself the operating system uh the applications running on it so I'm doing these backups to actually backup the actual virtual machine itself not the data that's being used it's going to be a long time to restore a virtual machine of say 20 gig versus a file of say 20K um if that file is actually on the virtual machine I've got to restore the entire virtual machine whereas if I'm keeping the data separate well it's going to be pretty quick to actually restore that data file in comparison in which case for me if all I'm concerned about is the virtual machines I don't have to keep that many copies of the actual computer the reason I'd want to keep backups is well Disaster Recovery something really bad goes wrong and I've got to recover the whole thing or some other problem patching problems um configuration changes and I've got to revert back to an older version in which case what I'm going to go with here is I'll keep say three daily copies and one weekly copy now I'm backing these up every day so hourly doesn't make sense I could keep a month as well just to be on the safe side but if I actually had some sensitive data data that I might actually need to actually recover at some point I might put in say keeping say like a yearly backup or more what you use is entirely up to you but this is what I'm going to go with I'm was going to keep last three days the last week's copy and the last month now one last thing is the actual note template now what this does is to actually create a note against the actual backup job itself and gives you some examples down here what you can actually put in but by default it actually stores the actual guest name so you can tweak around with this if you like to just make it easier to actually identify the actual backups when they do get H created but just having the guest name for me is fine so all I need to do to actually create this actual job is just click on Create and it's now actually created a job so at 9:00 at night every day it's now going to back up all of my virtual machines and they're going to kept on the actual Nas and it's also going to be doing pruning it's only going to keep a certain number of uh actual um backup copies I mean I can go back and I can click on edit and I can make changes to this job over the course of time I can have a look and clicking on the job detail to get a bit more information a useful feature is well if you've got the opportunity you can actually run the job now rather than waiting until the next day basically to find out if this is actually worked only drawback is well if you're backing up virtual machines which have got relatively large disk space um you've got the problem of a lot of data are actually going across the network which can be disruptive for your users but if you got uh separate network card for your storage that's probably not an actual issue for a business even so it really depends on your circumstances but what I'm going to do because it's just a lab anyway I'm just going to click on run now I just confirm it and then of it actually goes and it actually starts backing up my virtual machines and you can see it's actually running a task against each individual uh actual virtual machine that's on all three of these actual nodes well as you can see all three of these tasks have actually now completed so all three of the virtual machines that I've got should now be backed up now it did take a reasonable amount of time to do this the only thing to bear in mind is that well I've got three proxmoxve nodes here within a cluster and they're actually virtual machines within a proxmox ve server so I've got one actual physical computer uh that I use for a lab and within that I'm virtualizing these actual foxm V servers here so they won't be as fast as they possibly could I've also actually got a nest that they're backing the actual files of two which itself is a virtual machine so it's a great way to save money if you want to set up a lab I just need the one physical computer and I run everything virtualized within that things run a slightly bit slower but not that uh slow uh so it saves quite a bit as I see on the cost of the actual physical Machinery plus the actual running cost as well but anyway the job's actually all now completed one thing I'll point out is that if I edit the job and then change the mode to say include selected VMS and let's say I pick out two of them click okay this suddenly pops up sure guests without backup job click on that and it actually tells me I've actually got a virtual machine here which isn't being backed up if I change the mode back to all C okay it disappear P so it's a it's a useful alert and say if you're actually backing everything up and that suddenly shows up well yeah there's a good warning sign to let you know something isn't being backed up on the other hand if you're going in the opposite direction where you're actually excluding certain certain virtual machines so there some machines you deliberately not backing up either way that would be useful to let you know which of the virtual machines aren't being backed up so you can find out if you've missed one out in your backup jobs for instance so definitely a useful feature there and then we've also got this uh schedule simulator you click on that you can play around with the actual um schedules and you can actually find out uh so like every 30 minutes for example and it actually shows you uh the actual format if you want to actually start creating your own um schedules within the actual uh job backups but if you click on simulate it'll actually show you the actual times that it's actually um going to be running these backup jobs which is actually quite useful that simulate 10 iterations of that so you'll know if there's certain days you're missing out certain times missing out it's actually quite useful almost and it gives you the actual details here so that's useful to be able to copy that and just copy and paste that I suppose copy that paste that in good job uh so copy that edit that change the actual schedule to that so very very useful that but either way all of my virtual machines should now be backed up now hopefully you know actually have to restore a virtual machine for real but all the same you do need to know what the process involves now typically when it comes to restoring an actual virtual machine it will because well maybe you're doing some sort of Disaster Recovery in which case you're literally starting from scratch building the new actual physical computers and then restoring the virtual machines or maybe the virtual machine is just beyond repair in which case well you have to do a complete restore of it now in this case I've got three three actual virtual machines so what would going to do is to actually remove this virtual machine because the trouble is you can't actually have identical computers on the same network anyway so let's assume this actual virtual machine is being corrupted in some way so I'm going to do is I'm just going to remove it I need to put in its ID and then just confirm that to remove the virtual machine so what we're going to do is actually remove the file then we're actually going to restore the ual virtual machine back so because I want to restore the virtual machine to node 3 what I want to do is to actually click on this backups uh storage option below node 3 itself and then what we've actually got to see here is a list of the actual backups that we've uh been carrying out now what I've done is to actually run the backup job twice uh incidentally what I'll show you is I did alter the backup job to actually keep the last two copies just so that I can actually show you the sort of layout that you get here so what you've got is a series of files and there's the note that you get that's something you can actually change in that uh notes template tab but what you can do is you can actually sort things so you can actually sort them based on the actual note which by default is the actual uh name of the actual virtual machine so this is quite useful because it then allows me to um select the out that I've got the test one virtual machine then test two then test three but if I'm just interested in what's the latest well I can just select the de option for example but what we're specifically interested in is restoring uh test number three that's the one we've deleted so I need the latest copy of that one so I'm going to select that file and then I've got an option to restore so that's what I'm want to do I to click on the restore button now this is the reason why I specifically said we've got to pick out the actual Nord because I'm not getting a choice as to where to actually restore um the actual Virtual Machine 2 you've got to pick your server first and then you decide uh which virtual machine to restore you don't get a choice in here to pick the specific uh node to restore too so it's giving you all the details about that file and things you can do I mean you can limit how much bandw gets utilized so that could be useful if you're in a real emergency for example and well you're at risk of causing problems for existing users because you don't have dedicated storage you can actually uh throttle the actual traffic which could be useful you've got a unique option which basically randomizes things like the MAC address for example uh if you just hover over it gives you a bit of details but when you're restoring an actual virtual machine for real the last thing you want to do is to actually change that sort of information you've also got an option to start after restore which usually is isn't recommended but the option is there and you've already saw I got these override options now these options that you can change the name the CES memory and the sockets well it's a bit Limited in comparison to what you actually see within the virtual machine itself I mean you've got options here where you can go into the hardware and start changing things here anywhere but I mean as suppose it's a a useful way if you want to do some sort of upgrade or something I suppose but in this particular case we just want to restore the virtual machine as is so I'm just going to sort these out again I want to make sure that's the last uh the most recent version again click on restore so I'm just going to leave all of these things as is I mean you can change the actual virtual machine ID as well if you like uh whated to doing it's just typically when you're creating a virtual machine for instance it just picks the next available number um in this case it's picking exactly the same one as it had before so when it comes to doing backups I mean if the virtual machine ID is that particularly important would probably make sense to actually keep an actual track of all the IDS against all of your virtual machines that you've got to make sure it gets the same ID in this case it's not that big of a deal anyway so I'm just going to leave it at 102 that's what it had before anyway but what I do need to do now is just click on restore and then offer goes and then restores our virtual machine well the restore process has actually finished and now I've got my virtual machine back in this case what I've done is well just to make sure that everything was working all tick boo I've actually started it up so what I've now got here is a virtual machine running inside of a virtual machine running inside of a hypervisor but it it does actually work um clock synced and everything got access to the applications and a basic default setup for Debian 12 so when it comes to actually restoring a virtual machine the process is pretty straight forward because you're either going to be doing this from scratch or it's a case of like I said the computer's actually broken it needs bringing back from the brink in which case you would just delete the original and then restore uh its actual replacement now when it comes to backing things up you do actually have to test that the actual backup process is working reason being is you can't just simply have a set and forget process you can't just simply set up a job like this and assume that everything's going to be Ticky Boo and everything's going to work you'll be able to restore your actual virtual machines if things go wrong reason being is I've actually seen firsthand the consequences where somebody couldn't actually restore a computer and it it wasn't pretty to say the least in which case what you have to do is aside from setting up a job to regularly actually back up your computers you also have to regularly try restoring your actual computers as well just to make sure that everything does work as expected the only catch is you can't have two identical computers on the network at the same time they'll conflict with one another in which case what you want to do is to isolate any virtual machine for instance to a completely separate Network that way it can't talk to anything it can't interrupt anything you don't cause any problems and in the case of a hypervisor like this that's actually pretty simple to do so what we want to do is pick out the actual server and what we're going to do is to create an isolated Linux Bridge so we'll go to system then Network I'm going to create a Linux bridge I need to change the name I'm going to call this one bmbr 10 for example I'm not going to assign anything to it I'm just going to give it an actual com uh comment here I'm just going to call this backup testing and click create then click apply configuration so the idea is that this is a Linux brick Bridge normally there's nothing going to be attached to it the horse certainly isn't virtual machines aren't it's only going to be used purely for when we're doing actual testing of our backup so now that that's uh actually created what I want to do is let's see I want to do a test for um our computer here test one so in that case I've got to select that specific server because that's where we want to restore the virtual machine to I'm going to select my backup storage here uh it's going sort these out so I've got test one test two test three they're my virtual machines test one is the one we want I want the latest version so I'm going to select that specific file click on restore now because I'm doing a test I want to make it a bit easier to identify this so what I'm going to do is I'm going to call this one 80 uh 80000 because that one is 100 so I'm just going to call this 800 for the sake of argument you can use whatever numbering you like everything else I'm just going to leave as is I mean I could limit the bandwidth if there was a a potential I might cause problems on the network for example but everything else will leave as is because I want this virtual machine to come back exactly as the original so I'm then going to click on restore and then offer goes and starts to actually restore that virtual machine one key thing to point out though is that I definitely definitely don't want this set to actually start as soon as it's actually reloaded now this virtual machine has now been actually restored and because I've given it a higher number it goes right to the end of the list so this makes it easier for me to pick it out now before I do anything else I need to move this to a different network so I'm going to select that actual virtual machine uh then go to Hardware Now by default it's actually set to go to vmbr0 for the network so I need to select that edit that and I need to pick my isolated uh actual Linux Bridge so we put this into an isolated Network click look here and now when I actually start this up it's just going to be completely isolated from the rest of the network so it won't conflict with the original now in this case that one's turned off anyway but the key point is that I could have that one up and running and this one both at the same time because the original is on Bridge vmbr0 whereas our test one is on vm10 go back to the network as you see this is completely isolated um like I point out the actual host itself doesn't even have connection to the bridge and there'll be nothing else getting used on there except when we're doing these um recovery tests uh for our actual virtual machines just to make sure that the files work that the actual backup process works so the only thing that would be left to do is to basically spin the actual computer up just to make sure that it does actually work the only thing you have to bear in mind is that well because it's actually isolated in this case if we had a computer that needed authentication through active directory for instance well that wouldn't be possible because there's no way out of that specific Bridge there's no way for it to talk to an active directly server for instance but the key point is I'm not really bothered about that I just want this computer to literally spin up um just for the sake of being able to check that the actual uh files and everything are intact as long as it boots up and I can at least log in locally then we should be pretty much fine and I'm I'll have the confidence to know that that backup process is working because it's backing everything up to the Nas and I'm actually being able to actually then restore it from the nas intact and it still works uh once it's back up and running so relatively straightforward process I mean once it's finished we could log in and as I saying test it but the key thing is once we're finished finished what I would then do is literally power it off and actually delete the virtual machine because it has no other further purpose really it's just there to exist purely for the purpose of testing uh the actual backup uh process but it's booted up so as far as things go it seem pretty much fine so relatively straightforward to do now one of the useful features that you get with this proxmox V backup solution is actually being able to manage your actual backup files so if we pick out one of the servers and then go to our backup storage what we've got is a an actual series of files here now the backup job that we're running does actually do some pruning in other words it's only going to keep a certain number of files but circumstances change and you can actually manage these files manually if you particularly want or need to and what you can do as an example is we can pick out one of the files here then click on remove to actually delete that file for it does come with an actual confirmation check there but the thing is you can't actually select multiple files it's a a one-off process I've got to delete each file individually unless that is what you do is pick a file and select the prune option here so it's prune group premu and then it's got the actual ID for that specific virtual machine if I click on that uh although we've got a pruning schedule that's set up within the job itself I can actually make some alterations here that way I can actually tell it to only keep a certain number of files so for example I could tell it only keep the last file and as you can see it's going to delete that specific file there um I could tell it to keep the last daily one well those both done on the same day in which case it's going to delete that one the last weekly one well those are both been done within the same week and so on so that is a way to actually um um remove other files um rather than having to go through them each individually I suppose so it is quite useful especially as you know if the backup process changes maybe you're you're running out of dis space and you only want to keep a certain number of files and to try and recover some of your uh storage capacity um another useful thing you get out of this is that if I pick a file here and click on sure configuration it actually comes back and gives me quite a bit of useful information about the virtual machine it's uh itself uh so that's definitely useful to have and then one other thing that you get with this is the ability to actually change the note now each of these backup files has got a note attached to it and at the moment what they're showing is the actual name of the actual virtual machine now that was defined as part of the actual backup process within the actual backup job by default all it puts in there is the actual name of the virtual machine but you can edit this afterwards as well for instance if you click on edit notes you can put in a specific note there bear in mind that the actual backup job itself has a template so this is an actual specific um note you'd literally type it in as is so you could put extra information in there if you wanted to but the trouble is again you can't select multiple files which is a bit of a pain you'd have to do that for each individual file now one other thing I'll point out is this rather useful feature here change protection now St it doesn't seem all that intuitive to me and I I was clicking this and clicking it again and I honestly I thought nothing was happening but it's a bit deceptive because right over here there's a column with a little Shield against it so what this is for is to actually protect a file from being pruned so maybe there's a specific file or series of files for instance that you want to keep and you want to make sure that they don't get pruned because that pruning process is automatic it's part of the actual backup job but what you can do is you can override that with this change protection option so I can pick a file click on change protection but you see you just get a sudden flash um as I said that kind of threw me but and wasn't until I noticed the little Shield pops up so now that that file is actually protected um from being pruned if I click it again you get the little flash but then the actual Shield disappears so that's a good way to actually protect backups cuz sometimes that there's something you actually need to do but it's a very use way to actually keep your actual files because I say you could R into a situation all of a sudden just can't back anything up because you you just don't have enough storage capacity for example so this is a relatively easy way rather than going to say like the nas for example and deleting files through that you got a bit more um control especially with that prune option for example to decide what does uh actually get removed so yeah definitely useful feature as far as VM backup Solutions go I think this is pretty much all you really need need as long as you backup files then backed up to some other local storage such as an external drive and also the cloud for instance then this should cover you against most situations but as I've hinted that before the goal here isn't to backup data files though because a restore would take too long if you only want to recover the data what this backup solution is for is to cover you against a computer outage in other words the hardware the operating system and any applications installed out bear in mind though this doesn't offer a way to backup proxmox ve itself so do you regularly back up and restore your VMS and if so how do you do it let me know in the comments below now if you find this video to be useful then do consider subscribing to the channel as that really mean a lot to me but it's also a good indicator to let me know how videos like this are helpful to people such as yourselves that are watching in which case thank you on the other hand if not ready for that level of commitment then I'd really appreciate it if you could press the like button because that way that'll help to get the video out to other people that might find it useful as well
Info
Channel: Tech Tutorials - David McKone
Views: 1,884
Rating: undefined out of 5
Keywords: proxmox backup vm, proxmox backup and restore vm, proxmox backup to truenas, proxmox backup to nfs, proxmox backup to smb, how to backup vm in proxmox, how to backup proxmox vms
Id: hvnuRmroBaE
Channel Id: undefined
Length: 37min 17sec (2237 seconds)
Published: Wed Nov 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.