Archive for May, 2009

Installing Windows 2008 via USB thumbdrive

Thursday, May 28th, 2009

Windows 2008 comes only on DVD and today you’d think every computer has a DVD drive by default, unfortunately most servers are ordered without them and that causes a problem obviously. Your choices would be to break the DVD into CD-ROMs (not fun) install over the network (a little more work than I wanted to do) or find another means to get it up. My solution, USB Thumb drive

Since Vista and Windows 2008 share the same code base, I figured someone must have found a way to boot vista off a thumb drive so I looked and found just that. Kurt Shintaku has a how-to on how to install Windows Vista from a high speed USB 2.0 Flash Drive.

Before you begin though, if your thumbdrive has U3 installed on it, you’ll probably want to remove that (I did just to be certain), here’s instructions on how to do that: http://www.u3.com/uninstall/

Using Kurt’s instructions this is all it took:

Format the thumb drive
1. from a DOS prompt execute: diskpart
2. list disk
3. select disk 1 (assuming disk 1 was your thumb drive in the above list disk command)
4. clean
5. create partition primary
6. select partition 1
7. active
8. format fs=fat32
9. assign
10. exit
Copy the Win2008 install files

1. xcopy d:\*.* /s/e/f e:\ (assumes your dvd is drive D: and your thumb drive is drive E:\, adjust accordingly)

Vi Survival Commands

Thursday, May 21st, 2009
Command Action
vi Starts the Vi editor
vi <filename> Starts Vi and opens the given file for editing
:q! Exits the Vi editor without saving changes (quit!)
:wq! Exits the Vi editor and saves changes (write and quit!)
:set nu Turns on line numbering
esc Exits text insert mode
i Enters text insert mode
Arrow keys Navigates the cursor
Backspace key Deletes previous character
Delete Deletes selected character

Vi has two different running modes: command mode and edit mode. In command mode, every keystroke is interpreted as a command and performs file functions such as editing and saving. These commands are referred to as colon commands because they start with a colon. You know you’re in command mode because you won’t see “INSERT” in the lower-left corner of your display. The lower-left corner should display a colon when executing colon commands. If you have any doubts as to what mode you’re in, press the Escape key (several times) to enter command mode.

In text mode, typed characters are echoed to the screen and temporarily become part of the open document. Enter text mode from command mode by typing a lowercase i (for insert mode). Use the arrow keys to navigate the cursor, and use the Backspace and Delete keys to remove characters. To quit without saving your current work, or to save your current work and quit, refer to Table 5-3.

Changing the IP address of service console in ESX 3.x

Thursday, May 21st, 2009

If you want to change the IP address of the service console in ESX 3.x you can using a command in the service console. Read on for more.

To change the IP address of the ESX 3.x host, you need to change the configuration of the vswif. By default this is vswif0 and this is assumed in this document. Login to the service console with root permissions, either by using root or doing a su – to get the permissions.
Once in the service console runt the command “esxcfg-vswif -d vswif0“. This command deletes the existing vswif0. Don’t worry if you get a message about nothing to flush. Then you need to run the command to change the ip address, subnet mask and broadcast address. They are also specified in that order when the command is given. An example command is below.
esxcfg-vswif -a vswif0 -p Service\ Console -i 10.1.1.1 -n 255.255.255.0 -b 10.1.1.255
In this command the -a switch is to add a vswif, the \ in the Service\ Console is deliberate, the -i is the ip address, the -n is the netmask and the -b is the broadcast address.
You now need to change your default gateway, you can do this by editing the network file located at /etc/sysconfig/network. To do this at the command prompt, follow the steps below.
cd /etc/sysconfig
vi network
Then while in vi, go to the location of the default gateway using the arrow keys.
Hit “i” which will perform an insert and change the default gateway to your liking.
Hit the escape key twice to exit insert mode.
type “:wq!” to write (i.e save) and quit.
At this point you can run some commands to restart the vmware management, but I prefer to restart the server and will recommend you do that. Once the server comes up there are a few things that still need to be done for management in virtualcenter.
Open a remote console to your virtualcenter server, do a ping <yourESXhostname> to make sure the ESX host is pingable after the IP change. Make sure you are seeing the new IP address and it is assumed you have already changed that in DNS. If you are seeing the host correctly, open virtualcenter and disconnect then reconnect the host.
Once the host is connected in virtualcenter we need to change a few bits of configuration information, namely the vmkernel ip address, subnet and gateway. This is so we can vmotion correctly. Click on your host and bring up the configuration tab. Select networking and then properties on the vitual switch.
Select your vmkernel and hit the edit button. Change your ip address here for vmotion and subnet mask. You will not be able to change the default gateway until you hit ok and go back in. Once you have selected ok, then hit edit again on the vmkernel. Select the edit button on the default gateway and change the default gateway on the menu that appears. Select ok, ok again and then close.

Please note all the commands in this document should be used without the “”.