Monday, October 13, 2008

VMware learned Hyper-V Quick Migration

Yes, the article headline is right. As you already know, there are a lot of discussions what is the difference between VMware VMotion and Microsoft Hyper-V Quick Migration. VMware VMotion is enterprise proven feature which allows to hot migrate a running virtual machine among ESX nodes forming a high availability cluster.

The Hyper-V Quick Migration is much simpler. It suspends the machine, cold migrate it (virtual machine saved state) to another host and unsuspend it. Do you understand the difference now? The Quick Migration requires some downtime depending on virtual machine state size - mainly size of memory.

But the reason I began to write the article is elsewhere. Mike DiPetrillo, a system engineer working for VMware, has coded a simple Powershell script which provides this feature to VMware VirtualCenter. The only prerequisite to use it is to install VMware Infrastructure toolkit for Windows. What does it mean for us? You don't have to pay for VMotion license and you can still quick migrate your virtual machines. Isn't the VMotion for "poor" cool tool? The script is published and described at Mike's blog.

Additionally, you can integrate the script into VirtualCenter with Icomasoft VI PowerScripter. The altered script compatible with VI PowerScripter is published at Icomasoft forum. Let's go to give it a try!


Tuesday, October 7, 2008

SLES10 update and SSL certificate problem

Have you ever needed to update some remote SLES10 system from your local update server (e.g. YUP server)? There may be many reasons for such situation. For example, the remote system can have unstable Internet connectivity to connect to the Novell servers or no connectivity at all with ability to see your local update server via VPN network only. You are able to imagine other situations, of course.

Let's suppose our update server is reachable from the remote locality via HTTPS protocol at URL https://update.domain.tld/path/. The update source is of YUM type and we want to update the system with the zypper command. At first, we need to subscribe to the update server. If the update server SSL certificate is subscribed by some well-known certification authority, then you don't have to worry. You can use the following command to add the update server to the update sources:
zypper subscribe https://update.domain.tld/path/update update
But if you generated your own certification authority or self-subscribed server certificate, then you may notice these errors:
Curl error for 'https://update.domain.tld/path/repodata/repomd.xml':
Error code:
Error message: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
The message is comprehensible and it says that the server certificate is untrusted and can't be verified by the known CA certificates. Simply said, the server certificate is subscribed by your untrusted certificate or it is self-signed. The message only warns you that there may be an attempt of man in the middle attack.

The curl application uses a CA bundle to verify server certificates. The bundle is typically stored in the /usr/share/curl/curl-ca-bundle.crt file. If you want to make your own CA certificate valid, then concat its PEM content to the end of the file like this:
cat ca.crt >> /usr/share/curl/curl-ca-bundle.crt
After this command, everything will begin to work and the update server URL will be added to the update sources.Then, the update may start:
zypper update
I didn't mention that you will have a similar problem if you use the rug command. If I apply the previous steps the rug command will produce an error about SSL certificate verification failure anyway. I suspect that rug doesn't use curl to access the update server. So, does anybody know how to resolve it in case of rug usage?

Wednesday, October 1, 2008

VCB basic usage - VM file-level backup with vcbMounter

The performance of full backup running over LAN network is not optimal because it requires to copy virtual machine disks locally. That may take some time. The usage of SAN or Hot-Add mode is far better in such situations.

The file-level backup is more suitable for LAN networks because it doesn't export any disks. It is able to mount the disk directly and you can access its filesystem without mountvm command like I described here. By the way, this holds for Windows OSes because VCB supports NTFS or FAT filesystems only.

Let's take our previous virtual machine vcb-backup and try to do file-level backup. We will use the same command but with different value of -t parameter:
vcbmounter -h VC_IP -u VC_USER -p VC_PASS -a name:vcb-backup
-r c:\mnt\vcb-backup -t file -m nbd
The virtual disk will be mounted under the C:\mnt\vcb-backup directory in LAN mode. The successful mounting will print the following messages (some lines may be split due to their length):
Opened disk: vpxa-nfc://[STORAGE] vcb-backup/vcb-backup.vmdk@\
VC_IP!52 79 b4 1a d5 0a 84 31-fd 1c e3 fe f8 31 db ed
Proceeding to analyze volumes
Done mounting
Volume 1 mounted at c:\mnt\vcb-backup\digits\1 (mbSize=12291 \
fsType=NTFS )
Volume 1 also mounted on c:\mnt\vcb-backup\letters\C
Again, the NTFS filesystem is accessible via its letter. Now, you can copy the files inside, you can backup the directory structure but you can't delete anything. The reason is you are not working with the virtual disk directly but with its snapshot called _VCB_SNAPSHOT_ (full backup with vcbMounter). Here is a screenshot from Virtual Infrastructure Client proving it:

When we are finished with backup we need to unmount it. It differs from unmounting exported virtual disk because we need to delete the snapshot as well. This is reachable with the vcbmounter command and -U parameter:
vcbmounter -h VC_IP -u VC_USER -p VC_PASS -U c:\mnt\vcb-backup
The output is similar to the one we have seen already:
Unmounted c:\mnt\vcb-backup\digits\1\ (formatted)
Deleted directory c:\mnt\vcb-backup\digits\1\
Deleted directory c:\mnt\vcb-backup\digits
Deleted directory c:\mnt\vcb-backup\letters\C\
Deleted directory c:\mnt\vcb-backup\letters
Deleted directory c:\mnt\vcb-backup

And that's all the magic. Do you remember as we need to export the virtual disk at first and then to mount it? The file-level backup is straightforward. You can bypass copying the virtual disks over LAN and you can do the backup directly.

The conclusion is:
  1. Use the file-level backup where it is possible (Windows machines)
  2. Otherwise use the full backup (UNIX machines)

Wednesday, September 24, 2008

VMware Server 2.0 is out

Let's celebrate it! VMware just released a next major version of their VMware Server. Quickly, let's go through the new features and other changes:
  • New operating systems support - it supports operating systems recently released like Windows Server 2008, Windows Vista or RHEL5 .
  • 64b operating system support - finally, we have stable support of 64b guests on 64b hardware. VMware Server runs natively on 64b Linux host operating systems now. Perfect job guys!
  • Virtual machines scalability - you can configure your virtual machines with up to 8GB of RAM and with up to 10 NICs now. The USB2.0 interface is supported as well.
  • Hot add/remove of SCSI disks - you can attach or detach a new virtual disk to the running virtual machine.
  • Virtual Machine Communication Interface (VMCI) - this feature allows to reach better performance in network communication of guests with host or among guests.
  • VI Web Access - this feature allows you to manage your virtual machines from web-based interface. It is part of the installation package now.
  • VMware Remote Console - it is a web browser addon which makes you able to manage your VMs from it. And it allows to connect local CD-ROM as well.
  • Volume Shadow Copy service - you can make consistent backups of Windows guests now with help of VMware VSS writer which uses snapshots to maintain data integrity.
  • Size of installation package - Wow! The installation package has over 500MB of size now! I'm really curious what's inside! The previous version has about 150MB!
I think that VMware enabled every feature which was proposed and implemented in beta release of VMware Server 2.0. I hope I will find some time to install it and check these nice features. By the way, have you installed it already? Download it from vmware.com site, read the release notes.

VCB basic usage - VM mount with mountVm

The full backup of virtual machine vcb-backup was finished and we have its virtual disk available locally now. We can backup it directly or we can access its filesystem and backup selected filesystem structure only (e.g. we want to backup some application data only).

The virtual disk and the whole virtual machine is available in the c:\mnt\vcb-backup\ directory. It contains everything what we might require for its restoration (VMX and VMDK configuration files, NVRAM states and so on). This screenshot figures its content:

The virtual disk path is available from the output of vcbmounter command:
c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk
To browse the filesystem, we will mount it with the mountvm command:
mountvm -cycleId -d c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk \
c:\vcb-backup
The successful execution of it will produce messages like these:
Opened disk: c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk
Proceeding to analyze volumes
Done mounting
Volume 1 mounted at c:\vcb-backup\digits\1 (mbSize=12291 fsType=NTFS )
Volume 1 also mounted on c:\vcb-backup\letters\C
A virtual machine disk represents an image of x86 harddisk with own MBR and partition table. Our disk contains only one partition with NTFS filesystem linked with drive letter C. Each such a letter is mounted under the directory which we specified with -d option (again, the directory is created on demand and it can't exist before). In our scenario, we have c:\vcb-backup\letters.

We are able to traverse the filesystem now and backup its particular files or directories. When we are finished, we will have to unmount it:
mountvm -u c:\vcb-backup
If the mounted filesystem isn't busy, the command will print these messages (otherwise it will end with an error):
Unmounted c:\vcb-backup\digits\1\ (formatted)
Deleted directory c:\vcb-backup\digits\1\
Deleted directory c:\vcb-backup\digits
Deleted directory c:\vcb-backup\letters\C\
Deleted directory c:\vcb-backup\letters
Deleted directory c:\vcb-backup
Finally, let's make a summary of virtual machine full backup steps:
  1. we need to identify the machine (vcbvmname)
  2. we need to export its virtual disk (vcbmounter -t fullvm)
  3. optionally, we might need to mount its filesystem (mountvm)
  4. backup the exported disk
  5. backup the mounted filesystem if mounted
  6. unmount the filesystem if mounted (mountvm -u)
That's all for now. Any question or suggestions are welcome.

Friday, September 19, 2008

VCB basic usage - VM full backup with vcbMounter

Let's choose the virtual machine called vcb-backup and perform its backup. Before we proceed, we should stop to explain that VCB is capable of doing two types of backup:
  1. full backup
  2. file-level backup
The file-level backup is available for Windows operating systems only. The full backup means to backup virtual machine images. You can use it with every type of virtual machine.

Next thing, we need to remember to choose the right transport mode:
  1. SAN mode - bypassing VCB proxy via FC or iSCSI SAN (LAN-free backup)
  2. Hot-Add mode - VCB proxy in a virtual machine
  3. LAN mode - backup over LAN network
In SAN mode, both ESX host and VCB proxy has to have access to the shared storage. The backup is completely offloaded from the ESX host which provides virtual machine disks and their snapshots only. The whole process is moved to the VCB proxy which reads disks directly from the SAN. The Hot-Add mode is interesting in that way, it is able to access virtual machine disks directly but without the SAN. If the VCB proxy is virtualized, it is hot added virtual machine disks. Nothing suprising, VMware ESX is capable of hot-adding disks to a virtual machine. The drawback is that you need to have one virtualized VCB proxy on each ESX host so that it can backup all virtual machines hosted on them. The LAN mode uses network protocols to access the virtual machine disks. By the way, the SAN mode is supported by VCB and VMware ESX natively. The remaining two modes requires VMware ESX(i) 3.5 or later.

The vcbmounter command is used for virtual machine backup. The following command will initiate a full backup of vcb-backup virtual machine in LAN mode:
vcbmounter -h VC_IP -u VC_USER -p VC_PASS -a name:vcb-backup \
-r c:\mnt\vcb-backup -t fullvm -m nbd
The -r parameter defines a directory of backup location. The -m parameter specifies transport mode (available values are san, hotadd, nbd/nbdssl). The directory can't exist. It is created on demand. The command should produce the following output when it finishes:
Copying "[system-raid1] vcb-backup/vcb-backup.vmx":
0%=====================50%=====================100%
**************************************************
Copying "[system-raid1] vcb-backup/vcb-backup.nvram":
0%=====================50%=====================100%
**************************************************
Copying "[system-raid1] vcb-backup//vmware.log":
0%=====================50%=====================100%
**************************************************
Converting "c:\mnt\vcb-backup\scsi0-0-0-vcb-backup.vmdk" (compact file):
0%=====================50%=====================100%
**************************************************

As you can see, the VCB proxy is copying virtual machine disks to the defined local storage. More precisely, the ESX host provides virtual machine snapshots to the VCB proxy which copies them to the local storage (you can check it with snapshot manager - there will be a snapshot called _VCB-BACKUP_). After that, you can backup them with your favorite backup software. Or you can access them with mountvm command.

Wednesday, September 17, 2008

VCB basic usage - VM idetification with vcbVmName

Before we begin the backup process of selected virtual machine, we need to identify it so that VCB can contact VirtualCenter server and start the backup session. This step is simple and requires to run the vcbvmname command. The VirtualCenter server contacts particular ESX hosts and send a list of hosted virtual machines back. Follows the example of command usage:
vcbVmName.exe -h VC_IP -u VC_USER -p VC_PASS -s any:
The most of used command line options are almost common for all VCB commands:
  • -h - hostname or IP address of VirtualCenter server
  • -u - VirtualCenter user who is allowed to do virtual machine backup (at least user with VMware Consolidated Backup User role)
  • -p - VirtualCenter user password
The -s option is more specific and defines virtual machine identifier prefixed with a search pattern. The any: pattern means search for any available virtual machine. This identifier is used by other commands for virtual machine identification as well. It is possible to identify it by IP address, name and so on. What does the above command produce?
Found VM:
moref:vm-99
name:vcb-backup
uuid:5022bd2a-0de0-9c82-e30e-063c976a8a29
ipaddr:132.100.0.29
Found VM:
moref:vm-97
name:vcb-test
uuid:5022ab4a-f7f4-03a2-1434-f2af63938718
ipaddr:132.100.0.28
Here, you can see all virtual machine identifiers - name (name:), IP address (ipaddr:), virtual machine unique identifier (uuid:) and managed object reference (moref:). You can use them as search pattern instead of any: universal pattern. For example, the next command will find the virtual machine with name vcb-test only:
vcbVmName.exe -h VC_IP -u VC_USER -p VC_PASS -s name:vcb-test
Now, we know how to identify the particular machine and next time, we are going to backup it.

Friday, September 12, 2008

What next? VMware ESX 4.0

What next will VMware release after VMware ESX 3.5? This is a natural question and I think it's not surprise that it might be VMware ESX 4.0 or something like this. The surprise is what the next generation of ESX might bring to us. Let's have a look at some of the new features:
  • the service console and the kernel should run in 64-bit mode natively
  • VMware VirtualSMP should support 8 virtual logical processors
  • full support for SATA devices (we might be able to run ESX on PC?)
  • clustered VirtualCenter Servers
  • access control on storage resources
  • automatic configuration changes tracking
  • and many others
The list is not complete. Actually, it contains only a few of prepared features. The details should be unveiled at the incoming VMworld2008 forum as it is written at virtualization.info. I'm looking forward to it.

Thursday, September 11, 2008

VCB basic usage - introduction

Do you know about some useful guide which introduces VCB commands? In my case, I haven't find any yet. I found some articles about the topic which helped me a bit but no one was usable as a reference guide. So, I am still missing such a guide. Unfortunately, the basic usage of VCB commands is comprehensible.

I don't want to write anything advanced for now. Just basics, no SAN, no backup agents. Just to explain what VCB contains. Let's suppose we wanted to export virtual machine disk files or mount them to a Windows station and then to backup it. The backup will run over the network. We need to mount the images, backup them and unmount them after that.

So, which command do we have? Which can help us with the tasks described above? Let's explore them:
  • vcbvmname - connects to the VirtualCenter server and lists the available virtual machines
  • vcbmounter - allows to export/mount the virtual machine disk files to the backup station
  • mountvm - allows to mount the exported virtual machines disk files locally
  • vcbrestore - allows to completely restore the virtual machine disk files to the ESX host
The usage of the commands will be explained in the following article. Now, if you know about any guide focused on VCB usage, please, share it with us.

Monday, September 8, 2008

Microsoft Hyper-V against VMware ESXi again

Hm, the competitor never sleeps, we could say after Microsoft revealed the plan to release Hyper-V Server 2008 platform without Windows (read more at microsoft.com). I'm not able to imagine it but Microsoft developed a minimal version of Windows with the most necessary parts of OS - kernel and drivers - which are loaded in the parent partition. It should be similar to VMware ESXi which is not more dependent on service console. That means the customer doesn't need to invest to the Windows Server 2008 licence. The whole new product should be released within 30 days and it will be free of charge.

By the way, the VMware products are still leaders. And they will be. The stability, performance, central management of virtual environment or enterprise features are more mature than new toys from Microsoft. Let's mention the only one - VMotion technology. It is said Microsoft is going to support live migration of virtual machines in Windows Server 2008 R2 which will not be out before 2010 (details at zdnet.com). I think it's quite late...