fbpx

Multi Processor VMware

If you change from a multi-processor system to a uni-processor system you need to manually change the HAL on the Windows server after the conversion.

To do this go into Device Manager after the machine first boots and discovers it’s new hardware and then click on Computer then right-click on the processor and select Update Driver. Then select Install from specific location and then Don’t search I will choose the driver to install. Then select show All compatible hardware and select the appropriate processor.

For example, if you went from a dual cpu to a single cpu then select ACPI uni-processor PC instead of ACPI multi-processor PC. You will need to reboot once you change this. To verify what HAL you are using you right-click your hal.dll in c:\windows\system32 and select the Version tab and select Internal Name and it should say halmacpi.dll for multi-processor acpi and halacpi.dll for uni-processor acpi.

Next clean up all the non-present hardware after the P2V conversion. To do this go to a CMD prompt and type SET DEVMGR_SHOW_NONPRESENT_DEVICES=1 and then DEVMGMT.MSC and then select Show Hidden Devices. Delete any old grayed out hardware. Next remove any vendor specific applications/drivers. For example on a HP server you should go to Add/Remove programs and remove any HP management agents, survey utility, array config utility, version control agent, etc.

Also check your NIC and make sure there are no vendor specific drivers there (ie. teaming). Check the Services to see if all there is anything vendor specific related there and disable any services that are.

Setup mySQL for WordPress

Install MySQL and Apache

yum install mysql
yum install mysql-server
chkconfig mysqld on
service mysqld start
sudo yum install php-gd
yum install httpd
chkconfig httpd on
service httpd start

Create Database:

mysql

Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 5340 to server version: 3.23.54

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON databasename.* TO “username”@”hostname”
-> IDENTIFIED BY “password”;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye
$

Mounting Samba Shares

Some Vista and Windows 7 shares and many Samba Linux shares require credentials in the form of username/password pairs before access is granted. These credentials are set on the server. In Windows Vista and Windows 7 they are the login username and password of the owner on the server and in Linux they are any member of the Samba User Database on the server who is “allowed” by the file that defines the share.

You use the option string username=server_user,password=secret instead of the guest option used above to generate the mount as follows:

mount -t cifs -o username=server_user,password=secret //192.168.44.100/share /path_to/mount

Cloning WordPress Installations

I don’t know about you, but after beating my head against the wall a few days trying to figure out how to import/export data through my development environment to production, using vmware clones, and other various methods, I found this tool that makes my job much easier. Please check out the link and see what you think!

http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Centos Syslog Forward to Splunk

# ### begin forwarding rule ###
# The statement between the begin … end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName fwdRule1 # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously
$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
*.* @@splunk:514

Moving WSUS Content / Databases

The following procedures will help you overcome low disk space problems:

· Using the Server Cleanup Wizard to remove unneeded content.

· Moving the content directory to another drive

· Moving the SQL Server database to another drive

To use the Server Cleanup Wizard to remove unneeded content

1. In the WSUS administration console, select Options, then Server Cleanup Wizard.

2. By default this wizard will remove unneeded content and computers that have not contacted the server for 30 days or more. Select all possible options, then click Next.

3. The wizard will begin the cleanup process, and will present a summary of its work when it is finished. Click Finish to complete the process.

To move the content directory to another drive

1. Create a new content directory on another drive.

2. Locate the WSUSUtil.exe utility in the Tools directory of your WSUS installation (typically C:Program FilesUpdate ServicesTools).

3. Open a command window, navigate to the Tools directory, and type the following:

4. wsusutil movecontentNewContentPathMoveLog

5. where NewContentPath is the new content directory, and MoveLog is the path and filename of the log for this operation.

Note

For more information on using the WSUSUtil utility, see Managing WSUS 3.0 from the Command Line in the Operation Guide

To move the SQL Server installation to another drive

1. Open a command window.

2. Type net stop wsusservice

3. Detach the SUSDB database.

4. Copy SUSDB.mdf and SUSDB_log.ldf to the new location.

5. Attach the SUSDB database from the new location.

6. Type net start wsusservice

7. When the system is working properly, delete SUSDB.mdf and SUSDB_log.ldf from the old location.

Extending an LVM volume: Physical volumes (partitions) -> Volume groups -> Logical volume -> Filesystem

Logical Volume Management (AKA LVM) is for managing storage space.
In Centos, instead of installing the root filesystem directly to a fixed size partition, we setup LVM by default, and install the root filesystem to a Logical Volume, which may later be expanded, even across multiple physical devices.

How LVM works
In LVM, there are several layers, each builds on top of the other:

PV[s] (Physical Volumes) -> VG[s] (Volume Groups) -> LV[s] (Logical Volumes) -> Filesystems.

Logical Volumes are allocated/extended within the boundaries of their underlying storage pool which is called a Volume Group in LVM terminology.

For example, in Centos the filesystem is installed by default to the /dev/vg_prd00/lv_root Logical Volume, which is allocated within the vg_prd00 Volume Group:

— Logical volume —
LV Name /dev/vg_prd00/lv_root
VG Name vg_prd00
LV UUID —-uuid—-
LV Write Access read/write
LV Status available
# open 1
LV Size 50 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0
Out of the box the vg_prd00 Volume Group might not have enough free space for you:

# vgdisplay
— Volume group —
VG Name vg_prd00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 63.51 GiB
PE Size 4.00 MiB
Total PE 16258
Alloc PE / Size 16258 / 63.51 GiB
Free PE / Size 0 /0
VG UUID —-uuid—-
We can only extend a Logical Volume within the free space of the underlying Volume Group. How much free space we currently have within the Volume Group can be seen in this part of the output:

Free PE / Size 165 / 660.00 MiB
In the above example we only have 660 MB to allocate to LVMs within the vg_prd00 Volume Group. So if we want to extend the root LV we’ll have to first extend the VG backs it up.

Volume Groups group together Physical Volumes. That’s why they’re called Volume Groups. This command will show us which Physical Volumes have been registered into LVM, and to which volume groups they have been assigned:

# pvdisplay
— Physical volume —
PV Name /dev/sda2
VG Name vg_prd00
PV Size 18.15 GiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 4645
Free PE 165
Allocated PE 4480
PV UUID —-uuid—-
In this example we only have one Physical Volume (the /dev/sda2 partition) in the turnkey Volume Group.

Extending a Logical Volume
Bottom line: if the underlying Volume Group doesn’t have enough free space, to extend the Logical Volumeyou’ll first have to extend the underlying Volume Group by adding another Physical Volume to it.

In VMWare you could either create a new virtual hard disk device to add to the volume group, or extend an existing virtual hard disk device, create a new partition with cfdisk, and add the new partition to the Volume Group:

# example #1: you’ve added to VMWare a new virtual hard disk called /dev/sdb
pvcreate /dev/sdb
vgextend vg_prd00 /dev/sdb

# example #2: you’ve expanded the existing sda hard disk
cfdisk /dev/sda # creating /dev/sda3 (you need to reboot before you can see this)
pvcreate /dev/sda3
vgextend vg_prd00 /dev/sda3
After you’ve extended the Volume Group, you are free to extend the underlying Logical Volume:

# lvextend -L+10G /dev/vg_prd00/root
Extending logical volume root to XXXX GiB
Logical volume root successfully resized
Finally, you’ll have to resize the filesystem within /dev/turnkey/root so it can see that the underlying block device just got 10G bigger:

# resize2fs /dev/vg_prd00/root
resize2fs 1.41.11 (14-Mar-2010)
Filesystem at /dev/vg_prd00/root is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 2
Performing an on-line resize of /dev/vg_prd00/root to XXXX (4k) blocks.
The filesystem on /dev/vg_prd00/root is now XXXX blocks longer.

or
#xfs_growfs /dev/vg_*name*/lv_*name*

Installing VMware Tools on CentOS

Following is the steps I used to solve installing VMware Tools on CentOS
1.In Sphere Client: Guest > Install/update VMware Tools
2. On the VM console in command line, being a server I do not have a GUI installed:
3. mkdir /cdrom, or any other mount point you like
4. mount the vitural cdrom from step 1; mount /dev/cdrom /cdrom
5. cd /tmp
6. tar -xvf /cdrom/VMwareTools (tab to auto-complete)
7. cd vmware (tab to auto-complete)
8. ./vmware-install.pl; accept defaults, you might have to install perl as well
9. umount /cdrom
10. In Vsphere Client: Guest > Install/upVMware Tools > OK
11. To confirm the install; in the client > VM Summary tab and look for OK next to VMWare Tools

Port Mirroring on a Force10 S50v

I wanted to mirror the traffic received and sent on port 0/48 of the Force10 S50v switch to port 0/44 on the same switch. Notice that I do not have to add port 0/44 to any vlan in order to use it for the destination for port mirroring; however, I do have to make sure it has “no ip address” and “no shutdown” configured. Now that all the physical connections are made, I setup port mirroring on the Force10 S50v switch as shown below.

————————————————————————————————————
– enable
– config
– monitor session 0
– source gigabitethernet 0/48 destination gigabitethernet 0/44 direction both

Once I get around to setting up the lagg, I would change the monitor session 0 to

source port-channel 128 destination gigabitethernet 0/44 direction both