Tuesday Tech Tip - Using OVF to Migrate Virtual Machines from ESXi to Proxmox

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome back to another tech tip here 45 drives so today I'm going to be going back actually to a video that I did quite a while back and it was called migrating virtual machines uh from esxi to proxmox and I've always wanted to do a follow-up video to that because I feel like I could have done a better job explaining not how just to migrate disks from one VM on esxi to another VM on proxbox but to actually how to fully migrate a full virtual machine from one hypervisor to another and then also what you want to do if you want to let's say decommission an esxi server and fully migrate everything over to proxbox so this video is going to go a little more in depth on that and the process and how you'll do it [Music] foreign [Music] so today I am going to do a demo and we're going to show this off in real time but before I do that I just want to talk about kind of what it is I will be showing off so thankfully at some point I'm not exactly sure when esxi adopted the ovf format or the open virtualization format which is an open source framework for virtual machines and so there's actually a tool that esxi has up on on the web or sorry VMware has up on their website that you can grab for Windows or Linux or other environments and so that's the ovf tool and what that allows you to do is to from your proxbox server actually connect to an esxi server and pull down the entire disk format of all of your of your VM and also the ovf file itself and what that is is a manifest file that manifest file contains things like the CPU cores of your VM the memory the network configuration and things like that and that's really the magic part that's what's going to allow you to essentially in a single command migrate a full V M from esxi over to a proxmox environment and proxmox is going to know exactly what to do with that file and how to provision a virtual machine with the same specs as the original VM so that's what we're going to show off today and so without further Ado let's head on over to my desk and we'll jump into it right now all right so now that I'm back to my desk we are going to run through the full migration so I'm going to show off two methods like I mentioned first is if you need to migrate a single virtual machine from a esxi environment over to a proxbox environment this is really good and ideal if you still intend to have both environments up and and you're not going to get rid of any of these environments but you just have to migrate a VM or want to migrate a VM for one purpose or another into the other hypervisor and to do it very very quickly and efficiently the second method is going to be showing the best way to do this if you plan to decommission your actual esxi server so that's getting all the virtual machines that might be on that host migrated over to proxbox in the fastest and most efficient way possible and so for the majority of this we're going to use the ovf tool which is a really cool tool esxi has has adopted the ovf format the open virtualization format which is really nice to see because it is an open source standard and so that tool that we're going to be using can be found here it'll be in the link in the description if you want to download it to test us for yourself but that's going to be the tool we're going to be using from our proxbox server so we first have to download it to our proxbox server and make it executable so we can run it and that's where we're going to be running our commands from so with that being said let's just set the stage here so I have a proxbox or sorry I have a esxi host here I've got an Ubuntu VM I'm just going to run it and very quickly to make sure and show that it's working as intended and what we're going to do is we're going to move this guy over to proxmox and bring him up over there with as fewer steps as possible to make it as easy as possible all right here we go it's up now let me just log in there we go so we know we're up now I'm going to shut this down and we are now going to migrate this guy over to our proxbox host first we wait for it to come down and let me bring up our steps here just to show off so first thing we're going to do is we're going to download and install our ovf Tool uh from VMware so I've already done that but I'm just going to run through the the process of it we'll go through the process of making executable and actually running it and using it and installing it uh so here we go so our VM is Now offline so let's bring up our terminal here so this is our proxbox host so once you download this ovf tool you can grab it onto your proximos host anyway you may be able to curl it if you can get the download link here I just scp'd it from my Windows machine so we can see here VMware tools first thing you're going to do is you're just going to make it executable um see that I already have but once you make it executable it's as simple as doing a DOT slash in the tool that will install the actual ovf format tool and from there you'll be able to use ovf tool so with that being said let's move on so the syntax to actually migrate a VM over to this machine looks a little bit like this so you call the ovf tool you go by root for your esxi host the IP of the esxi server the name of the virtual machines and then the local dir that you're actually looking to migrate this to so this may take a little bit of time or a lot of time depending on how much data is in your VM and it is doing some actual conversion as well here too so I'm going to move it to a ZFS directory and let's run that right now so we can see now we're going to log into our esxi server so you use your root password mistake I already put that here so I'm just going to put it to a new place okay I'm going to throw it into ZFS one and a directory called new all right do that again all right so here we go so now it's writing the ovf package uh this is really cool because it's not only sending over the uh the disks themselves but it's writing sending over the ovf Manifest and that will give us you know the cores the CPU cores the memory all that type of stuff the network and it will allow proxmox to take all this information and immediately just provision a VM with the zigzag specs for us so this is going to take a little while unfortunately I'm stuck on a 100 megabit Network right now but once it completes we'll come back you know since I did this already off camera what I think I may do is just cancel this and we will continue from the one that's already been completed let's quickly do this and what I'm going to do is I'm going to go into zfs1 and unto our Ubuntu migrate that I sent over already so what you can see here is we have our Ubuntu migrate disk one vmdk we have our NV Ram dump we have our MF file and our ovf file so the ovf file is the one that we're really interested in here and we can also pull up our proxbox because this is pretty cool the way it does this all right so oops command we are going to run is as follows we can see here we've got ovf2 or sorry we've got uh qm import ovf we want the vmid that we want to give it so we can see we've got a whole lot of different VMS running right now but what I'm going to do is I'm going to give it the VM ID of 333 the Manifest is the actual ovf file it's going to tell proxbox everything it needs to note finally is the storage where you actually want to store this virtual machine so if we come up here to our storage here we can see we've got some we've got some RBD we have some ZFS we have some local and I'm going to put it on the RBD pool and we'll go from there so let's go back let's bring this up and let's run our qm import ovf and we want to go ZFS one Ubuntu migrate in that actual ovf file and then finally the storage where we want to store it let's run that command there we go it's starting to transfer the data over for us there we go we're at 100 this will probably hang for another few seconds but while we wait let's head on back to our esxi host and take a look at our specs so we can see this one had four vcpus got eight gigs of RAM it had a 16 gig disk and it had a regular network adapter so let's take a look back here and see if we're ready yet or if it's complete just a few more seconds go so it's now completed and there we go we can see our RBD is now in fact here so we've now migrated this from what was on NFS storage in our esxi server when we come over here we can see this was on a share here that is an NFS export and what we've now done is we've migrated that in to our proxmox environment we are just now being hosted on an RBD storage completely separate and actually a completely different cluster than what the esxi server is hosted on so there we go so now all we have left is let's try to start it up and there we go so let's try to log back in again just to make sure we're all good there we go it looks like it did not bring over our network interface however so that is something that we can add in ourselves however so let's go Network device and let's go to add there it is and so we can bring that up or we can just reboot and it will come up so that's that that's how we would bring a VM and migrate it over very very quickly very efficiently but what if you wanted what if you had you know dozens of VMS or or more and you're looking to decommission your esxi server and you want to bring everything over to a new proxbox server well there are a few ways you can do it um but really what we've just used is a really efficient way the only difference that I would recommend is that because we're decommissioning the esxi server it's best to try to mount that storage locally on the esxi server so the really cool thing about the ovf tool is it will actually let you actually bring this up it will actually let you send the information about the virtual machines without a disk so you can do a dash dash no disks input and what it will do is it will send over all of the Manifest data about each of your VMS so you could do this you know multiple times one for each via M but it won't actually send over the desk so it won't take a very very long time to migrate from one storage to the other especially if you want to potentially use the same storage so what you can do is you can run through and do an ovf tool same command that we ran before but with the no disk tab it will essentially instantly run take two seconds to send over that ovf file and then once you have all your VMS moved then it's as simple as okay now I'm going to actually Mount that NFS data store so the one that our esxi server is connected to right now this one right here you can actually Mount that because it's NFS of course you can mount that really anywhere so what we could do is we could mount it to the proxmox host once you have all your VMS ready to be migrated and then we can start individually importing all of those vmdks on the NFS share and actually if I show you right here so we can say for example I've already done this but if you take a look I've already mounted that NFS export the one that is on the esxi server I've mounted it in my proxbox host and so now I have access right locally to any and then we can go in there Mount you can see these are all of the VMS that we I've had now obviously not many here because it's just a test environment but if you had you know hundreds or dozens of them on here you would now have access to the actual and I'll go into here the vmdk for all of these VMS so once you run through the command of an ovf import and importing without disks now you have all of those manifest ready so you can start creating these essentially sparse VMS right what it will do is it will spin up VM without any hard disks because you're just essentially putting the ovf Manifest data about the VM itself once that's all moved over it's as easy as okay now I have all my VMS I have these sparse VMS with no disks in them now I can start importing these vmdks and even converting them into RBD or some other type of storage that you want to or if you don't want to move it to a different type of storage you can essentially just say okay well I don't want to move it onto RBD I'm happy with NFS storage but then what you would do is you would convert it right you would convert it from a vmdk to let's say a qcat 2 or or even a raw format and and I can kind of show you that here as well so for example once we ran through and and moved let's say created a manifest you could really just start importing the disk selecting the actual VM you want and then going through selecting the disk and then selecting where you want it which is really really nice um so yeah that's kind of two ways that you can migrate a virtual machine or multiple virtual machines into a proxbox server um I didn't cover iSCSI on this now iSCSI actually is a little different uh because you would actually have to install something called vmfs6 tools and that would let you physically mount a vmfs file system on your proxmox server which is pretty cool um and if anyone is interested and wants to see me take an iSCSI disk that let's say is mapped into esxi with a vmfs file system on it and multiple virtual machines on it and being able to migrate that into a proxbox server Mount that file system and be able to read those uh read those disks and be able to import those disks into virtual machines on proxmox it's definitely something I can do as well just let me know with that being said I think that covers everything I wanted to show all right so I'm back in the studio again just right after wrapping everything up um so yeah hopefully you enjoyed that you saw how easy it is once you kind of use the framework and the ovf tool to be able to migrate your virtual machines um maybe if anyone wants me to really go in depth on fully um scaling down an entire esxi server and migrating an entire thing over to proxbox and you want more in-depth detail on that let me know and I can definitely do that also I only showed NFS in this video right NFS is quite easy obviously to move between different environments so if you want to have a more in-depth video on how to take an iSCSI disk mount it into a proxbox environment and then actually using the vmfs6 tools being able to mount the vmfs file system let us know as well and we can kind of do another follow-up video with even more detail if that's something you're interested in so with that being said thanks for attending another one of our Tech tips and we'll see you next time foreign [Music]
Info
Channel: 45Drives
Views: 1,720
Rating: undefined out of 5
Keywords: 45drives, storinator, stornado, storage server, server storage, storage nas, nas storage, network attached storage, proxmox, virtual machines, esxi, migrating virtual machines
Id: 6jCEe4sfe_g
Channel Id: undefined
Length: 16min 55sec (1015 seconds)
Published: Tue Mar 28 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.