Search This Blog

Wednesday, December 01, 2010

Xen Cloud Platform (XCP), ISOLINUX, Boot CD

This is really just a quick note for myself to remember what I did to allow me to get the XCP 0.5 installation CD to run on my demo machine.

The problem I had was that I was getting a APIC timer error during the boot process, It suggests to boot using the noapic option, however I had no idea how to change that.

Anyway it took me ages, and I won’t bore you with details.

Extract the files from the iso to a folder.

You will find in that folder structure the following folders

\boot\isolinux

In there is a configuration file called isolinux.cfg, this is what we need to edit.

The isolinux config is set to boot with the default label install, so we need to change either the label entry, booting to another set of boot paramters or just change the paramters under the install label. I went with the later.

LABEL install
    KERNEL mboot.c32
    APPEND /boot/xen.gz dom0_mem=752M noapic acpi_skip_timer_override com1=115200,8n1 console=com1,vga --- /boot/vmlinuz xencons=hvc console=hvc0 console=tty0 --- /install.img

The added paramters are in bold. Ok now I saved this file.

Now to rebuild the bootable iso. For this I used mkisofs (on windows you can download cdrtools that contains this and the necessary cygwin dll)

L:\Software\~freeware\Xen>mkisofs -o bootcd.iso -b boot/isolinux/isolinux.bin -c
boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -iso-level 4 -boot-info-
table L:/Software/~freeware/Xen/XCP-base-0.5

My iso was extracted to L:/Software/~freeware/Xen/XCP-base-0.5, so I created a new iso called bootcd.iso.

And that was that, burnt to a cd and then ran on the computer. Now I need to work at wtf I am doing to actually install xcp. Smile


Share/Bookmark

Sunday, November 07, 2010

Fedora 14 and Windows Networking. (Samba/Netbios/smb)

I wanted to be able to browser and connect to my windows network from the fedora machine.  Here are the hoops I went through to get this working in FC14. Below I only detail how to setup samba to allow connectivity and browsing of windows boxes from linux. I do not detail how to setup smb shares on linux box to allow windows servers to connect to linux.

Install samba

I installed samba in the add/remove software gui.

  • “Server and Client software to interoperate with Windows Machines”
  • “Files used by both Samba servers and clients”
  • ”Documentation for the Samba suite”

all for version samba-3.5.6-69.fc14.

Configure Samba. (etc/samba/smb.conf)

Open smb.conf for editing and change/add the following lines

  • workgroup = <your workgroup>
  • netbios name = <the name of you linux box>
  • name resolve order = bcast hosts lmhosts wins

The name resolve order is important, I did not have a wins env and wanted to allow the broadcast method to resolve machine names. Without the bcast entry you will be unable to browse the windows Network. I was getting “Unable to Mount”/”failed to retrieve server list” until this entry was added. What I faound was that I was able to directly enter ip addresses into Nautilus and connect to windows servers, however actual machine names would not resolve.

Configure the firewall (ensure you apply)

  • System\Administration\Firewall
    • Allow the samba services client and server.

WinBind (not needed but mentioned for clarity)

It must be noted here that there is an additional service windbind, that can allow you to integrate into a windows domain and authenticate againt the users in that domain on the linux box. I was only using this within a home env with no PDC so had no need for this. I include here incase you are heading that way, you will need to look into this.

Other utilities I installed

It must also be said I installed a couple of other utilities to help me along the way.

system-config-services 0.99.47-1.fc14
services viewer (actually views daemons), an interface like windows services.


Share/Bookmark

Thursday, November 04, 2010

Config Dell Remote Access (DRAC) via Windows CMD

I recently discovered that you can configure the DRAC from within windows. If you have installed the DELL server administrator.

You can configure from the command line, using the racadm exe.

racadm setniccfg –s <drac ip> <drac subnet mask> <gateway>

racadm setniccfg -s 192.168.x.x 255.255.255.0 192.168.x.x

I had to setup some servers that already had windows installed. Normally I configure the DRAC via the boot menu. As you can see you can do it without rebooting.

Not sure what other items you can configure but hopefully this will point some people in the right direction.

note: the racadm is in the following location (although I believe it is added to the system path so should run from anywhere).

C:\Program Files\Dell\SysMgt\RAC<versionnumber)\


Share/Bookmark

Monday, August 16, 2010

Where has my memory gone? or locating that leak…

A few days ago I had to deal with an ColdFusion server that had stopped server page requests. The server could be contacted and using RDP it could be controlled however any request for a ColdFusion page was met with nothing.

After looking around and finding nothing obvious the CF service was restarted. This solved the problem, however I did notice that the amount of used memory had not reduced fully. The machine itself has Windows 2008 R2 with 32GB of RAM with CF set to take up 20GB, usually on a CF restart the amount of used memory would drop to a couple of gig. However used memory was still at 17Gigs. I started task manager and looked at the running processes, nothing was taking up 17Gigs worth of memory. Where had this memory gone? Then I noticed the non paged pool memory setting, nothing I usually look at but lo and behold it was sitting at around 17Gigs.

So what was this and how do I fix it. To cut a long story short, after some research I eventually established that this type of behaviour was indicative of a memory leak (memory being used by a process/driver but not released).

So while the restart of the CF server had rectified the issue in the short term, with 17Gig still assigned and unusable CF was going to run into the same problem again (and if the leak kept on growing each time CF restarted there would be  less and less time in between each restart).

The machine was rebooted, this gave us back 17Gigs, and of course gave us longer. In the meantime I set about trying to track down the memory leak.

The screen shots below shows the NonPaged pool size (bottom left 3088MB), not with the 17Gig but with 3Gigs (it was sometime after the reboot).image

So how to track down what was causing the memory leak. Now this is when I came across the excellent Mark Russinovich’s Blog entry

http://blogs.technet.com/b/markrussinovich/archive/2009/03/26/3211216.aspx

Mark Russinovich is a god among Windows people, his sysinternals tools are legendary and since joining Microsoft he has kept up this good work.

The article is a good read and I recommend readin it all, but the section we are interested in is Tracking Pool Leaks.

This article led me onto poolmon, it was a pain to get as I had to download the Windows Driver Kit from Microsoft, although I only needed the poolmon tool. Why microsoft don’t allow this to be downloaded seperatly I don’t know. ANyway I downloaded and installed the WDK locally and then copied the poolmon.exe to the offending server.

On running poolmon you get the following

image

Ok, now you can go and read up about all the bits and pieces here, as I am not going to go into (as I don’t fully understand it all). But there are a number of ways to filter and order the list.

Press B to order list by Bytes

Press D to order the list by Diff

Press F to order list by Frees

Press A to order the list by Allocations

Press P to toggle between listing Paged, NonPaged and Paged & Non Paged

OK, now with the above commands I was able to track down my memory leak to a specific driver. I listed only Nonpaged (pressing P a few times) and then ordered by Bytes. Now a memory leak is identified by a lot of Allocation and a free value that doesnot correlate (ie. not a lot of frees compared to allocations, memory is allocated but not freed). As you can see from my list the Tag BLFP stands out instantly, now as I understand your memory leak may or may not be as obvious as this, and if thats the case I believe you need to track figures this is covered in Marks Russinovich’s article above.

Now with the TAG code identified I did a look on the net, as you will see from Mark’s article you can search the system for the offending driver which I was going to do, but thought I would give google a go, and for once I was lucky and stumbled across someone who had gone through the same issue.

The fault lied with the Broadcom Virtual Network Adapter used for teaming the NICs together on A Dell R710. So in the end all I needed to do was to download the updated version of the Broadcom Management Application that would up date this virtual adapter driver.

I hope that makes sense, I have tried to summarise, simplify and explain what I did. I took a shortcut in not tracking down the driver and googling, so you may have to go and do some work here but hopefully this will get some people started.

Update: To get the update for the Virtual Adapter you don’t want to download the physical adapter drivers. You need to download the Broadcom Management Application Installer, this contains the virtual adapter driver. Link below is shortcut to download page (skip past the physical adapter downloads, unless of course you want to update those to.)

http://www.broadcom.com/support/ethernet_nic/netxtremeii.php

Cheers


Share/Bookmark

Thursday, August 05, 2010

Ensure USB uses assigned Drive Letter

Recently I had to find a way to ensure that a USB drive connected to a computer always picked up the same drive letter.

Now the server was Windows 2008 x64, and whenever a usb drive was plugged in it picked up the next free drive letter. I wanted to ensure that the drive letter was G:, however this was not the next free drive letter. I tried changing the drive letter in COMPUTER MANAGEMENT/DISK MANAGMENT however every time the disk was disconnected and reconnected the drive would get assigned the next free drive letter.

I then stumbled across the following application.

USBDLM. http://www.uwe-sieber.de/usbdlm_e.html

Its free (for home use) and suits my purpose perfectly. Just copy to a folder, click install to setup the service and then its just a matter of setting up the config file USBDLM.ini. All I did was set it up so that when a USB drive was connected the next drive letter assigned would be G:

-------------------------- the drive letters ---------------------------------

;here you can define new default drive letter for USB drives
[DriveLetters]
Letter1=G
Letter2=
Letter3=


;here you can define drive letter that shall never be used for new local drives
;configure here your network and subst drives here but no local drives!
[NetworkLetters]
Letter1=G
Letter2=
Letter3=

It has other options but this was enough for me.


Share/Bookmark

Wednesday, June 30, 2010

Automating Installing/Importing pfx (certificate) from command line (certutil) on remote servers.

note: Please also this article

A few days ago I had to sit and install a new certificate to a number of servers. These servers did not exist in an AD environment so using group policy was not an option.

However I thought I could some how script this. I have written a few batch files in the past to execute on a remote server and to do this I used the sysinternals tool psexec. So all I needed was how to import from the command line.

I found that certutil.exe ( a free ms tool) which appears to come with windows 2003 server+ could probably some how do what I wanted. However just using the help I could not see a command to import a pfx, however after trawling Google for a while I found that there is a command but it just does not appear to be list in the certutil help (certutil /?).

So I used the following command

certutil –f –p <passwordOfPfxFile> –importpfx <filelocation>

-f : force overwrite of certificate

-p: Password of the pfx file

This command will install the certificate into the personal store of the computer account. There are additional commands to install to other stores and locations, such as “–user My” which put it into the personal store if the user, and –addstore ca. Please look up these as I only include here as a quick reference.

This command worked a treat on the local machine, so now it was just a matter of getting it to run remotely.

psexec –u <username> –p <password> \\<servername> certutil -f –p <pfxpassword> –importpfx <pfx File Location>

-u: remote server username.

-p: remote server user password.

I used the psexec command and stored the pfx file in location accessible to all servers (a unc path).

Now all I needed to was to loop through all the servers, I did this by setting up a file with all the servers listed in it. Then created two batch files one to loop through the server list and pass each server to the second batch file which contained the psexec statement above.

BatchFile1

FOR /F "tokens=1 delims= " %%G IN (.\serverlist.txt) DO batchFile2.bat %%G

This command loops through the serverlist.txt file, %%G will be the servername retrieved from the serverlist.txt file and then passed to the batchfile2.bat

BatchFile2

psexec –u <username> –p <password> \\%1 certutil -f –p <pfxpassword> –importpfx <pfx File Location>

This command takes the first parameter passed to the file (%1, the servername) and runs it via psexec on the server.

p.s

Windows2000, I found that the certutil for windows2000 moaned about the –p parameter. I got round that by copying the following files from a windows 2003 server to a temporary location on the windows 2000 servers. the call to the certutil then had to be the full path (it couldnot rely on the system path).

certreq.exe, certutil.exe, certcli.dll, certadm.dll

psexec –u <username> –p <password> \\%1 c:\templocation\certutil -f –p <pfxpassword> –importpfx <pfx File Location>


Share/Bookmark

Sunday, June 27, 2010

ShrewSoft / Cisco VPN Client– periodic disconnection

I recently had to setup the shrewsoft vpn connection for work, this was maninly due to the fact they were rolling out Windows X64 and the cisco vpn client did not support the x64 environment.

Now the shrewsoft vpn client is great, and all I did was import the cisco *.pcf files from the 32bit vpn client. And connectivity was established.

However of the two connections I setup I found that while they initially connected, after a set amount of time one the connections would disconnect with the error

“Connection terminated by gateway”

This was a tad annoying, and I could see no cause. However I eventually managed to establish that the timeout matched exactly to the setting on the firewall.

After trawling the internet, not really understanding what was going on, although pretty sure this setting was the culprit as the times matched (1000 seconds, 16 min 40 seconds), I stumbled across this.

http://www.cisco.com/en/US/products/ps6120/products_tech_note09186a00807e0aca.shtml#solution06

What it eventually came down to was a mismatch in values between the firewall and the client. Now as far as I am aware this disconnection will only occur if the lifetime value on the client is greater than the firewall. (I don’t really understand why it connects once and then craps out).

Now the solution is to set the lifetime value in the client to the same value or less than on the firewall. This then means when the period is reached the client and the firewall can negotiate a new key.

Here is where the setting is in the Shrewsoft vpn client.

image

here is the setting in the cisco firewall

isakmp policy 1 lifetime 1000


Share/Bookmark