Tuesday Tech Tip - Migrating Virtual Machines from VMWare to Proxmox

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello 45 drives subscribers so it's been a long time since i've been here so we've got a lot of new faces i'm sure i'm mitch and i'm going to be doing a tech tip today so what i'm going to be talking about is and actually the tutorial i'm going to be showing is migrating vm disks or your vms altogether off of something like vmware over to something a little more open source and open in general we love proxmox so that's the one i'm going to use but this should really work with any kvm based hypervisor so let's jump into it okay so before i actually get into the tutorial itself i want to talk a little bit about vmware or esxi and proxmox or kvm and what the difference in subtleties really actually mean so there's things called hypervisors which allows you to essentially virtualize hardware on a single machine so it allows you to create multiple virtual machines on a single server to give you a lot of flexibility and more usability in your hardware rather than have to deploy single bare metal servers for every single application that you have so vmware uh uses its own type one hypervisor which means it's a bare metal hypervisor and that's called esxi now as you may know it's very proprietary in nature it's locked down they do have a free version but it's you're not going to get the whole feature set by going down the free route so it's very expensive and now while it is expensive there is lots of features that come with vmware and i'm not here to say that running a free roll your own kvm solution will compete with all those features but there is a lot of functionality that comes with even the free open source version of of kvm depending on how you're using it so we got esxi like i said which is their type one hypervisor and then we've got kvm what kvm is is it takes the linux kernel and it turns it into a type 1 hypervisor so it's kvm is literally kernel virtual machine so what kvm allows you to do is again take that kernel use it as a hypervisor virtualize on it but then there's other flavors that have built on top of that to allow you to achieve this so yeah we have that kvm which which is literally taking the linux kernel and allowing you to virtualize on it but then there's some tools that make that a lot easier right so you're not actually in the command line banging away creating these vms so there's lots of flavors of this the one that we really love here is called proxmox we use it internally for our lab setup and also we deploy it for certain customers that are looking for a simple easy to use hypervisor so with that being said this tutorial is going to use proxmox but like it should work like i said on others as well another that we've used internally is overt which is really cool as well now the big thing about proxmox that's a little different from overt is proxmox virtual environment deploys directly on the server that you're running your kvm on whereas overt allows you to separate the two so you can have a lightweight machine that's managing just the interface the user interface itself and then you leave the the actual machines to do the kvm so proxmox like i said it's all built into one you spin up the actual kvm the proxmox server and you've got a self-contained virtualization layer so both of these offer lots of virtualization they both offer containers as well which is another really cool thing and so i'm not really going to go more deep into the feature set and all of that but what i do want to talk about is for the people out there that may have been on vmware for a really long time and may be interested in and trying something else but they want to take their vms with them so this is going to be a tutorial using if you've got iscsi mapped into your vmware environment or your esxi environment or maybe nfs which is a lot easier mind you we'll take those and we'll show how to map those into a debian based proxbox machine and then convert those vmdk images which are the actual disks themselves into a raw format that proxmox can use to create vms and use vm so let's jump on over and let's get started all right guys so now we're into our vsphere environment here as we can see we've got a three node vsphere cluster up these are all esxi hosts so there's two main ways that vmware or esxi consumes network storage one of those is nfs which is very simple and the other one is through iscsi nfs is much simpler because there's already a file system there and all vmware is essentially doing is when you create a new image or a new block device for a machine it's just creating a new vmdk file on that nfs data store with iscsi it's going to be a little more complex to move it over to proxmox and the reason why is because vmware has its own file system it's called vmfs and when you pass through an iscsi disk to vmware it puts its own vmfs on there so we're going to have to find a way to have linux read that file system so let's get into it here and let's take a look at our data stores so we can see here we've got a number of different data stores this is a test environment so we've got lots of things going on all the time we can see we have a vmware data store here and if we look this is an nfs data store and then we've got some other which are actually pedisand so we'll head up back over here and take a look just so you get a good understanding on this entire environment so this is a pedestal cluster that is acting as backing storage for our vsphere cluster so we've got a number of iscsi luns that are then passed over into the vmware environment and used for images for disks so that gives you an overview of how all this is laid out and what we're doing today is we are taking our proxmox server that we also are hosting and we're moving some of the vm images from vmware to proxmox let's hop on over to proxbox okay so now we see we have our our proxmox server up this is not a cluster environment because this is just for a test we're going to show how this all works so if we take a look at our storage here we have some zfs storage and we actually have some ceph storage as well so we've got another ceph cluster that is not pedesan but is typical red hat cef that is running for storage for this pedestal node or sorry for this proxmox node so we're going to show both we're going to show the way to take some of these disks from vmware and convert them into vmware using both zfs as well as rbd with ceph so let's get started so first one we're going to start with nfs because it is very very simple all we're going to have to do is take that nfs export and mount it onto our proxmox machine so first let's make a directory where we're going to mount it and now let's mount it we can see we have an nfs export mounted here so now if we go into there we can see we have one vm disk on this so let's move into there and now we can see we have two images two vmdk files in this directory so if we get a look at how large these are we can see that the vm vcenter windows vm flat is the larger file it's 32 gigs so this is the one that we are actually going to convert on this proxmox machine to be able to be used within proxmox itself but before we actually go and convert this one let's also get the iscsi layer ready as well and get the iscsi disk mounted into our machine and get that vmdk ready to go so for this instance i'm actually going to use a jump server because the network that the iscsi is running on is a subnet that the proxmox machine cannot communicate to so we have to use the intermediary and then we can move that vmdk over to proxmox so the first thing we're going to do is we're going to discover that iscsi disk so let's run this command and as we see here we did a discovery on this ip address where iscsi is being hosted we see we have one actual disk or one iqn here that we're hosting that from so we're going to map this to this machine [Music] okay so what we did here essentially is we used the iscsi tool to take that target name that we found and we used the ip address for the portal and we attempted to log in now this iscsi disk has no chat authentication associated with it so there's no password there's no authentication anyone can log in and mount this disk and as we see that's exactly what happened so we can see now that that disk has been successfully mounted to this machine so now if we run a ls block command we can actually see we have sda and sda1 which was not there prior so now we have to actually mount the file system that belongs on this disk so as i touched on earlier vmware uses vm fs which is its own file system that is not native to a regular linux environment so what you're going to have to do is install a tool to mount this file system in user space so since we're using vmfs 6 we have to use that specific tool so i've already got it installed on this but let's just run it anyway so you can see the command you would use so app install the mfs six slash dash tools now we can see that it's already the newest version and it's already installed now keep this in mind if you were running this command on your actual proxmox node most likely it's not going to find it because the repository is not actually pointing to that so what i'll do is i'll in the description down below i'll uh link to a mirror where you can actually download this tool directly from the website and then you can pull it down directly onto a proxmox node if that's something you want to do so now that we've installed our vmfs6 tools we can actually now mount this iscsi disk with vmfs that belongs that is actually on it so let's do that right now first we're going to make a new directory we'll just call it temp fs and now we're actually going to run the vm fs6 fuse command and dev sda1 which is where the actual partition lives and now our new directory and there we go so we can see quickly that it actually works so it it immediately realized that this is vmfs version 6 and it mounted that so now if we take a look at our mount points here we can now see that we have a fuse mount of mount slash temp fs so let's go into there and let's clear our screen for a second here and now we can see we have another windows machine this one is called wind test so let's cd into that directory and we can again see two vmdk files one is flat which is the full size which is the one we actually want to pull and that's what we're going to grab so now if this was a actual uh scenario what i would then do is i would do a secure copy of this file over to my proxmox machine but in the interest of time i've actually done that already so let's just go and take a look so if we take a look at our root directory we have that file here wind test flat vmdk i even took both of them over so let's get to the next step all right so now we've got everything ready to go now we're actually going to take these vmdks and we're going to transfer them over into a raw format that proxmox can actually use to mount onto a windows machine so let's hop over to our proxbox machine and take a look at our vms so we can see here we've got a number of vms already created here so if this was an operating system drive and you wanted to create a whole new vm for this you could do that but since the drives that i've actually moved over these vmdks they are not the operating system drives they're just like a d drive or a secondary drive so you can actually use those and mount them to an already created windows machine so that's what we're going to do so we can see we've got windows 10-1 here and if we come over to the hardware it's already got a few disks but we're going to add a new disk to this machine which is the one that we pulled from our vmware environment now before we do that the last thing i want to show is if we take a look again at our server and our data center and our storage we've got zfs and we've got some rbd so i can convert that vmdk file into a z-vol if i would like to using our zfs pool or i can convert it to an rbd using a rbd pool here that we've got and so i'm actually going to do both just to show you how the command is slightly different but really all you need is the id of either storage tier and you can make it work for yourself okay so here we're ready to go we have our vmdk we have the vm that we want to pull it from or pull it to sorry we have we can see here it's vm102 and that is also important we need to know the actual id of the vm that we want to mount this on and we also need to know the id of the storage so with those things we can start so the first thing we're going to do is a qm import disk then we select the id of the vm we want to add it to then we give it the name and now we give it the storage id so the first one we'll do is zfs so we're going to create a new zval zfs1 and then we do a dash format and we choose raw now we can see that it has now imported that disk over to our 102 vm so let's get a look now we can see we have an unused disk that is now showing up within our windows vm here and so all we have to do now to add this back in is to simply hit edit and decide what type of bus you want to use so let's just use scuzzy and let's take that image and map it to this windows machine and it's as simple as that all right so here we go so now that the disk is now plugged in and mapped to this machine let's actually take a look at our windows machine and make sure that everything worked correctly and if it did work correctly we should see the same files that i was seeing on my vmware side moved over onto this disk on our proxmox windows vm so if we bring on over here i can see that we've got our disk here so let's online it and let's take a look what is in that folder all right so we've got our test docs that i created prior and there we go if you're reading this from within proxmox vm you deserve a prize so i guess that means that it worked out correctly all right so that that about sums up this guide here we've got our disk mapped into our windows machine from within our proxmox server so everything seems to have worked as it should so hopefully this helps some of you out there that might be looking to do some migration or even just do some learning on something a little more open a little less expensive for running a large deployment and so i hope you guys enjoyed it all right so that about wraps up our tutorial here today so before i finish up what i'm also going to do is i'm going to link a knowledge base article that i wrote in the description down below that'll allow you to really follow along step by step if you want to do this maybe in your home lab or a home setup that you have so please check that out if it's interesting to you otherwise thanks for watching guys and we'll see on the next one [Music] you
Info
Channel: 45Drives
Views: 22,683
Rating: undefined out of 5
Keywords: 45drives, 45 drives, storinator, stornado, storage server, server storage, storage nas, nas storage, network attached storage, virtual machines, proxmox
Id: RaXHyxaD2eo
Channel Id: undefined
Length: 17min 25sec (1045 seconds)
Published: Tue Apr 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.