Tuesday, June 26, 2012

Create a bootable Windows PE 3.0 USB drive with rescue tools – Part 1

For Windows PE 1.0, the minimalist Windows based on Windows 2003/XP, you needed an SA (Software Assurance), OEM, or ISV license. When Windows Vista was released everyone had access to Windows PE 2.0. This also applies to the Windows 7-based edition, Windows PE 3.0. Windows PE (Preinstallation Environment) was originally designed to deploy Windows. However, it is also useful in creating your own customized rescue boot media. In this article, I will describe how you can create a bootable Windows PE 3.0 (WinPE) USB stick, and, in my next post, I will show how to add your own rescue tools and how to keep your rescue stick up-to-date without much hassle. You will see that the procedure described here is much more convenient than most solutions you’ll find on the web.

Link to this greate article is:
http://4sysops.com/archives/build-a-bootable-windows-pe-3-0-usb-drive-with-rescue-tools-part-1/

Tuesday, June 19, 2012

Linux Screen Tutorial and How To

You are logged into your remote server via SSH and happily plucking along at your keyboard and then it happens. Suddenly, the characters stop moving and then you get the dreaded “Connection Closed” message. You have just lost your session. You were halfway through some task and now you have to start over. Ugh. Well you can prevent this from happening by using screen. The Linux screen tool can not only save you from disconnection disasters, but it also can increase your productivity by using multiple windows within one SSH session.

Original text of this great tutorial can be found on location:

http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

Friday, June 1, 2012

HowTo monitor the NIC used by a Virtual Machine in a Hyper-V cluster

Original post can be found at location:
http://blogs.msdn.com/b/robertvi/archive/2008/12/05/howto-monitor-the-nic-used-by-a-virtual-machine-in-a-hyper-v-cluster.aspx

Recently I had a customer with the following problem: Hyper-V Host Clusters don't support NIC Teaming. So I have my VM clustered, but my machine does not failover when the NIC used for that machine has a problem. E.g. Network cable unplugged.
One approach to workaround this, is to add a cluster resource script to the Cluster Group. Below is a script, with short instructions.
Please note, this is a sample script, so you should consider testing and modifications to adjust for your own needs.
Unfortunately, this approach is not applicable if you manage your cluster with SCVMM 2008, as it will mark your VM as "unsupported"
This "unsupporte cluster configuration" notice in SCVMM will go away with SCVMM 2008 R2, and a April updated to SCVMM 2008

copy and paste the below and save as NicHa.vbs
'*******************************************************************************************************************************************************
' Nic HA Script. Sample. Please feedback to robertvi at microsoft.com
'
'INSTALL INSTRUCTIONS
'
' 1. copy this script to all cluster nodes into %windir%\cluster
' 2. In Failover Cluster Management Select the VM you wish to add NIC Monitoring
' 3. Select "Add a resource" -> Generic Script
' 4. Enter %windir%\cluster\nicha.vbs
' 5. Next, Finish. Note the name of the created resource (nicha Script)
' 6. Run ncpa.cpl
' 7. Identfiy the Phyiscl NIC that is used by the Switch for this VM (This NIC should only have the Switch Protocol bound)
'    Usually something like "Local Area Connection"
' 8. Rename this NIC to something like "VM Network 1"
' 9. Do steps 6 to 8 on all cluster nodes
' 10. Open a Elevated CMD Prompt
' 11. Using the names from above, "nicha script", "VM Network 1"'
' 12. In cmd prompt, issue the following command: cluster res "nicha Script" /priv NicName="VM Network 1"
' 13. Online the Script Resource
'
'You may edit the properties of the Virtual Machine Group in Failover Cluster Management to allow more failovers in a given period.
'The Default of 2 may be reached easily during testing. The script resource will then fail, but the group will not move
'
'The availability of the NIC is checked every minute by default.
'This could be changed in the Advanced Properties of the Script Resource in the "Thorough resource health check interval", if needed
'
'
'
'*******************************************************************************************************************************************************

'*******************************************************************************************************************************************************

'*******************************************************************************************************************************************************
'Global variables
'*******************************************************************************************************************************************************
'Script Version
ScriptVersion = "0.2"

'*******************************************************************************************************************************************************
'Open()
'
'*******************************************************************************************************************************************************
Function Open()
   
 On Error Resume Next
 Resource.LogInformation("Entering Open() for NIC Monitoring Generic Script Version " & ScriptVersion)
 If Resource.PropertyExists("NicName") = FALSE Then
  Resource.AddProperty("NicName")
  Resource.LogInformation("NICHA: Property NicName not configured")
 End If

Open = 0
End Function

'*******************************************************************************************************************************************************
'Online()
'

'*******************************************************************************************************************************************************
Function Online()
 'Check if the NIC is connected, otherwise fail Open
 Online = 1
 strComputer = "."
 strNicName = Resource.NicName
 strquery = "Select * from Win32_NetworkAdapter where NetConnectionID = '" & strNicName & "'"

 Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 Set colItems = objWMIService.ExecQuery(strquery)
 if colItems.Count = 0 then
  Resource.LogInformation("NICHA: Error - NIC not found")
  set objWMIService = nothing
  Set colItems = nothing
  Exit Function
 end if
 set objItem = colItems.ItemIndex(0)

 if objItem.NetConnectionStatus = 2 then
  Online = 0
 else
   Resource.LogInformation("NICHA: Error - NIC not in connected state")
 end if

 set objWMIService = nothing
 Set colItems = nothing
 set objItem = nothing

End Function

'*******************************************************************************************************************************************************
'LooksAlive()
'
'Return success
'*******************************************************************************************************************************************************
Function LooksAlive()
 On Error Resume Next
 LooksAlive = TRUE
End Function

'*******************************************************************************************************************************************************
'IsAlive()
'
'*******************************************************************************************************************************************************
Function IsAlive()
   
 On Error Resume Next
 IsAlive = FALSE
 strComputer = "."
 strNicName = Resource.NicName
 strquery = "Select * from Win32_NetworkAdapter where NetConnectionID = '" & strNicName & "'"

 Set objWMIService = GetObject("winmgmts:" _
  & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 Set colItems = objWMIService.ExecQuery(strquery)
 if colItems.Count = 0 then
  Resource.LogInformation("NICHA: Error - NIC not found")
  set objWMIService = nothing
  Set colItems = nothing
  Exit Function
 end if
 set objItem = colItems.ItemIndex(0)

 if objItem.NetConnectionStatus = 2 then
  IsAlive = TRUE
 else
   Resource.LogInformation("NICHA: Error - NIC not in connected state")
 end if

 set objWMIService = nothing
 Set colItems = nothing
 set objItem = nothing

End Function

'*******************************************************************************************************************************************************
'Offline()
'
'*******************************************************************************************************************************************************
Function Offline()
 On Error Resume Next
 Offline = 0
End Function

'*******************************************************************************************************************************************************
'Terminate()
'
'*******************************************************************************************************************************************************
Function Terminate()
 On Error Resume Next
 Terminate = 0

End Function
'*******************************************************************************************************************************************************
'Close()
'
'Return success
'*******************************************************************************************************************************************************
Function Close()
 Close = 0
End Function

Wednesday, May 23, 2012

Upgrade to CentOS 6.2 from CentOS 6.1 or CentOS 6.0

1. Change to root User

su -
## OR ##
sudo -i

2. Backup all important data

  • Backup /etc diretory
  • Backup important logs /var/log
  • Backup web server configs and sites
  • Dump MySQL databases
  • Dump PostgreSQL databases
  • Backup all what you need if something goes wrong

3. Check list of packages that are going to be updated

yum list updates

4. Upgrade with yum update

Official way to do upgrade:
yum update
Another way to do update is first clean all, second update glibc, yum, rpm and python packages and then update other packages like following:
yum clean all
yum update glibc* yum* rpm* python*
yum update

5. Reboot

reboot

6. Check CentOS 6.2 (Final) release info and Check your entire system

cat /etc/redhat-release
## Output ##
CentOS release 6.2 (Final)
Following needs redhat-lsb package
lsb_release -a
## Output ##
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.2 (Final)
Release:        6.2
Codename:       Final
Check that your system is working normally and test every services.

Tuesday, May 15, 2012

SLES / SLED 11 - Multimedia VLC How-To


 To be able to use VLC player in SLES / SLED 11, it is needed to switch to openSuSE repos, in this case to  version 11.1. Do following:

zypper ar -f http://packman.unixheads.com/suse/11.1/ Packman && zypper refresh Packman

zypper ar -f http://download.videolan.org/pub/vlc/SuSE/11.1 vlc && zypper refresh vlc && zypper in vlc

If it still won't install try adding these two repos and try installing vlc again:

zypper ar -f http://download.opensuse.org/repositories/multimedia:/libs/SLE_11/ multimedia-libs && zypper refresh multimedia-libs

zypper ar -f http://download.opensuse.org/repositories/multimedia:/xine/SLE_11 multimedia-xine && zypper refresh multimedia-xine

That's is all folks :)

Tuesday, April 17, 2012

Reconfigure iLo network settings using HPONCFG


I recently found myself in a situation where I had rebuilt and shipped a server to a remote office but forgotten to configure the iLo settings. Normally this wouldn't be to big an issue - except A) The IP address and default gateway were pointing to a subnet which no longer existed and B) The HP System Management Homepage wasn't connecting to the agents correctly.


Fortunately the HPONCFG utility came to my rescue. This little tool is installed as part of the ProLiant Support Pack and can be used to make config changes to iLo without the need to reboot. Default install directory = C:\Program Files\HP\hponcfg.


To write the current iLo configuration simply open a cmd prompt and execute the following command:


C:\Program Files\HP\hponcfg>hponcfg /w iLoConfig.xml


To change settings you need to create an xml file containing the parameters you want to change, formatted using the RIBCL language. RIBCL allows you to write XML scripts to configure and manage iLO config settings.


To modify the network settings I created the following script:






NOTE: The USER_LOGIN and PASSWORD tags are required, and must contain data, although any data is accepted.


And then run the script like so:


C:\Program Files\HP\hponcfg>hponcfg /f your_script_name.xml

Thursday, April 12, 2012

Troubleshooting HP Systems Insight Manager (HPSIM) High CPU Usage

Scenario:


A service provider monitoring 750+ systems on a single HP SIM box, experiences high (near to 100% or 3GHz) CPU utilization – mainly due to the processes sqlservr.exe and mxdomainmgr.exe. The HP SIM box is in a VMware environment, has 1 vCPU, and – as in all good environments – they don't want to just chuck resource at it - especially as it is only a monitoring box and otherwise works fine albeit a bit slow - but see if some performance optimization can be done.


Resolution:


Optimize the HP SIM Scheduled tasks


1: Log in to HP SIM https://HPSIM Server:50000 with an authorized account
2: From the menu bar → Tasks & Logs → View All Scheduled Tasks...







3: Enable the 'Delete Events Older Than 90 Days' task (by default runs once a week and this is fine)





4: Configure the task 'Hardware Status Polling for non Servers' to poll using the schedule guidelines below


Number of systems -> Hardware Status Polling for non Servers


Less than 250 --> Use default of 30 minutes
250 to 500   --> Change to 1 hour
501 to 2000   -->  Change to 2 hours
2001 to 5000   -->  Change to 4 hours or greater


5: Configure the task 'Hardware Status Polling for Servers' to poll using the schedule guidelines below


Numbers of systems -> Hardware Status Polling for Servers


Less than 250 -> Use default of 5 minutes
250 to 500 -> Change to 15 minutes
501 to 2000 -> Change to 30 minutes
2001 to 5000 -> Change to 1 hour


*These are based on the suggested polling intervals from HP


Note: The tasks should be configured so there is no crossover - don't have both running at the same time
The chart below shows CPU usage before and after the changes.







Postscript:


i: Even though this was for HP SIM 5.3, this similarly applies to other versions of HP SIM – HP SIM 5.X, HP SIM 6.X ….


ii: The service provider in question runs 5 Insight boxes, managed by different internal teams, monitoring over 2500 systems.


iii: Semi-related - if operators report the web ui is slow, try disabling script scanning from the workstations anti-virus (at least for the internet browser process)

How to use DiskSpd to simulate Veeam Backup & Replication disk actions

This HOW-TO contains information on how to use Microsoft© DiskSpd to simulate Veeam Backup & Replication disk actions to measure disk pe...