Oct 26 2009

VM disconnects after vMotion

Brandon Yap

We’ve been having this weird problem for a while where if sitting idle for a day or two, a VM would disconnect from the network and otherwise be unavailable until after a few minutes if you try to vMotion it. But after you reboot it, it worked fine. Networking checked out. Storage checked out. What could be wrong??

Turned out the culprit was memory overcommitment on our ESX servers. Who would have thought! We had more memory allocated to VMs than there was physical memory, even though the green memory indicator said otherwise.

A bit of background as to why this happens. ESX uses a number of techniques to conserve memory which allow you to use physical memory efficiently. When memory is starting to get scarce, ESX will engage a “balloon driver” in idle VMs with VMware Tools installed. This driver will inflate causing apps in memory to write out to the operating system swap. ESX will then reclaim this memory for use in other VMs.

If memory is that tight that it can’t make the OS swap and it can’t grab memory from elsewhere, as a last resort it will start to use VM Swap (different of guest OS swap). When ESX starts a VM, it writes a file of the exact same size as memory is allocated to it. ESX will then swap the more idle VMs to this swap file without the guest knowing about it. This has a major impact on performance and….you guessed it, vMotion. Your VM will be unavailable while ESX swaps everything back into memory. You can use the performance graphs to determine how badly your VM will be affected if it has been swapped. I’ve seen a few megs worth of swap not affect a VM. But a few hundred megs will.

The best way to make ESX avoid having to use VM swap is to have enough physical memory (duh!). Failing that, you can ‘reserve’ memory for the more important VMs using memory reservations. If you set a VMs memory reservation to the amount of memory it has, ESX will never swap it. Eg if you allocate 4096MB to a VM and set it’s memory reservation to 4096MB.

Update: Aparently Update 5 resolves this problem but I haven’t tested it yet.


Oct 26 2009

Suspending Windows 7 in VMware Fusion

Brandon Yap

When running Windows 7 as a virtual machine under VMware Fusion, you have the option of Sleeping or Hibernating from within Windows, or suspending the VM from Fusion.

All the methods ultimately serve the same purpose but achieve it’s goals differently.

Sleeping and Suspending were very quick and I suspect invokes the same function, as in VMware Tools calls the Sleep function from within the OS. Contents in memory are held there and the VM is frozen in it’s current state. Hibernation on the other hand dumps everything from memory into a file within Windows, then halts the system, where upon waking needs to read everything back from this file back into memory. This is what makes Hibernating take a lot longer to initiate and recover from.

In my experience i’ve found that Sleeping or Suspending Windows 7 is quicker.


Oct 26 2009

An iPhone users guide to the Telstra NextG network

Brandon Yap

The Telstra NextG network is undoubtedly the largest and highest performing cellular mobile network in Australia, which makes it a perfect pair with your iPhone.

This article aims to give you a through rundown of things you need to know to make use of this network. After all you are paying an arm and a leg for it!

Network Selection

By default the Carrier selection will be set to Automatic. There are 4 networks to choose from. Telstra Mobile, 3TELSTRA, YES OPTUS, and vodafone AU. 3TELSTRA is the joint 3 and Telstra network operating on the 2100 MHz spectrum. Telstra Mobile is the NextG branded network on 850 MHz. This is the one you want. It has better penetration, better coverage, and faster data speeds. In certain situations the iPhone will lock onto 3TELSTRA and not go back to Telstra Mobile. If this happens to you regularly, then choose Telstra Mobile as a carrier instead of leaving it on Automatic.

Tethering

Tethering is a feature of the iPhone which lets you use your device as a modem. Telstra enabled iPhone tethering on 5th December 2009 via a carrier update. You can tether via either USB or Bluetooth. To enable, go to Settings -> General -> Network -> Internet Tethering.

Free Content

Apps that are free to browse, all the Telstra owned ones:

Yellow Pages, White Pages, Whereis, Sensis.

Keeping tabs on your data usage

Wether prepaid or post paid, you will be able to view your data usage online or through a number of apps available in the online store. “Quota” and “Consume” are two outstanding apps. You can also view your data usage through the BigPond Mobile for iPhone portal. You’ll find the link in Safari bookmarks.

APN

The default APN for an iPhone on the Telstra network is “telstra.iph”. This allows you to access the BigPond Mobile for iPhone portal. The portal contains links to various other BigPond areas such as Yellow Pages, White Pages, and most importantly My Account. This APN implements the use of a proxy. Some applications do not work well with this APN and are known to crash and behave oddly. If this happens, then switch your APN to “telstra.internet”. This APN does not use a proxy and works fine with all applications, but you will lose access to the BigPond portal.

Update: On 11/02/2010, Telstra released the 5.2 carrier update which disabled the ability to change APNS.

Application usage notes

Google Reader and RSS feeds in general do not seem to work properly when used with the telstra.iph access point. Users on Whirlpool and Google themselves have stated that Telstra does extra compression on the telstra.iph APN which messes with the RSS content. Switching to telstra.internet alleviates the problem, as does changing the Google Reader URL to use https.

Update: The Google Reader issue seems to have been resolved.

Editor notes

This article will be updated as I discover more information. If you come across this article and would like to contribute, please let me know and i’ll add any information you might like to share.

Hosted by Horizon Hosting


Oct 26 2009

How to quickly drain your Macs battery

Brandon Yap

Firstly why would you do this? The simple answer is when calibrating your battery, the last thing you want to do is sit around waiting for your battery to drain normally. This procedures accelerates the process.

There are a number of ways to drain your Macs battery such as playing a game, or watching a DVD. But I have found a quicker way to do it which doesn’t require you to be at your computer.

Just open up one terminal per processor core and run this in it:

yes > /dev/null

Don’t run it without the /dev/null otherwise it will consume lots of memory and eventually lock up your system. Now if you open another Terminal an run “top”, you should see 0% idle. Let it run this way for a while and your battery will drain very quickly. Once it reaches around 5%, I would suggest stopping all the yes processes and let it drain by itself. Otherwise when you powerup your system these processes will start running again.