Rabu, 11 Maret 2020

VMWARE CONVERT-linux

How to Convert a Remote Physical Linux Server to a Virtual Machine (VMware / VirtualBox Instructions)

Recently I needed to convert my physical CentOS Linux 7.3 server to a virtual image that I can quickly run from either VMware Workstation Player or  VirtualBox (or keep as a backup that can be easily switched on as a copy of the physical server). I’ve kept searching the Internet, but only to find that the instructions were either too old or do not provide a proper step by step guide on how to go about this process. Thus the reason for this article, hopefully, it’ll help someone.

Requirements

  • Windows PC (I’ve used Windows 10 64bit) with enough resources (CPU/RAM/HDD) to create an image of your Linux PC or Linux Server
  • IP address and credentials for your Linux PC/Server
  • VMware Workstation 12.5 Player for Windows 64-bit
  • VMware vCenter Converter Standalone (free download)
  • VMware vSphere Hypervisor (ESXi ISO) image (Includes VMware Tools)

Quick Overview of the Process

The following steps will be taken to convert existing physical Linux server to a virtual image. We’ll first install VMware player onto which we’ll install ESXi image.
Then we’ll use VMware vCenter Converter and in it configure the access to our physical Linux server, as well as access to VMware vSphere Hypervisor (ESXi) server running virtually using VMware player.
Once done, the process of conversion from physical to virtual will start and finish, and I’ll show you how you can execute the newly created virtual image of your Linux server from VMware ESXi. I’ll also show you, how you can download the VMDK and OVH files (image of the Linux server) directly from ESXi, which can later be imported into VirtualBox if that your preferred way of running the virtual copy of the Linux server.

STEP BY STEP INSTRUCTIONS



INSTALL NECESSARY SOFTWARE

On your Windows machine, download and install following two software:
Then download the following:


INSTALL VMWARE VSPHERE HYPERVISOR

As a next step, we’ll need to open VMware Workstation Player for Windows 12.5 and install VMware vSphere Hypervisor (ESXi) on it.
This is a tricky part to understand, but the whole purpose of installing ESXi is that it’s a requirement of VMware vCenter Converter (which converts the physical server to virtual image).
VMware Converter doesn’t allow conversion of a physical server to image just like that, it needs a copy of ESXi server running somewhere, otherwise, it won’t work. Not everyone has ESXi running on the network, so to do that, we’ll try to virtualize ESXi server and run it on the same Windows computer, alongside the VMware converter.

The process is simple. Open VMware Workstation Player for Windows and click on Create a New Virtual Machine. Then select Installer disk image file (iso) option and point to where you’ve saved the copy of VMware-VMvisor-Installer-6.5.0-4564106.x86_64.iso (or newer) on your drive and press NEXT.
On the next screen, simply name your virtual machine and point to where you want to save the image of ESXi on your Windows hard drive:
The next step is crucial. You will need to specify the size of the drive. It’s important to remember, that it would be a bit larger (1 or 2 gigs at least) than the total space currently used by your Linux server. So if your Linux server takes let’s say 298 GB of space, make sure to specify disk capacity of at least 300 GB.
On the next screen, press Finish button and your Virtual Machine will be created.
You should see something like this when you’re done:
Highlight the VMware ESXi image and press the green Play button.
Once you start ESXi server, it’ll open in VMware player and the initial installation will begin.
You should first see ESXi installer loading, something like this:
Then the scheduler will initialize:
Eventually, all the ESXi installation services will start one by one:
Once done, VMware installer will open it’s configuration option, on the first screen just press Enter:
Then select the storage device, whatever drive capacity you’ve created earlier:
In the next step you will need to specify the root password for ESXi web management (make sure to mark it down somewhere, don’t lose it) and press ENTER:
In the next step, you will need to confirm the final installation process, so just press F11:
Then wait until ESXi installs, it will take a while, so get yourself a coffee :)
Once installed, press ENTER to reboot your virtual ESXi server:
This concludes the installation of ESXi in VMware player.
Once the server reboots in VMware player, you should see it running and see a screen similar to this one. Please note the url address on the first line in the middle of the screen (bottom section):
This is the URL we’ll need to connect to, using our browser, to make sure that ESXi is running. Your URL will be different from mine, but when you open it, you should see something like this:
Just enter the root as a username and for password use the password I’ve asked you to mark down in one of the earlier steps when we were configuring ESXi credentials.
Once logged in, you’ll see a screen similar to following, that confirms that everything is running as expected:
As you can see in the above image, ESXi is running fine, but no Virtual Machines are running in it.

——-
Note: Don’t try to install ESXi on VirtualBox. I’ve spent almost 90 minutes trying to do so, but experienced a bunch of errors and eventually gave up on it. I’ve experienced all kinds of issues during installation, errors such as:
  • No place on disk to dump data
  • No file configured to dump data
  • No vsan object configured to dump data
  • No port for remote debugger
The following screenshot shows the errors I was experiencing when trying to install ESXi onto VirtualBox:
Anyhow, I couldn’t get past these errors and decided to use VMware Workstation Player for Windows 12.5 instead, where I was able to install ESXi without any issues (as you could see above)
——-

USE VMWARE VCENTER CONVERTER TO CREATE AN IMAGE OF THE PHYSICAL LINUX SERVER

Now that we have the ESXi running, we need to open the VMware vCenter Converter Standalone.
To convert the physical Linux machine, you’ll need to press the Convert Machine button and then select Powered on Remote Linux Machine.
Of course, you will need to know your Linux server’s ip address and username credentials. Once filled in, it should look, something like this, just press the Next button.
BTW. You should be able to see some details of your Linux server, if you press the View Source Details, that tells you, that machine can be converted and it’s reachable.
The next step will ask you about your destination server. That’s the ESXi server we’ve installed earlier. Put in the details with which you’ve configured your ESXi server and make sure it’s running in the VMWARE Player (otherwise, this step will fail).
Ignore the certificate warnings:
The next step should look like this; it’ll show you the destination virtual machine name, the stuff that will be configured in ESXi:
It will also give you the option to save it to whatever ESXi datastore you may desire to have the Linux physical server saved into:
This is what it looks like when you change to a different datastore (virtual drive/partition where the image will reside):
Anyhow, once done, you’ll get an option to configure and adjust the VM that will become a clone of your physical server.
You can also remove volumes which you don’t want to clone, such as USB keys or remote drives.
And as the last step, you’ll see the summary of what is going to happen:

As soon as you press Next button, you will see that your physical server is being copied as a virtual machine over to ESXi server:
This process may appear stuck from time to time, like in above image, where it was sitting on 60% for 10 minutes. But be patient, it’ll eventually finish…


TEST YOUR VIRTUAL MACHINE (COPY OF THE PHYSICAL LINUX SERVER) IN ESXI

Once above process completes, open and login into ESXi. Under the Virtual Machines tab you will see the virtual clone of your server now:
You can click on it and power it on if you want. It will run.
This could as well be the end of this article, but if you want to go further, I’ll show you how you can export your server from ESXi in a format that is accepted by VirtualBox.

EXPORT YOUR VIRTUAL MACHINE (COPY OF THE PHYSICAL LINUX SERVER) FROM ESXI IN OVF AND VMDK FORMAT

If you want to download a copy of your physical server (now a virtual machine) from ESXi, you won’t do it by going into your VMWARE ESXi folder where all the vmdk files are:
Instead, you will need to login to ESXi and just put the checkmark beside your server (clone of your physical Linux machine) and then go to Actions tab and select Export:
You’ll get two prompts that will look like this:
And when you press ok, you will see that both files will start downloading to your Windows 10 desktop:
Once done, you’ll have both files in your download folder:

IMPORT YOUR VIRTUAL MACHINE IN OVF AND VMDK FORMAT INTO VIRTUALBOX:

If you’re not happy with running your server from ESXi and want to move to VirtualBox then this part is for you.
Make sure you’ve already exported VM from ESXi (using above steps) as ovf and vmdk files,
Then open VirtualBox and in the file menu select Import Virtual Appliance option. Then choose the OVF file you’ve exported earlier:
And follow these steps:
Press Import:
And wait for the machine to import into VirtualBox



IMPORT YOUR VIRTUAL MACHINE IN OVF AND VMDK FORMAT INTO VMWARE PLAYER:

If you’re not happy with running your server from ESXi and want to run your VM directly in the VMware Player, then this part is for you.
Make sure you’ve already exported VM from ESXi (using above steps) as ovf and vmdk files first.
Then go to VMware Player and select an option to Import the new Virtual Machine, point to your OVF file:
It will take some time, but you should see your machine importing:

CONVERT OVF AND VMDK FORMAT INTO OTHER FORMATS:

To do that, you’ll need to go into your VirtualBox folder and open the command prompt in there.
Just make sure that VBoxManage.exe is available in the folder:
This is the command to convert from raw VMDK disk to a normal VMDK:
the same command can be used to go from raw VMDK to VDI, then use something like this:

Anyhow, I hope this helped someone.

Tidak ada komentar:

Posting Komentar