RHEV: How to Import a VMware ESXi OVA Disk Image into RHEV-M

424782-cloud-computing

Introduction

In my lab, I am in the process of moving off of Vmware/ESXi and onto RHEV (Red Hat Enterprise Virtualization). So far the learning curve has not been that bad….

Installing and configuring RHEV-M was just as simple as installing a few packages on top of RHEL 6. I had an unused desktop that was more than up for the task.  For RHEV-H… Well I had just finished building out a new server for it. Once my initial hardware was up and running it was time to start moving virtual machines out of Vsphere.

Virt-V2V Conversion Failures

And this is when I started to run into trouble. Using virt-v2v, the process was simple for existing RHEL vms. I imported a couple of them without issue.

However, I ran into a few issues when I started trying to import non RHEL VMs. In particular, my OpenVPN appliance running Ubuntu was putting up a good fight.

virt-v2v: error: virt-v2v is unable to convert this guest type
(linux/ubuntu)
If reporting bugs, run virt-v2v with debugging enabled and include the
complete output:

Ok, very unexpected – so lets try another approach.

OVA Import Failures

This time I decided to attempt to export the VM as on OVA file. However this did not work either as the OVA file was not recognized as a gzip file by the rhevm-image-uploader (run from the RHEVM server).

# rhevm-image-uploader -e pandora-export-vol01 upload vpn.lab.localdomain.ova
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to abort):
ERROR: not a gzip file

The Workaround

However not all was lost, as I was able to leverage the exported VM files to convert the the VMDK of my vm to img format.

#qemu-img convert -f vmdk vpn.lab.localdomain-disk1.vmdk -O raw vpn.lab.localdomain-disk1.img

Once the disk was successfully converted, I used qemu-info to verify its size.

# qemu-img info vpn.lab.localdomain-disk1.img
image: vpn.lab.localdomain-disk1.img
file format: raw
virtual size: 8.0G (8589934592 bytes)
disk size: 2.8G

I then logged into RHEV and created a new virtual machine which I named vpn.lab.localdomain. For all intents and purposes, it is just a placeholder VM with an empty 8GB disk.

Then using rhevm-shell ran the following command to get a list of existing vms and their disks.

[RHEVM shell (connected)]# list vms

id : 93a873a0-2fc2-4d73-952e-58e934d7ecea
name : vpn.lab.localdomain

[RHEVM shell (connected)]# list disks

id : d239f1c7-4fab-43fd-a7e9-ff5add0d53de
name : vpn.lab.localdomain_Disk1

I knew that the disk image for vpn.lab.localdomain was housed on the NFS mount below. All I needed was the UUID of the disk.

# showmount -e freenas
Export list for freenas:
/mnt/freenas-vol01 192.168.0.0,10.1.0.0

So I mounted the NFS share on my RHEVM server as /freenas-vol01

# mount -t nfs freenas.lab.localdomain:/mnt/freenas-vol-1 /mnt

I then navigated /freenas-vol01/4f46e5ca-a417-45d7-9dbf-2d400207fdaa/images and looked for a directory with this name (d239f1c7-4fab-43fd-a7e9-ff5add0d53de). Note that this is the same name as the UUID that I found a few steps above.

Note: It’s the second one in the list.

# ls -rlt
drwxr-xr-x. 2 vdsm kvm 5 Sep 14 12:39 aa1c9b26-00f0-45b0-9cca-224339448347
drwxr-xr-x. 2 vdsm kvm 5 Sep 14 12:45 d239f1c7-4fab-43fd-a7e9-ff5add0d53de
drwxr-xr-x. 2 vdsm kvm 5 Sep 14 13:53 021227e4-bb19-4747-a7a9-e522402fa6fa
drwxr-xr-x. 2 vdsm kvm 5 Sep 14 13:53 390298bc-94f0-477a-b437-5898e3f664be

Now cd to d239f1c7-4fab-43fd-a7e9-ff5add0d53de and inspect its contents

# ls -rlt
total 949342
-rw-r–rw-. 1 vdsm kvm 321 Sep 14 12:45 a50ce217-5c51-4f89-afe3-2c650a21c3b0.meta
-rw-rw-rw-. 1 vdsm kvm 1048576 Sep 14 12:45 a50ce217-5c51-4f89-afe3-2c650a21c3b0.lease
-rw-rw-rw-. 1 vdsm kvm 8589934592 Sep 14 16:44 a50ce217-5c51-4f89-afe3-2c650a21c3b0

There are three files here, but only one is 8Gb in size, which is not coincidentally the same size of the disk I created. This is the new empty disk on our new vm.

Now lets dd or original disk onto this disk. This overwrites the contents of the new disk, with the contents of the original disk.

#dd if=/root/vpn.lab.localdomain-disk1.img of=a50ce217-5c51-4f89-afe3-2c650a21c3b0 bs=4M

Much to my surprise I was able to boot up the vm without issue.

Vmware CapacityIQ Unregister a Vcenter Server via the CLI

Vmware-logoOk two in a row, now thats strange. Anyway.. I was working on a rebuild and re-ip of my Vcenter Server as I was in the process of changing over to the Vcenter appliance, when i realized that I was going to have to lay hands on a lot of tools and change them to point/connect to my new Vcenter Server instance. Anyway. I started of with VCOPS, and I was surprisingly sucessful. So I figured I would move on to Capacity IQ.

Again, being the Linux guy that I am, I hit up the cli and stated fiddling around. I stumbled across the ciq-admin command and was able to find the following

[ciqadmin@ciq ~]$ ciq-admin register status
vCenter Server Registration Status = Registered
vCenter Server address             = https://vc00.lab.localdomain/sdk
vCenter Server user                = LAB\user

 

Hey ok, that looks good so far. Lets see if we can unregister.

[ciqadmin@ciq ~]$ ciq-admin unregister
Connection to VC failed. Disconnected CIQ, but could not remove CIQ extension from VC.

 

Well crap, you will never be able to connect to my original Vcenter Server… it's dead and its not coming back. Luckily it appears that we can force the registration of a new Vcenter Server

[ciqadmin@ciq ~]$ ciq-admin  register –vc-server vc01.lab.localdomain –force  –user root –password mypasswd
Stopping CIQ :                                             [  OK  ]
Starting CIQ :                                             [  OK  ]
ciq-watchdog is now enabled

 

Now head back on over and get a gander at the webUI. Still shows the old Vcenter Server? Just logout and log back in again and life should be good.

 

Related articles

Vmware VCenter Virtual Appliance – Death to Windows.. I think.
ESX 5: How to Power On A Virtual Machine from the Command Line
VMware vCenter Operations Manager Essentials – Introduction to vCenter Operations Manager
vCenter Operations Manager: VMware's move into cloud monitoring?

Vmware Vcenter Operations Manager Unregister a Vcenter Server via the CLI

Vmware-workstation-17-535x535So my Windows based Vmware Vcenter Server went belly up again. Something to do with the SSO database not starting. Not being a lover of Windows I decided to give the Vcenter Server Appliance a shot. Install was great and I am kicking myself a bit as to why I spent so much time fighting with Windows. My new Vcenter Server, which has a different IP address then the original Windows box (might make a great Veeam server) was not registered with Vcenter Operations Manager. I was not prepared to reinstall that thing again. So I needed to figure out how to manually unregister a Vcenter instance and add register another one in its place.

Since VCOPs runs Linux, I decided to ssh into the server and see if I could figure it out. First thing I found that I needed to do was figure out the registered Vcenter Server name and Vcenter Name (whatever that's supposed to be) I was able to do this using the vcops-admin command.

admin@vcops:~> vcops-admin summary

 

This command output a bunch of stuff, but the important bits for this task are below.

Registration Details
——————–
vCenter Server address  = https://vc00.lab.localdomain/sdk
vCenter Server name = Lab Vcenter

 

So now we need to unregister the sucker above. Note that this command takes a bit to unregister

admin@vcops:~> vcops-admin unregister –vc-name Lab\ Vcenter –vc-server https://vc00.lab.localdomain/sdk –user LAB\\userid –password mypassword–force

vCenter Server unregister = success

 

So flip on over to your browser and log in. The unregister process will cause the webUI to reload, so if you were already logged in you will find that you still need to log in again.

Now you can register your new Vcenter Server via the webUI.

Related articles

Vmware VCenter Virtual Appliance – Death to Windows.. I think.
ESX 5: How to Power On A Virtual Machine from the Command Line
vCenter Operations Manager: VMware's move into cloud monitoring?
VCOPs – VMware's Move into Cloud Monitoring

ESX 5: How to Power On A Virtual Machine from the Command Line

Avengers_lego___captain_america_by_robking21-d4wjhwtSo lately I have been noticing some strange issues with my home lab. Every so often I find my all my virtuall machines are down, however the ESX box is up and running fine. Checking the logs on the ESX server has not helped me get to the bottom of the issue, rather I can just see the messages that the server has rebooted. So at the very least I know that something is happening to the ESX server causing it to crash.

This morning I happned to get lucky as I was sitting in my office when the basement airconditioner turned on around the same time that the whole home dehumidifier kicked on. Bleep when all my UPSs, and then I heard my ESX server power off and power back on again.

So now I am on a mission to figure out how to get my ESX server and my UPS to communicate so i can get at least 30 seconds of power during brownout. However this is an issue for another day, right now I just need to get my Vcenter Server back up and running, however my challenge is how to do so despite the fact that I do not have a Windows machine that I can use to connect directly to my ESX server via Vcenter Client.

Thanfully I can power up my Virtual Machines on the Command Line Via SSH. First step is to log into the ESX Server and get a list of all the Virtual Machines that are currently registerd on it. You can do this using the command below.

 

 # vim-cmd vmsvc-getallvms

Now that I have a list of all my registered Virtual Machines, I need to check its current power state and ensure that it is in fact powered off.

~ # vim-cmd vmsvc/power.getstate 1
Retrieved runtime info
Powered off

Yup – its down. Now lets power it back on.

~ # vim-cmd vmsvc/power.on 1
Powering on VM:
~ #

Now wait a minute or so to allow the Virtual Machine time to boot… Now I should be able to RDP from my Linux Workstation to the Vcenter Server. No extra Windows Workstations needed.

Related articles

Vmware VCenter Virtual Appliance – Death to Windows.. I think.
HomeLab: Simple DHCP Service Configuration on a Cisco Router
NEW VMSA-2013-0016 VMware ESXi and ESX unauthorized file access through vCenter Server and ESX
Anonymous leaks VMware ESX Server Kernel source code

Vmware VCenter Virtual Appliance – Death to Windows.. I think.

6a00d8341c77ee53ef01630028e663970dI am, and have always been, a Linux/Unix Administrator, until VMware forced me to learn a bit of Windows.

This, above all, has been the very WORST part about Vmware. Just to run Virtual Center, I had to BUY Windows, I had to Install Windows, and I had to try to learn Windows.  Oh, and then I had to slap some sort of virus protection on it, and figure out how to patch it. And then worst of all try to authenciate to it, as I am not administering Active Directory. No, I use Openldap, as any Linux/Unix admin would.

Then on top of that I needed Windows to even run the VCenter Client and Connect to my VCenter Server.  Well hell, I don't run Windows, not even on my desktop, not even on my laptop… not at home and not in the office. Its been this way for 5 years and VMware, is not going to make me change this.

Now, flash forward to VSphere 5.1, and low and behold, what is this. A real, fully functioning, web client for VCenter. Ok now we are getting somewhere. Now, I have not had a ton of experience with it, but my first impressions are pretty good. Its flashy, its fast, and it appears to be fully functioning.

To further make my day, the Vmware VCenter Appliance is now no longer beta (this is probably old news to most). For those who are not in the know, its Linux (albeit Suse).  So I am downloading it now and am going to give it a spin. How fully functioning is it… I have no idea. Do I need a database somewhere or does it have one built in? I do know it can connect to oracle, which is really neat, but not as neat as postgres or mysql. Also, how awesome would it be if I could configure the thing to use Openldap for auth?

Dunno all the answers yet, but I should have more insight on the topic soon, so stand by.

 

Related articles

vCenter Server 5: Important Tip while Installation

XenServer 6: There Was an Error Connecting to the Server. The Service Did Not Reply Properly

GoombaWow, this is a really overly complicated error for such a simple problem to resolve. Allow me to give you some background.

I am currently building my first production ready (well non-production really) XenServer cluster and ran into this issue when attempting to add my second host into the cluster. I hit google and found out that this was actually just a dns issue.

A quick check on the /etc/resolv.conf on two of my nodes, shows nothing but the following line.

; generated by /etc/sysconfig/network-scripts/ifup-post

Well great, on a standard linux box I would have just added my name server and would have been half way to the bar, but judging by the contents of the resolv.conf I figured that I was supposed to add it another way.

Well after a bit of poking around in XenCenter I found this. Click on the hostname of the XenServer, then click on the "Networking" tab, from there click on "Configure…" below the "Management Interfaces" section as illustrated below. You will then be presented with a pop-up window where you can enter your nameservers.

Screenshot4
Once you have configured DNS properly you can then add the host to the cluster.

Note that you can also do this from the command line, however you have to go basically reconfigure your management interface.. ip, gateway, and everything that goes with it.

First run the command below

#xe pif-list host-name-label=xen01 management=true

Then using the UUID of the management interface, run the command below. Replace my IP addresses and uuid with yours.

#xe pif-reconfigure-ip mode=static IP=10.120.72.11 uuid=dc6b6651-6067-9a52-2011-6ba102da39e1 DNS=10.120.69.1 netmask=255.255.255.0 gateway=10.120.72.1

Seeing how fickle XenServer Clustering is regarding DNS, its probably not a bad idea to add /etc/host entries on your XenServer nodes for each server that will be in your cluster.  You never know when dns might go out to lunch and you don't want your HA cluster affected.

For future reference you can check all the configuration parameters of your management interface with the following commands.

First get the UUID of your management interface.

xe pif-list management=true host-name-label=xen01

Then check the configuration via the UUID.

xe pif-param-list uuid=f61b8d4d-67ec-e262-3e16-4348baaed076

And for example if you need to configure the DNS search domain, you can run the following.

xe pif-param set uuid=f61b8d4d-67ec-e262-3e16-4348baaed076 other-config:domain=MYDOMAIN

How to Use Hpacucli in ESXi

Miracle_WhipWow just stumbled into this one today as I was dreading having to reboot my ESXi 4.1 boxes just to see a few new local disks.

Apparently you can install hpacucli in ESXi very easily, and whats even better is that you can install it directly on a datastore and use the install on any host that has access to that datastore. No need to reinstall on each and every host in your cluster. No need to reboot to configure your disks.

Anyway here is the link to the how to, its obviously written by a Windows Guy, but it works easy enough.

http://v-front.blogspot.com/2012/03/how-to-run-hp-online-acu-cli-for-linux.html

 

Update: Apparently HP now provides an official version of hpacucli for ESXi 5 as part of HP ESXi Utilities Offline Bundle for VMware ESXi 5.0.

Also note that I found that my HP servers with the P400 card did not detect the new logical drives, even after a rescan. Apparently a reboot is required. However my HP boxes with the P410 card did detect the new logical drives after a rescan and no reboot was required.