For non-US people: How to Avoid Wikipedia Blackout

For all non-US people, that have no U.S.Congress representative to contact about SOPA and PIPA – here is the simple recipe  to avoid the blackout.

First of all, you need Google Chrome with AdBlock extension. Now, open the AdBlock options, go to the Customize tab, click on ‘Edit’ button and add the following two lines to the filters:*

Don’t forget to click ‘Save’ and enjoy the Wikipedia again!

Deployment of New VM from Template Fails with VMDK Locked Error

Some time ago I managed to isolate an ugly vSphere 5 bug that caused me some unpleasant moments. Today I finally reproduced this behavior in a clean lab environment, so I feel confident enough to describe it in public. Don’t worry, the way to recover is described also!

Take a vSphere 5 environment with a template (say, “MyTemplate”) that you want to deploy a virtual machine from. Step through a regular deployment wizard and select “Edit Virtual Hardware” on the last page. In the VM properties, choose the hard disk and change its size. The new VM (say, “MyVM”) will be created successfully, but the next time you’ll go through the deployment process it will fail with a strange message: “Unable to access file ‘MyTemplate/MyTemplate.vmdk’ since it is locked”…

A quick search in VMware KB (or just in Google) will tell you that the vmdk (the virtual disk of the VM) is usually locked when some other VM uses the same disk. Hey, this is a template! No other VMs are supposed to use the template disk, right? Well, the truth is that this disk is now attached to MyVM – yes, that one with different disk size… But let the lock alone. Your lovely template is now gone, since the disk that belonged to the template is now owned by the running virtual machine – with new name, settings and maybe even software!

Well, how do you recover from this situation? The good news are that the original disk from MyTemplate is not gone. In fact, vSphere really cloned a new vmdk file for MyVM and placed it where it should usually reside – in ‘MyVM/MyVM.vmdk’ – but for some reason set the MyVM to use a template file instead. At this moment you can take a deep breath, shut down MyVM, point it to the right virtual disk and physically swap the files in the datastore… Continue reading “Deployment of New VM from Template Fails with VMDK Locked Error”

How to download large video from iPhone to PC

Some time ago I have to download a lot of photos, including several videos, from my iPhone to my WinXP PC. The copy took 20-30 minutes, but finished without any errors. This weekend I had some spare time to sort the photos and suddenly realized that several videos have zero size. Fortunately, I had no time for clean up the photo library on the iPhone during this period and the originals survived. However, copying the files one per time lead to the same effect – Windows Explorer silently failed after 1-2 minutes of trying, leaving the empty video in the target folder. Looks like the limit is around 200Mb…

The workaround is simple – it appears that iTunes leaves the last full backup on the hard drive (on WinXP it is under “C:\Documents and Settings\\Application Data\Apple Computer\MobileSync\Backup\”), and this backup contains plain copies of all photos and videos from the device. All files have computer-generated names (even w/o extension), so there is no immediate way to determine which file contains the video that you need. The simplest option will be to sort those files by size, copy the largest ones to another folder, appendthem “.mov” extension and watch them one by one in some video player.

P.S. This issue was first mentioned on Apple forums 1.5 years ago, even before the release of iPhone 4, but not fixed yet.

Fixing revert snapshot failures in vSphere

Did it ever happen to you that you want to revert some VM to another snapshot and get “The object has already been deleted or has not been completely created” error message? It is really painful, especially if you lab heavily relies on excellent snapshot functionality provided by vSphere… It appears that sometimes it can be fixed by deleting the VM from the inventory and adding it back. The process is really simple, but requires administrative credentials.

So, here it goes:

  1. Go to the Summary tab for your VM, find the relevant datastore and choose “Browse Datastore…” option.
  2. Find the folder that belongs to your VM and make sure you see the “.vmx” file (you’ll need it in step 5).
  3. Go back to your VM in the vSphere tree and choose “Remove from Inventory” in the context menu. Be careful – “Delete from Disk” is the next option, and it is not reversible!
  4. Wait while vSphere performs your request.
  5. Go to datastore window, open context menu of the “.vmx” file and choose “Add to Inventory”
  6. Go through the wizard, selecting relevant options for VM import.

That’s all – wait until the VM will be fully imported and try to revert to your favorite snapshot now.