oktober 2008 - Posts

remember to align your partitions
29 okt 2008 13:55

Nothing new, but still important. Always remember to align your partitions no matter if the server is virtual or physical. (check with storage provider first, but in 99% of cases its a good idea)

Here is a really good guide from VMware which explains the process for both Windows and Linux guest OS.

http://www.vmware.com/pdf/esx3_partition_align.pdf
http://blogs.vmware.com/vmtn/2006/12/keeping_up_with.html

Also check out this post if you want to set alignment for the boot partition. 2008 and Vista aligns correct when creating partitions, no need to modify.

extending boot volumes on virtual machines
28 okt 2008 17:14

It's very easy to extend volumes on VMs running on ESX server. with 3.5 U2 this task can be done while the machine is powered on.

The tricky part comes when you want to extend the boot volume, in regards to Windows Guest OS.
There's no problem in extending the .vmdk file for the VM, but getting Windows 2000/2003/XP (2008 / Vista can extend directly through disk manager) to see the changes is not possible without using 3rd party tools.

There is a free alternative to using for example Acronis Disk Director (others tools might do the same, its the only one i know of) and its called winPE.
winPE comes with the Windows Automated Installation Kit (WAIK)
Its a massive 1.3GB download, but includes all the tools you need for making automated Vista and Server 2008 installations. There are loads of guides on using those tools out there, this post just shows how you can create a winPE bootable ISO for use with extending volumes.

After you download and install the WAIK package (Newest version 1.1, which includes winPE 2.1) browse to C:\Program Files\Windows AIK\Tools\PETools (or where you installed WAIK)
Run the following commands from a command prompt:

Create a PE folder structure (the target folder must not exist in advance)

copype.cmd x86 c:\winpex86

to make some modifications mount the image: (imagex.exe is located in the \tools\x86 folder under WAIK installation)

imagex.exe /MOUNTRW c:\winpex86\winpe.wim 1 c:\winpex86\mount

Change input locale to danish: (or any other language code)

intlcfg.exe -INPUTLOCALE:da-DK -IMAGE:c:\winpex86\mount

Change timezone (Changes to GMT+1)

peimg.exe /timezone:"Romance Standard Time" c:\winpex86\mount

Prepare the image:

peimg.exe /prep c:\winpex86\mount

Unmount and commit changes:

imagex.exe /UNMOUNT /COMMIT c:\winpex86\mount

The image is now ready to be used as either a bootable ISO og for booting using USB. For guidance on how to create USB bootable device, see the included WinPE.chm "Walkthrough: Create a Bootable Windows PE RAM Disk on UFD".

Create a bootable ISO file:

oscdimg -n -bc:\winpex86\etfsboot.com c:\winpex86\ISO c:\winpex86\winpex86.iso

Now its time to upload the ISO file to your virtual environment (ESX, Hyper-V, Xen and so on, this should work for all of these platforms, i have only used on ESX)

First expand your virtual machines OS disk, and boot on the ISO afterwards.

The tool you need to use is the good old diskpart. After you have booted the VM on the ISO, run diskpart:

diskpart

To view if the expanding has been recognized by the OS type:

list disk

You should get an output similar to the picture below.


Disk ###  Status      Size     Free     Dyn  Gpt
--------  ----------  -------  -------  ---  ---
Disk 0    Online        16 GB  6150 MB

Note that the Free says 6150, this means that the disk has available capacity and that you can extend.

To know which disk and volume to target, run the following commands before you use select

list disk
list volume

After running your select tasks, run list again to verify you have selected the correct disk/volume. The selection is marked with a *.

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
* Volume 1     C                NTFS   Partition     10 GB  Healthy    System

When you have the correct target, just type:

extend

Woila! disk capacity on the boot volume is now extended. When you reboot the host (jyst type exit in the cmd prompt) Windows prompts that is has found and installed new hardware. Just accept the reboot, and you should be ready to go.
This is not supported in any way by Microsoft! I have done this on 100+ servers, and never had any issues - but usage is at your own risk.

This method can also be used to initially create the installation partition with the correct alignment, does not matter if the server is virtual or physical.

over and out.

equipping your VMware VI toolbox!
28 okt 2008 0:20

This post aims to bring you up to speed on whats out there, in regards to ease administration of the VMware Virtual Infrastructure.
Since i'm lazy and dont like doing the same thing twize, a lot of these "tools" are based on scripting since its the road to automation (and perhaps freedom?)

VMware: VI Toolkit (For Windows)
This should be installed everywhere! (where you have VI that is) It extends on Windows PowerShell, which in turn also makes it require .NET FrameWork 2.0 and ...you guessed it - PowerShell!
A set of CMD-lets are installed which makes a lot of things way easier, instead of using the sometime dreadfull VI client.

Get-VMHost | Get-VMHostStorage -RescanAllHBA

The above task makes for a nice hell'ish experience if done manual. with VI Toolkit its just a simple one-liner.
For more examples, check out the public available LAB manual from VMworld Europe 2008

If you are just getting started using Powershell, this post from Jakob H. Heidelberg basically lists all you need for getting started. For more VI toolkit specific examples,
check out Hugo Peeters blog at http://www.peetersonline.nl/. Thats world class VI Toolkit examples right there!

There's a new version on the way, which builds in the PowerShell 2.0. (Currently CTP) New CMD-lets are to be expected, but the really cool thing will be the Community Extensions.
It's going to make new functionallity really fast to develop, and at the same time easy to make available to the public.
To have a read at that, head over to the project site, and the VMware official VI Toolkit blog for more information.

VI Toolkit is all great, but what would be even greater was if you could run those nifty scripts directly from the VI client. Well you can - icomasoft VI PowerScripter.
Currently Beta 2 does exactly that. Its a plug-in for the VI client, and adds easy to use right-click options for running scripts.
This really adds to the user experience, especially if you have admins who get all crazy and hostile if you mention CLI and scripting. Give it at go at icomasoft http://www.icomasoft.com/products/vi-powerscripter.html
There are also script examples available, so you can get a taste of the functionallaty right out of the box. PowerScripter sample scripts.

That sounds nice, but how on earth do i write all these glowing lines of code to save mankind you might ask? PowerGUI comes to mind. It lets you see PowerShell output in a GUI, without having to dive into the dark corners of the command line. It also includes a really nice editor, which makes it somewhat easier to develop scripts compared to using notepad.
PowerPacks is where it gets really good (besides being free-of-charge, by Quest Software). PowerPacks are add-ons to the PowerGUI, and currently supports stuff like Vmware VI, Exchange 2007, Hyper-V, Operations Manager and so on.
For a complete list, and download of the program check out http://powergui.org/
Personally i also use another editor, called Primalscript Enterprise (By SAPIEN technologies). It's however not freeware, but it makes for one hell of a program if you are all about vbscript, PS, perl etc.
Trial versions are available at http://www.primalscript.com/
UltraEdit, TextPad, Notepad++ are some amongst other tools you might want to check out before settling on the above mentioned.

VMware Infrastructure Remote Command Lince Interface (RCLI)
Most people learn about the RCLI when they want to use Storage Vmotion. There are however other things to the RCLI then svmotion.pl. Its a collection of perl scripts which add some of the same functionality available in the COS.
It's also the only way to go COS-wannabe if you have ESXi in your environment. The RCLI package comes with approx 25-30 scripts to get you started, and these have roots in the esxcfg- and other COS related commands.
You can download the RCLI here, and ther is also a full documentation on the included scripts.

CLI might be your best friend in a lot of situations, but when it comes to using Storage Vmotion, it just doesn't hold up. The first ever 3rd party VI plug-in made a nice integration for using Storage Vmotion as it was ment to be used. SVMotion plugin by "akutz" is one of the more usefull plug-ins out there. This is really a plug-in you should always install to your VI client, and its the way VMware should have implemented Svmotion usage to begin with.

Backup made easy: VizionCore vRangerPRO:
This is a really cool program, which makes backup of VMs a joy to work with. If i'm at a small customer, i almost always point them to buy vRangerPRO since it makes the backup process so much easier. Even if you already have a backup program, which can piggy-bag VCB, chances are vRangerPRO makes the backup process easier and more flawless. You can download a trial version - give it a try, im sure you'll like it!

Accessing your ESX servers:
Say COS and chances are someone will stand up and yell: PuTTY! Thats my most beloved tool for connecting to ESX servers, free and easy to use with a lot of features.

When dealing with files on the ESX servers WinSCP could be worth checking out. Its a SFTP and FTP client for windows, which is really handy when working with files on ESX servers.

Copying files over SCP is not the fastest thing in the world. If you are uploading big ISO files, vmdk or whatever big files, Veeam FastSCP is your best friend. Dont know how it works, but its way faster then WinSCP when dealing with large files.

 

I'll update this post whenever i stumple upon something new which goes into my VI toolbox, and the things i have missed - please feel free to post those in comments:) 

 

 

now this is green IT!
22 okt 2008 22:15

A friend of mine set out to build a box for running his test environment.

The goal was to build a small and quiet box, that didnt use much power either. He found a complete system, which is based on mini-ITX standards, with the brand new Intel Atom 330 Dual Core. (See bottom of this post for links to the hardware described)

ESXi Free was chosen as the hypervisor. (the box gotta have som style right?)
That however proved a small challenge in regards to the onboard NIC (realtek...) which is not supported by ESXi. Since this is a very small box, only 1 PCI expansion is allowed which required a PCI-riser card.
He went with an old Intel 100Mbit adapter. There is no reason why a 1Gbit card should't work, this was just a cheaper solution.

Since the casing is very small, it only supports 1x3.5" HDD. A mod was done to accomodate 2x3.5" HDD. That mod means that there is no longer space for a slim-line CD/DVD-Drive. So if you need that old and slow kind of storage devices, this mod is a no-go :)
He made his ESXi boot of external USB storage, which was done by following this guide. This makes it far easier to change HDD (when/if u have 2...) without having to re-install the hypervisor.

Performance on the box is pretty decent but dont expect it to redefine speed though. 3-4 VMs with 512MB memory each should not be a problem, especially not when you take advantage of memory page-sharing.

Power consumption is down to only 35w, and thats with 1 x 500GB SATA drive.

The price for running this polar-bear-hugging-co2-friendly mini server a year:

( 35 / 1000 ) * hours_running * kw_price (Which in my friends case is approx. 600 dkr a year)

Hardware: (approx prices in dkr)
PROconsult Mini ITX - Intel Atom 330 (2600 dkr)
Official PCI riser card (MiniPC.DE) (150 dkr)

Some pictures:

Server 008 new_riser

Server 018 vi

server_power

freespace - my take on the ever filling disks...
20 okt 2008 22:26

Hi,

And welcome to this first-ever-post. (on this blog that is...)

This blog will be about scripting (wmi, adsi, powershell, toolkit etc.), virtualization, windows, vmware, automating boring processes....well anything thats non-analog actually!

So on to the content of the first blog;

The script does kinda what it says: report freespace. It outputs to either Excel og HTML, with the option of sending the script in an email.

First rename to .vbs, and run the script without any arguments for help on using the script.

Hope you can use it - feel free to comment.

rasmus