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

Thursday, June 24, 2010

Identify Internet Explorer x86/x64 on Windows 7 taskbar

I had Internet Explorer pinned to my task bar, however I found that sometimes when I clicked on some links IE would open as a separate icon on my task bar instead of grouping with the IE that was pinned. (the image below shows this –please note it shows my new icon identifying the 64 bit version (right), the left IE icon is the pinned 32bit version)

image

What I discovered is that these links were opening with IE x64. I wanted to be able to distinguish between the two. So I have created an icon for IE64 saved this .ico file to my windows folder, then in my “all programs” menu I have gone to the properties of  IE 64bit and selected change icon, now browse for the icon and click ok.

image

Now in your start menu right click on the IE64 and select “pin to taskbar”. And that's it, now when you fire up IE32 bit they will be grouped with 32bit version and IE64 will be grouped with the 64 bit version, and you can easily identify which version you are running.

image

If you want the icon file its here

http://sites.google.com/site/mumblestiltskinny/IE64_multi.ico


Share/Bookmark

Monday, June 07, 2010

Samsung i8910 (HD, icon) – Totally refresh music library

I had an issue with this phone and the music library, it kept adding duplicate entries of random music. Even when I removed the music from the phone the other entries where still there! To me it looked as if music player was not working correctly.

In the end I traced the problem down to Windows Media Player (WMP) on my desktop machine, and the setting that copies music you play in WMP to a portable device you have connected. So whenever I had my phone connected while I was using WMP, it was merrily copying the music to my phone!

However back to the article topic, while trying to figure out what was going on I was trying to find a way to clear out the music player on the phone, and I did.

The music library for the music player is held in a file called mpxv2_2.db. So just search your phone for this file, I just connect the phone to the pc in mass storage mode and use windows search. However you should find the file in the following folder

<driveletter>:\Private\10281e17\

Also of note is the file may be a derivative of mpxv2_2.db, my file was actually [101ffc31]mpxv2_2.db. Just delete this file and fire up the music player, it will trawl your phone again and create this library file.


Share/Bookmark

Wednesday, May 19, 2010

Windows 7 XP Mode – MSI install error over RDP

I came across this issue when trying to setup a program to run in XPmode on my Windows 7 box.

“The Windows Installer does not permit installation from a Remote Desktop Connection)”

While the error seems to point at RDP connection being the issue (and it is sort of) it is actually due to the fact that I am trying to run the installer from one of the Terminal Services file shares (\\tsclient).

To get round this error do 1 of the following

1. Copy the file to the XPMode local drive (C:, for example)

2. connect to your machine via a UNC (i.e \\192.x.x.x. or \\<machine-name>)

3.Map a drive to the tsclient (i.e \\tsclient\C , \\tsclient\D)

Cheers


Share/Bookmark

Thursday, May 13, 2010

Windows 2008 x64 – Server Manager Errors (HRESULT:0x800F0818 / HRESULT:0x800B0100)

I inherited a number of Windows 2008 x64 boxes with the server manager utility failing with the error code HRESULT:0x800F0818.

Only having limited time and the fact that the servers functioned and updated, it was deemed not critical. However with the server manager not functioning you will soon discover you cannot change the function of the server. Add/Chaging roles or windows features becomes impossible.

I recently came across the article and it has solved my issue

http://blogs.technet.com/roplatforms/archive/2010/05/12/how-to-fix-server-manager-errors-after-installing-updates-hresult-0x800f0818-hresult-0x800b0100.aspx

What I want to do is detail how I ran through the procedure. Please ensure you reference the blog above, I used the reg files to enable take ownership in the context menus and that works treat.

The fix hangs around the System Readiness Tool, available from MS. This tool is often updated so ensure you have the latest version.
http://support.microsoft.com/kb/947821

This tool will attempt to fix some problems automatically, so what I do is run this tool twice. This really just makes the log easier to read, as the log on the second run is just errors and does not include the fixes it did on the first run.

At the bottom of the log it will list all the errors (see below)

Unavailable repair files:
    servicing\packages\Package_for_KB969897~31bf3856ad364e35~amd64~~6.0.1.0.mum
    servicing\packages\Package_for_KB972260~31bf3856ad364e35~amd64~~6.0.1.1.mum
    servicing\packages\Package_for_KB972594~31bf3856ad364e35~amd64~~6.0.1.0.mum
    servicing\packages\Package_for_KB973346~31bf3856ad364e35~amd64~~6.0.1.0.mum
    servicing\packages\Package_for_KB973525~31bf3856ad364e35~amd64~~6.0.1.3.mum
    servicing\packages\Package_for_KB973565~31bf3856ad364e35~amd64~~6.0.1.0.mum
    servicing\packages\Package_for_KB974455~31bf3856ad364e35~amd64~~8.0.1.0.mum
    servicing\packages\Package_for_KB974469~31bf3856ad364e35~amd64~~6.0.1.0.mum
    servicing\packages\Package_for_KB969897~31bf3856ad364e35~amd64~~6.0.1.0.cat
    servicing\packages\Package_for_KB972260~31bf3856ad364e35~amd64~~6.0.1.1.cat
    servicing\packages\Package_for_KB972594~31bf3856ad364e35~amd64~~6.0.1.0.cat
    servicing\packages\Package_for_KB973346~31bf3856ad364e35~amd64~~6.0.1.0.cat
    servicing\packages\Package_for_KB973525~31bf3856ad364e35~amd64~~6.0.1.3.cat
    servicing\packages\Package_for_KB973565~31bf3856ad364e35~amd64~~6.0.1.0.cat
    servicing\packages\Package_for_KB974455~31bf3856ad364e35~amd64~~8.0.1.0.cat
    servicing\packages\Package_for_KB974469~31bf3856ad364e35~amd64~~6.0.1.0.cat

Use this list to grab the updates you require. In my experiences for the IE updates make sure you grab the right update, some will be for IE7 and some for IE8 (if installed).

The procedure is a pain in the ass, but I found downloading the updates first and then go about extracting and renaming the files was the best option as you get into a routine. Once renamed I would copy into the packages folder.

Then run the SUR tool again, and hopefully no more errors… :o)

Additonal benefit on failed KB951847 .Net update

As an aside I had an additional issue on a couple of boxes in that I could not apply the following update. KB951847 .NET Framework 3.5 Service Pack 1. I had the full standalone update. I would try and install this update, and it would instantly error (ungracefully).
However after fixing the server manager issue, I have been able to install the update.

A word of warning, I installed the KB951847 update after fixing server manager on a web server running IIS and the server stopped serving webpages. I had to reboot, and then after restart the web service did not start automatically, had to manually start the web service, however since then it has been fine. I believe the issue was due to combination of the two as I have fixed the server manager on other servers and that has not stopped the server serving pages. In addition I have installed the .NET update KB951847 and this too has not affected the server.


Share/Bookmark

Wednesday, May 12, 2010

SQL Server 2005 update failure

I recently had to apply a patch to a SQL Server 2005 machine, the patch was KB970892. However it failed, I would like to detail what I found and why the install failed.

SQL Server SP3 had been applied to the SQL Server instance

Post initial installation of SQL SERVER I had move the MASTER, MODEL, MSDB and TEMPDB to new locations. As it turns out this is what caused  me the grief. However trying to get to that point was a journey.

The initial log that the failed update asks you to review is massive, and I failed to see any useful failure information from that log. However while trawling the internet I came across the following log file

%programfiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\Summary.txt

The error I got in this file was

MSP Error: 29538  SQL Server Setup did not have the administrator permissions required to rename a file: d:\SQLData\mssqlsystemresource1.ldf. To continue, verify that the file exists, and either grant administrator permissions to the account currently running Setup or log in with an administrator account. Then run SQL Server Setup again.

It was this file that began to lead me to what was going on.

I eventually came across this forum post.

http://social.msdn.microsoft.com/Forums/en-US/sqlsetupandupgrade/thread/fc411c55-f26b-48d4-9bf7-a333a87bc6de?prof=required

So what is going on, well it appears that if you move the master.mdf file, you need to manually move the following mdf and ldf files to the same location. These files are support files I believe for various things like replication.

  • mssqlsystemresource.mdf
  • mssqlsystemresource.ldf
  • distmdl.mdf
  • distmdl.ldf

e.g

master.mdf moved to d:\sqlData\

I had to move the four files listed above to this folder. Then the update ran successfully. I realise the error message has a 1 in the filename, but I did not rename my files to match and the update completed successfully. That said the files remained untouched!

Hope this helps someone.


Share/Bookmark

Tuesday, May 11, 2010

SQL Server – Environment Variables in (OS) CMDExec job step

Recently I had to try and use an environment variable in a SQL job step. However I came across an issue where it would not resolve the environment variable.

I wanted to use %COMPUTERNAME%, to allow me to script the job and deploy to other servers without modifying it.

It was a weird probablem, if I ECHO the command line, it would resolve the %COMPUTERNAME%, taking the output from  the step output file I was able to run the command.  However remove the ECHO and it would fail to run the command.

After trying many different things, including trying CMD /c “command”, I tried putting CALL on the beginning of the command. This is the solution.

i.e

Original Command (not working in sql job step)

xcopy  “%COMPUTERNAME%\sourcefolder” “destinationfolder”

Fixed command

CALL xcopy “%COMPUTERNAME%\sourcefolder” “destinationfolder”

image


Share/Bookmark