Wednesday, April 22, 2009

vSphere Announced!

Hi folks, so unless you have been hiding under a rock you know that VMware's vSphere product has been announced! vSphere is the successor to VMware ESX and it's bigger and better than ever!



Some of the cool features announced are:


  • Thin Provisioning

  • VMSafe

  • vShield

  • vNetwork

  • More RAM per VM

  • More CPUs per VM

Just to name a few. We now also have the in-built ability to backup virtual machines easily right from VMware without having to go to third party products or scripting. Very cool indeed!

According to the public announcements I've heard, we should start seeing the product show up in the channel within a month. Also your product keys will start to show up in your VMware portal for those with current versions of VMware and support! I for one can't wait to upgrade! Of course just like usual make sure you take a stepped approach to the upgrade process and leave some of your servers as the old version so you have something to roll back to if you have issues.

-RP

Friday, April 17, 2009

How to reset a Cisco ASA to factory defaults

Hi folks, here's a common question that comes up. How do I reset a Cisco ASA(Adaptive Security Appliance) firewall to factory defaults? You would think this answer would be an easy one, but due to there being more than one way to skin a cat, sometimes you might think you reset it when in fact you only partially did.

The most common way I see people doing a reset is the following method from the CLI:
  • enable
  • write erase
  • revert webvpn all
  • delete disk0:sdesktop/data.xml
  • reload

Unfortunately this does not reset the ASA firewall to factory defaults. All this does is erase the config. A lot of things will still exist after this including the passwords you set previously and the hostname assigned to the firewall. This isn't what we want, and we might end up carrying over this information that we didn't want.

So instead, to reset to factory defaults, do the following:

  • configure factory-default [ip_address [mask]]

This will completely reset the device to factory defaults. You will even have to tell the router what the default boot image and asdm vesion is again otherwise it will boot with the old one from flash.

Hope this helps! You can read more about the product details of the Cisco ASA here.

Cisco, ASA, 5505, 5510, configure factory-default, config factory-default, reset factory defaults

-RP

VMware Announces vSphere

Hi folks, unless you have been hiding under a rock lately you will notice that VMware is poised to announce the launch of vSphere their new virtual server product which was renamed from ESX 4.0.

The masses wait eagerly in anticipation for the release of vSphere during this crazy virtual war that's going on right now. With vSphere released, expect VMware to launch a shot across Microsoft and Citrix's bow to keep them at bay.

VMware will be making the announcement on April 21st, 2009 and we will also be having a representative from VMware making an announcement at my company's twice annual conference "Epic Technology Day" at the Victoria Inn in Winnipeg, Manitoba on the same day.

Some of the upcoming cool features are vStorage which allows for thin-provisioned disks and the new Cisco vSwitch which allows you to have a virtual Cisco switch embedded in your ESX hosts.

There will more information to come from me after the announcement!

-Cheers, RP

Thursday, April 16, 2009

How to schedule a GhettoVCB backup job or any other script you want

Hi folks, in order to schedule the GhettoVCB backup script you will need to use the program Plink.exe I spoke about in my previous post.

First download the Plink.exe program and place it in a folder on your server. I create a directory on the C drive called putty and place plink.exe in c:\putty. Then create a batch file using notepad called ghettoVCB.bat.

My batch file assumes the following things for the sake of this example:

  • The ESXi servers IP address is 192.168.1.5
  • The username is root to login
  • The root password is mypassword
  • backuplog.txt is the name of the text file where the output of the commands will be sent
Now edit the ghettoVCB.bat file and enter the following line on one line, I usually turn word wrap off in Notepad, substitute the values for your own values:

c:\putty\plink.exe root@192.168.1.5 -pw mypassword “nohup ./vmfs/volumes/datastore1/ghettoVCB.sh /vmfs/volumes/datastore1/vmwarebackups > /vmfs/volumes/datastore1/backuplog.txt &”

Create a windows scheduled task now and point it at the batch file and schedule it to run at whatever interval you like. You now have a scheduled backup job for ESXi!

-RP

Creating Virtual Machine Backups in VMware with GhettoVCB

Hi folks, like I mentioned before I'll be showing you how to create backups using the GhettoVCB script from William Lam. First things first, please enable SSH access on your ESXi box. You can do this by following my steps in my previous blog post.

Next, you have to download the following software for use on your computer to help you get this all accomplished.

  • Putty.exe (This is one of the more famous SSH programs out there used to connect to the ESXi server via SSH)
  • Plink.exe (This is used to run command line commands in your SSH session with the ESX server, this is integral for scheduling scripts)
  • WinSCP (This program is used to upload and download files between your ESXi server and your workstation)

After you have downloaded these programs, please install them on your workstation. Then you can go and download the ghettoVCB.sh script from the VMware communities web site where this script is hosted at.

After you have downloaded the script, do not edit it on a Windows computer otherwise you run the risk of introducing control characters into the script which will cause the script to fail when run on the ESXi server. Instead, just upload the script to your ESXi server using WinSCP. Please ensure that you change the transfer settings mode to text mode for the transfer.


After you have transferred the script up to the ESXi server please ensure you move the script into your /vmfs/volumes/Datastore1 directory. There is a good reason for this. If you do not move it into your datastore directory the script will be erased the next time you reboot the ESXi server. The ESXi server will not erase anything stored in the VMFS datastore however. Your datastore might have a different name than mine so just make sure you put it in your datastore that you created when you installed ESXi.


After you have copied the script to this folder, create a new text file named whatever you want that contains a list of the virtual machine names as they are listed in your VMware client when you connect to your server. For example if you have three servers DC01, DC02, EXCHANGE01, then put those three names in the data file. You can create a data file in ESXi by doing the following, I am going to use the filename vmbackups for my example. First change directory to your datastore volume before creating the file. Keep in mind that everything is case sensitive.

  • Type the following at the command prompt in your ESXi ssh session:
  • cd /vmfs/volumes/Datastore1
  • Type in: vi vmbackups
  • Hit the insert key to enter editing mode in vi. Type in DC01, hit enter, type in DC02 hit enter, type in EXCHANGE01, and hit enter.
  • Hit escape to exit editing mode.
  • Type in a colon “:” and then type wq and hit enter, this will save the file and quit back to the command prompt.

There, now you have created your data file that contains the names of your virtual servers. Remember that this is case sensitive so if you typed in dc01 and your server’s actual name in the VMware client list is DC01 then it won’t work when the script runs.


Now you need to choose a location to store your backups too. You could just save your backups to your datastore and then manually use WinSCP to save them off everyday. Or you can mount an NFS share and have your backups save to that NFS location. The best way to do this is to install Windows Services for Unix version 3.5. Please follow the directions here on how to do this.


If you don’t have a Windows server with storage available for this then you could use a Windows workstation with a 3rd party NFS product to share out a drive. My own personal favourite is Allegro NFS. I am currently trialing the software and will probably purchase it for use in my test lab at home. I use it on my Vista machine at home where I have a USB external hard drive attached to it. Allegro NFS allows me to share out a folder on my USB drive and make it available to my ESX server. I have created a folder called vmwarebackups and shared it out using NFS. The NFS pathname is /x/vmwarebackups. Let’s say for example that my computer’s IP address is 192.168.2.10. Now what I need to do is connect to the ESXi server with my VMware client and add new storage.

  • Do the following:
  • Go to the configuration tab in the VMware client after highlighting your ESXi server. Click on the storage link under Hardware. Then click on the add storage link.
  • Select Network File System from the options presented to you and click next
  • In the Server field type in the IP address of the server that is hosting the NFS share, in my example it would be 192.168.2.10
  • In the folder field type in the NFS folder name. With most products the folder naming convention will be the drive letter first and then the share name. If you are using Windows Services for Unix it will probably just be the share name. On my Vista machine my external drive is the X drive and the share is VMware backups. So the NFS path is /x/vmwarebackups and that is what I would type in this field. If I was on a Windows 2003 server using Windows Services for Unix and shared out the same share the path would just be /vmwarebackups and then that’s what I would type into the field
  • Type in a name for the datastore, you can call it whatever you want. For example I will name it backup and then click next. Do not select the mount NFS As read only option.
  • Then finish off the wizard by clicking finish and you’re done. You will now notice you have a new piece of storage called backup listed under storage.
  • You can now test to see if the path exists by changing directory to it in an SSH session. Type in cd /vmfs/volumes/backup and that should switch you into that directory. Then try and create a file in that directory or make a new directory with the mkdir test command and it should create a folder for you called test. If this works, then this verifies for you that you have write access to this share.
    Now you need to edit the script and change the options to suit your tastes. The way you edit the script is as follows:
    Edit ghettoVCB.sh by typing in vi ghettoVCB.sh while you’re in the directory where you moved ghettoVCB.sh

Edit the following lines in the script, the script is nicely commented to let you know how to set up the parameters

  • VM_BACKUP_VOLUME=/vmfs/volumes/backup (this is the path of your NFS share)
  • ENABLE_2GB_SPARSE=0 (set this to 1 if you want to split your VMDK into 2 GB files)
  • VM_BACKUP_ROTATION_COUNT=3 (Number of backups you want to keep before it deletes old ones)
  • VM_BACKUP_DIR_NAMING_CONVENTION (I just leave this as is, it’s fine the way the default is setup)
  • POWER_VM_DOWN_BEFORE_BACKUP=0 (I change this to 0 so I can do a live backup without shutting down the virtual server)
  • ENABLE_HARD_POWER_OFF=0 (I change this to 0 to disable hard power offs)
  • ITER_TO_WAIT_SHUTDOWN=4 (I leave this as is, it’s not applicable in our case since we’re not using hard power offs)


After setting this all up then you can save the ghettoVCB.sh script file and now you’re ready to run it. From the ghettoVCB.sh directory type in: ./ghettoVCB.sh vmbackups (this will run the script with the input file list of your virtual machines) and the backup will run and present to you a percentage progress counter as it backs up your virtual machines. You will notice that the counter will count fairly slow. Backing up to NFS is never a quick thing so keep that in mind and have patience.


The script will fail if you made any errors in the input file in regards to case sensitivity and it will also fail if there are any errors with the way you mounted your NFS share. In a future blog I will cover how to properly configure Windows services fo Unix to mount an NFS share.


You will remember that I asked you to download plink.exe previously. This is what you will use to create a Windows scheduled task that will log into the server and execute the ghettoVCB.sh script. In my next blog entry I will show you how to create this scheduled task.

-RP

Backing up your virtual machines in VMware ESX and ESXi for free with GhettoVCB!

Hi everyone! In today's virtual word, backups are more important than ever. The ability to put tons of virtual machines on one single server gives you great consolidation ratios but unfortunately also puts all your eggs in one basket. With a risk like that you need to backup those virtual machines.

Now it's very easy to go out there and buy the pay for versions of various pieces of software that leverage VMware's VCB to do the backups of the VMs. But what if you are running the free version of ESXi? How do you backup your VMs then? Well never fear, William Lam, the guy famous for all his scripts has come up with a script called GhettoVCB!

This script allows you to backup all your VMs hot (while they are running) to storage. An easy way to do this is to setup an NFS share and then configure his script.

Here are some of the cool features of GhettoVCB:
How many backups to keep

  • Split backups into 2GB files
  • Backup virtual machine live, or shut it down first before backup
  • Hard power off virtual machine if it doesn’t respond to a guest shutdown command

If you’re interested in implementing this, please read my next blog entry on how to use this wonderful script that William has provided us with. You can also find many of William’s other scripts here at this script web site.

-Cheers, RP

How to Enable SSH Access in VMware ESXi

Hi folks, one of the most common questions I get is how do I enable SSH access in VMware ESXi? Well luckily this is extremely simple!

First, go to the console of your ESXi server. Then follow the following directions:

  • From the ESXi console hit Alt-F1
  • Type in the word unsupported and hit enter (you will not see the characters appear on the screen)
  • Type in your root password
  • Edit the /etc/inetd.conf file by typing in vi /etc/inetd.conf
  • Scroll through the file until you find the line that says #ssh and delete the # sign and save the file
  • Now you can reboot the ESXi server and you will have shell access
    Alternatively you can run the /sbin/services.sh restart command to restart the management services without rebooting the box.

That should do it!

-Cheers, RP