Archive for the ‘How-Tos / Tips’ Category

Large Storage VMotion and a Little Patience

Whilst doing a little storage vMotion using VMware this week, I got a little lesson in patience from VMware and thought that I would share my experiences to help a few others who are looking at doing storage migrations of larger VM’s. My experiences are with VMware ESX 3.5 and Virtual Center 2.5. Not the most recent, I know, but we haven’t had time yet to upgrade to vSphere 4.

The point of my migration was to get a particular vmdk off a slower set of disks and only a faster set of disks. Due to the fact that ESX 3.5 doesn’t directly support moving only one vmdk at a time, I had to do a little dance to get the one vmdk that I wanted to move, moved. I had to move the virtual machine itself and ended up moving a couple of extra disks in order to to get it to move.

Near as I could figure, Storage vMotion (with ESX 3.5) has the following stipulations:

  1. The virtual machine files must move.
  2. The virtual machine files must move to a datastore that is large enough to hold the largest vmdk.
  3. Apparently, the host needs enough memory free as the size of memory allocated to the already-running virtual machine (during the move, memory usage spiked which caused all kinds of problems for me since this was a large virtual machine, but not really the point). I haven’t verified this requirement yet, but that’s what my initial thoughts are after seeing the behavior.

Seeing the migration options for vSphere 4, I wanted to cry on how difficult my life was made by these requirements, but that’s another story. We’ll be scheduling that upgrade shortly. :)
Anyway, I ran the Storage vMotion. At which point, I managed to bring the virtual machines on my host to a screeching halt, not knowing number 3 right off hand. After killing a few virtual machines and moving a few others away from this host, we were back under way.

Near the end of the Storage vMotion (at 90% to be specific), the interface stayed at the same percent for several minutes and I was greeted with this friendly error:

A general system error occurred: failed to reparent/commit disk(s) (vim.fault.Timedout)

Uh-oh. A quick Google serch found this VMware knowledgebase article.

Unfortunately, I missed the “Incorrectly” throws a timeout error message and panicked a bit. I started digging around in the destination and original datastores and found tons of “DMotion” files everywhere. While desperately looking for solutions around the web, my Virtual Center screen refreshed with the new datastores being associated with the disks and moved over. Yup, while I was freaking out, the whole thing just took care of itself.

Apparently, when working with Virtual Center, one must always have a bit of patience and remember to double-check timeouts inside Virtual Center with the ESX hosts directly. I suppose I should have known better as I’ve seen this kind of behavior while working with snapshots in the past. If you come across this post while searching for this error, take a few minutes to relax and let VMware do its thing in the background while Virtual Center shows stupid error.

Related Posts Related Websites

Tags:
Filed under How-Tos / Tips : Comments (0) : Jan 11th, 2010

Want Faster Browsing? Google FTW!

Well, Google is at it again. I am now relying on yet another set of Google products..

This week was a big week for non-Windows users waiting for the Chrome browser. Earlier this week they released the beta of Chrome for Linux and Mac. I actually held out a bit on using many of the pre-release version of Chrome on Linux/Mac, mostly because I didn’t have a lot of time on my hands, but also because I didn’t realize just how much faster it really was than the browsers I’d been using. But, it wasn’t just Chrome that has sped up my browsing experience this week either.

Last week Google announced the general availability of its new public DNS service, touting it  as a speed booster(?). DNS typically isn’t something that we give a ton of thought to when chasing after faster browsing speeds, but I was pleasantly surprised by a bit snappier browsing experience. Of course, my download speeds really aren’t any faster, but the initial connection to my favorite websites (and non-favorite I suppose..) has sped up a bit. Just how much faster did this new DNS service make my little network go? Well, I really don’t have any numbers. If you haven’t tried it, it’s definitely worth a shot.

All’s not entirely well in my new Google world since Chrome is still in beta. I have to close the browser on occasion because things start acting up and some of my saved passwords are acting a bit weird, but overall the experience has been great. I still have to rely on a combination of Firefox and Safari for things that Chrome is buggy at (or can’t do like my Zimbra admin :( ), but that’s to be expected with a beta.

If you are running a Mac or Linux machine as a desktop, I’d encourage you to check out the new Chrome beta. I guess even more of my data are now belong to Google..

Related Posts Related Websites

Tags: , , ,
Filed under How-Tos / Tips, News : Comments (0) : Dec 10th, 2009

Easy and Free Network-based Time Machine Backup

I’ve been looking for a network-based (free) solution for backing up a couple of Macs using Time Machine at home for some time. Plugging external drives into our two Macs was doable, but not exactly convenient. There’s plenty of how-tos out there on setting up a Linux machine to offer up an AFP share and then hacking it to support Time Machine, but those seemed more like a hack to me and users reported mixed luck. I needed something that ‘just worked’. Enter: FreeNAS.

I actually was setting up and playing with FreeNAS after reading about it on an article from MaximumPC. I’d set it up before and played with it, but I didn’t quite realize how much progress they had made. When playing with the AFP settings, I ran across the Time Machine option in the interface.

Setting up Time Machine to backup to your FreeNAS is pretty straight forward. First, you’ll want to start with a base install of FreeNAS with enough space to hold your backups. There’s plenty of good how-to’s out there including the one I mentioned earlier, so I don’t really see a point in me covering it here.

First, you’ll want to enable AFP on the server. You just have to simply go to Services -> AFP in the interface, check the “Enable” check box on the far right, enable local user authentication, and click the “Save and Restart” button to turn AFP on.

auto-disk-discovery-time-machine

Next, you’ll need to add a user. In the interface menu, go to Access -> Users and Groups. Add a user and call it what you like.

Now, hop back to the AFP management and click on the Shares tab. Add a share. When you add the share, be sure to add your user as a user that can read and write to the share as well as enable automatic disk discovery and set the discovery mode to “Time Machine”. Once finished, be sure to click the “Apply changes” button (a step I’ve missed a time or two :) ).

On my Mac, I had to authenticate to the AFP server once in Finder. Then, go into the Time Machine preferences and you should be able to add your new share as a Time Machine disk. I’d suggest making sure that you plug into a wired network for the first backup if you normally wander around with your Mac on wireless.

So far it’s working pretty solidly and was simple to setup. In my case, the whole thing was free as I am running it in VMware on a machine that would be on anyway.

Related Posts Related Websites

Tags: , ,
Filed under How-Tos / Tips : Comments (0) : Dec 8th, 2009

Running LAMP Applications Using Nginx

While playing with WordPress on nginx for my last post, I discovered that a majority of the how-tos out there on running PHP/MySQL applications using nginx left a bit to desired. Here’s the steps that I took to get my application (WordPress, specifically) working.

Install nginx, MySQL, and PHP
First, let’s install nginx and PHP along with a few PHP libraries:
sudo apt-get install php5-mhash php5-mysql php5-odbc curl php5-curl php5-gd php5-imap nginx php5-cgi php5-cli php5-common

If you didn’t already have MySQL installed on your server, you’ll need that too:
sudo apt-get install mysql-server
The installer will prompt you to enter a root password. Make sure it’s a fairly good password, but also be sure to record it as you’ll need it later.

Install spawn-fcgi
Spawn-fcgi used to be included with lighttpd, but has been moved to its own project, so it can be downloaded separately. Unfortunately, the spawn-fcgi project is not in the Ubuntu repositories, so it has to be installed separately. First, download the tarball from the spawn-fcgi project page. As of this writing, it’s on version 1.6.2. For this particular version, run the following from a directory your user can download to:
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.2.tar.gz

Untar it:
tar zxf spawn-fcgi-1.6.2.tar.gz

Make sure you have the compilation tools:
sudo apt-get install build-essential

Now, navigate into the spawn-fcgi download directory and compile:
cd spawn-fcgi-1.6.2
./configure
make

Now, let’s install it into /usr/bin:
cd src
sudo cp spawn-fcgi /usr/bin/

Now, let’s make the init script. Copy the following example into /etc/init.d/fastcgi:

#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
RETVAL=0
case "$1" in
'start')
$PHP_SCRIPT
RETVAL=$?
;;
'stop')
killall -9 php5-cgi
RETVAL=$?
;;
'restart')
killall -9 php5-cgi
$PHP_SCRIPT
RETVAL=$?
;;
*)
echo “Usage: php-fastcgi {start|stop|restart}”
exit 1
;;
esac
exit $RETVAL

Next, let’s create the script to launch the PHP CGI process. Copy the following example text into /usr/bin/php-fastcgi:

/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi

Make sure the new scripts are executable:

chmod +x /usr/bin/php-fastcgi /etc/init.d/fastcgi

You should be able to start up your fastcgi process now with the following:
/etc/init.d/fastcgi start

Make the fastcgi process start at boot:
sudo update-rc.d fastcgi defaults

Setup nginx site
I used the following as my site file. A majority of it was taken from the default site and parts from other how-tos. You can rewrite the /etc/nginx/sites-available/default with this templated page (in my example, I assumed that the site is called site.com and that you are using WordPress at /var/www/wordpress). Be sure to change the “root” and “SCRIPT_FILENAME” lines.

server {
listen 80;
server_name site.com;
access_log /var/log/nginx/localhost.access.log;
location / {
root /var/www/wordpress;
index index.php;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME /var/www/wordpress$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}

Before restarting nginx, make sure everything is cool with the config and correct any errors:
sudo nginx -t

Now, restart nginx with the new changes:
sudo /etc/init.d/nginx restart

Install your application
You can now install your application as you normally would using Apache. In this example, you can download the WordPress packages to /var/www/wordpress and install from there, making sure that the files are owned by the www-data user.

Related Posts Related Websites

Tags: ,
Filed under How-Tos / Tips : Comments (0) : Aug 29th, 2009

More Tab Complete Awesomeness on Ubuntu 9.04

It’s a slightly older post, but after I read Workswithu’s report on the four features that they believed set Ubuntu apart, I had to agree whole-heartedly with the fourth one regarding implementation of auto-complete on the shell. As I was reading, I constantly dropped to the shell to discover new tab-complete features that I didn’t know about, including apt-get that I really didn’t notice but used every day. Anyway, today I discovered yet another.

This kind of defeats the purpose of DNS, but I discovered that if you put a host into the /etc/hosts file on a Ubuntu 9.04, then both SSH and rsync tab-complete for you when you start typing the hostname. I’m not sure about scp, but I’m sure it works the same way.

Extending this functionality further, it would be awesome if I could tab-complete from my known_hosts file, but that doesn’t seem to work.

Anyway, if you find yourself SSHing or rsyncing files to a host or set of hosts all the time, this trick can be very time-saving. Perhaps not quite as time-saving as being able to SSH with the click of a mouse, but often its not very convenient to leave the keyboard just to save a few keystrokes at the shell.

Related Posts Related Websites

Tags: ,
Filed under How-Tos / Tips : Comments (0) : Aug 5th, 2009