Direct Disk Access in XenServer (iSCSI Trick)

XenServer does not allow direct Hard Drive access from a Virtual Machine.

But we can use a trick to mount the Drive or Volume as an iSCSI device. This will let us use it as a Removable Device in XenServer.

Just Edit the udev file:
nano /etc/udev/rules.d/50-udev.rules

And add these 2 lines of code (replace md0 with your device)
ACTION=="add", KERNEL=="md0", SYMLINK+="xapi/block/%k", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"
ACTION=="remove", KERNEL=="md0", RUN+="/bin/sh -c '/opt/xensource/libexec/local-device-change %k 2>&1 >/dev/null&'"

To Save and quit nano type:
ctrl+w then ctrl+o

Now if you go into your XenServer Console, Go to a Virtual Machine > Storage.
Select Attach, Then Under Removable Storage you will see your Drive or Volume.

Note: It will come up as “Unreconised bus type” that is safe to ignore, if you would to change it go to “Removable Storage” on your Server, then click on “Unreconised bus type” then Properties and change its name.

Comments (1)

Create a Raid 5 Array

Setting up the raid:

First we need to format each drive to be used as “Linux Auto Detect RAID” (Type fd)

To List Hard drives:
fdisk -l
To work on a Hard drive:
fdisk /dev/xxx
Commands:
d - Delete Volume
n - New Volume
t - Set Volume Type
w - Save Chages and Exit

1. We need to work on each Hard Drive.
2. Remove all Volumes
3. Create a new Volume
4. Set its type to Linux Raid

Example Delete:
fdisk /dev/sda
d
w

Example Create Volume:
fdisk /dev/sda
n
p
1
Enter
Enter
w

Example Set Type to Raid:
fdisk /dev/sda
t
fd
w

Now to build the Raid
mdadm --create /dev/md0 --level=51 --raid-devices=3 /dev/sda1 /dev/sdb1 /dev/sbc1

To Rebuild Existing Raid
mdadm --assemble --scan

Save Array Config for next boot:
mdadm --detail --scan >> /etc/mdadm.conf

Done!

Leave a Comment

WordPress 3.0 Install on Centos 5.5

5 Minute Super Guide:

Main Install

Make sure CentoOS is upto date:

yum update

Install Apache/Mysql/PHP/Unzip/Wget:

yum -y install mysql-server httpd php php-mysql unzip wget

Enable Apache and MySQL

chkconfig httpd on
chkconfig mysqld on

Start Apache and MySQL

/etc/init.d/mysqld start
/etc/init.d/httpd start

Set root password for MySQL (IMPORTANT!)

mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where User='root';
mysql> flush privileges;

Setup WordPress Database

mysql> CREATE DATABASE wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
mysql> FLUSH PRIVILEGES;
mysql> quit;

Download WordPress

cd /var/www/html
wget http://wordpress.org/latest.zip

Extract WordPress

unzip latest.zip
rm latest.zip

Move WordPress to Root Directory

mv wordpress/* ./
rmdir wordpress/

Give WordPress permissions to write

mkdir wp-content/uploads wp-content/cache
chown apache:apache wp-content/uploads wp-content/cache ./

Open and configure WordPress

http://your-server-ip-or-hostname/

In the Config enter your SQL Username ‘wordpress’ and the password you set earlier.

Click Save and your all done!

Fixes permissions for Permalinks:

chown apache:apache /var/www/html/.htaccess

Let Appache Edit .htaccess for Permalinks:

nano /etc/httpd/conf/httpd.conf

And edit the Section:

<Directory "/var/www/html">

And Change Allow ovride to:

AllowOverride ALL

Enable Multiple Sites:

define('WP_ALLOW_MULTISITE', true);

Comments (6)

Windows 7 Temp Profile

What happened to me was that I deleted my own profile just to get a new clean one and all of a sudden Windows 7 complains about Temporary Profile. It didn´t matter if i Rebooted or anything. I alway got a Temporary Profile.

I solved my problem by going into the registry and delete the effected profile’s subfolder under HKLMSOFTWAREMicrosoftWindows NTCurrentVersionProfileList

After that all was well again!

Leave a Comment

OSX 10.6 in VMWare

Mac OSX 10.6 working 100% in VMWare.
Can be updated without issues normally and has Network/Audio/Video Support.

OSX-106-VMWare-Install-Kit-1.0.zip

Leave a Comment

0XC0000005 and Symantec Endpoint Protection 11 MR5

The Application and Device Control section of Symantec Endpoint 11 MR5 has had major issues with Google Chrome and a quick google search will return 1000′s of people with issues, but what most sites dont mention is that its not just Chrome that has these issues. If you get ANY 0xc0000005 error codes while you have Symantec Endpoint 11 installed I would suggest  disabling the SysPlant service and rebooting.


[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSysPlant]
"Start"=dword:00000004

Leave a Comment

HowTo: Reset HP iLo Port from Windows

To do this you will need the HP Support Pack installed.

Create an XML file in x:Program Fileshphponcfg where x: is your local system drive (usually c:)
Save it as change_password.xml and enter the following (replacing “YOURNEWPASSWORDHERE” with your new password):

<ribcl VERSION="2.0">
<login USER_LOGIN="Administrator" PASSWORD="boguspassword">
<user_INFO MODE="write">
<mod_USER USER_LOGIN="Administrator">
<password value="YOURNEWPASSWORDHERE"/>
</mod_USER>
</user_INFO>
</login>
</ribcl>

Now open a command prompt to “x:Program Fileshphponcfg” and run:
HPONCFG.exe /f change_password.xml

Wait 60 seconds and it should all be done.

Leave a Comment

ISA2K4 SP2 Large 400mb File

ISA2K4/SP2 will create a new 400mb file, WindirDebugISALOG.BIN, and a second, new 400mb file, ISALOG.BAK, on the C: drive.

This file’s purpose is for troubleshooting by MSSupport
in the event of problems with ISA 2004.

You can get rid of this by going to HKLM/Software/Microsoft/ISATracing and
setting the BootTracing parameter to 0 (zero). Then reboot and delete both
ISALOG.BIN and ISALOG.BAK.

You can prevent the creation of these files by adding the reg key and value before installing SP2.

Leave a Comment

Move SEM5.db for SEP 11

Follow the steps below to change the location of the sem5.db database file for Symantec Endpoint Protection Manager (SEPM):

Go to services.msc

Stop the Symantec Endpoint Protection Manager Service

Stop the Symantec Embedded Database Service

Go to Program FilesSymantecSymantec Endpoint Protection Managerdb and cut the sem5.db file and paste it to the new drive

Click Start

Click run

Type regedit

Go to HKey_Local_MachinesystemCurrentControlSetServicesASANYsParameters click on the Parameters option in the right hand side column and change the path of the sem5.db database file to the new location as New Drive:Folder name

Restart the Symantec Embedded Database Service from services.msc

Go to Administrative Tools

Click on Data Sources (ODBC)

Click on System DSN tab

Click on Configure button

Highlight the database tab and replace the path for the sem5.db file and ensure connectivity by clicking on Test Connection

Go to Management Server configuration Wizard and perform the server reconfiguration

If you need to move it to another drive:

Follow the above steps, you’d copy the existing “content” directory (let’s say you copy it over to D:SEP_Content) and then create a new empty content directory in the old spot.

Then just run the command:
junction ”c:program filesSymantecSymantec Endpoint Protection ManagerInetpubcontent” d:sep_content

Leave a Comment

Fix BCD

1. Boot off the Vista Install CD
2. Select “Repair your computer” to continue.
3. Proceed with the repair process by choosing “Startup Repair” from the list.
4. If that fails Go ahead and select “Command Prompt” from that list.
5. Type:

bootrec.exe /fixmbr
x:bootbootsect.exe /nt60 all /force
del C:bootbcd
bootrec.exe /rebuildbcd
shutdown -r -t 0

6. If that ALSO fails:
Go back to the command promt as above and now type:

bootrec.exe /fixmbr
x:bootbootsect.exe /nt60 all /force
del C:bootbcd
bcdedit /createstore c:bootbcd.temp
bcdedit.exe /store c:bootbcd.temp /create {bootmgr} /d "Windows Boot Manager"
bcdedit.exe /import c:bootbcd.temp
bcdedit.exe /set {bootmgr} device partition=C:
bcdedit.exe /timeout 10
del c:bootbcd.temp
bcdedit.exe /create /d "Windows Vista" /application osloader
bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} device partition=C:
bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} osdevice partition=C:
bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} path Windowssystem32winload.exe
bcdedit.exe /set {c0dfc4fa-cb21-11dc-81bf-005056c00008} systemroot Windows
bcdedit.exe /displayorder {c0dfc4fa-cb21-11dc-81bf-005056c00008}
bcdedit.exe /default {c0dfc4fa-cb21-11dc-81bf-005056c00008}

Leave a Comment