# Migrating SQL HP SIM Database

When migrating the HP SIM SQL database from 2005 to 2008 R2 we needed to change the database connection so there was no need to reinstall the entire application.

1) Stop the HP SIM service

– Start -> Run -> Services.msc- Stop the HP Systems Insight Manager

2) Go to the folder  “C:\program files\HP\Systems Insight\Manager\config”3) Open the file database.admin with a text editor

4) Edit the settings to with the new database properties

Normally hp.Database.hostName, hp.Database.instance, hp.Database.portNumber would be enough.

#--- Product Property Definitions ---
#Wed Dec 18 17:01:23 CET 2013
hp.Database.authType=host
hp.Database.databaseName=master
hp.Database.hostName=hp_db
hp.Database.instance=hp_db
hp.Database.jdbcDriver=net.sourceforge.jtds.jdbc.Driver
hp.Database.jdbcUrlPrefix=jdbc\:jtds\:sqlserver
hp.Database.portNumber=1234
MxVersionNumber=C.07.01.00.00


Save the file after editing

5) Open the file database.props with a text editor in the same directory as the database.admin file.
Edit the same properties as in the database.admin file. hp.Database.hostName, hp.Database.instance, hp.Database.portNumber

#--- Product Property Definitions ---
#Wed Dec 18 17:01:23 CET 2013
hp.Database.authType=host
hp.Database.charSet.??=UTF-8
hp.Database.charSet.en=UTF-8
hp.Database.charSet.ja=SJIS
hp.Database.databaseName=Insight
hp.Database.dsn=Insight_v50_0
hp.Database.hostName=hp_db
hp.Database.instance=hp_db
hp.Database.jdbcDriver=net.sourceforge.jtds.jdbc.Driver
hp.Database.jdbcUrlPrefix=jdbc\:jtds\:sqlserver
hp.Database.maxRetries=10
hp.Database.portNumber=1234
hp.Database.retryDelay=1000
hp.Database.schemaFile_1=schema40.sql
hp.Database.schemaFile_10=schema60_61.sql
hp.Database.schemaFile_11=schema61_62.sql
hp.Database.schemaFile_12=schema62_63.sql
hp.Database.schemaFile_13=schema63_70.sql
hp.Database.schemaFile_14=schema70_71.sql
hp.Database.schemaFile_2=DCSchema10.sql
hp.Database.schemaFile_3=schema40_41.sql
hp.Database.schemaFile_4=schema41_42.sql
hp.Database.schemaFile_5=schema42_50.sql
hp.Database.schemaFile_6=schema50_51.sql
hp.Database.schemaFile_7=schema51_52.sql
hp.Database.schemaFile_8=schema52_53.sql
hp.Database.schemaFile_9=schema53_54.sql
hp.Database.schemaFileCount=14
hp.Database.schemaFileNamePrefix=hp.Database.schemaFile_
hp.Database.sqlSchema=
hp.Database.ssl=off
hp.Database.vHandler=com.hp.mx.database.MsSqlVerificationHandler
MxVersionNumber=C.07.01.00.00


Save the file after editing

6) Go to the folder “C:\Program Files\HP\Systems Insight Manager\jboss\server\hpsim\deploy”

Search for files which end with *-ds.xm, open these and edit the host name here. In my example there only was one file hpsim-ds.xml in this file is a complete connection string which needs to be adjusted also. Open the file and search for the connection string:

<connection-url>
</connection-url>


It’s also possible that there are files like tmpXXXXXpmp-ds.xml  in the folder “\jboss\server\hpsim\tmp\deploy\” those need to be updated also.

7) Start the HP SIM Service again

Now wait a few minutes so everything can start, now check if the application works properly.

## Problem

Suddenly (during a failover test) I noticed a script didn’t work anymore. The script I used connects directly to an ESX host. And I got the error below, somehow I never ever had this before and we used this script for a long time. So something changed, but when and why did this happen was still on my research list. After a google search for “requested protocol” error I found the solution

Connect-VIServer : 22-3-2014 9:03:07 Connect-VIServer Could not connect using the requested protocol.
+ $currentConnection = Connect-VIServer <<<<$vcHost -Credential \$cred
+ CategoryInfo : ObjectNotFound: (:) [Connect-VIServer], ViServerConnectionException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_ProtocolError,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

## Solution

To get rid of this problem there is a solution that sets the powerCLI configuration to “Use no proxy”

The solution is described in:
Connecting to the AutoDeploy server fails with the error: Could not connect using the requested protocol (2011395)

Open your powerCLI console as administrator (else you don’t have sufficient rights to edit this setting)
To show the current configuration use “Get-powerCLIconfiguration

C:\>Get-PowerCLIConfiguration

Proxy Policy Default Server
Mode
-------------------------       ---------------
UseSystemProxy      Single

As you can see it uses the system’s proxy. To change this use “Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm” to set the proxy settings to “NoProxy”
You can choose two proxy policies

C:\>Set-PowerCLIConfiguration -ProxyPolicy NoProxy -Confirm
Perform operation?
Performing operation 'Update vSphere PowerCLI configuration.'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
Proxy Policy Default Server
Mode
------------         ---------------
NoProxy              Single

A while ago I was testing with the HP OneView Appliance, but somehow it was pretty hard to find in the installation guides what the administrator user name and password were. Finally I found them.

Manual

## VMware : Converting IDE disks to SCSI

After migrating the linux environment from KVM to ESX (see my previous post how to do it). We noticed that the disks
where connected as IDE disks, therefor it wasn’t possible to (dynamicly) resize them or add more disks then 4 IDE slots (including CD-ROM)

It pretty easy to convert these to a SCSI disk, but it will require downtime.
Converting a virtual IDE disk to a virtual SCSI disk (1016192)

It’s recommendend for Windows machines to repair the MBR of the disk as adviced in the article above.
When encountering problems you could have a look at :
Repairing boot sector problems in Windows NT-based operating systems (1006556)

Luckily we tested it a few times in the Linux environment without encoutering problems (all VM’s are RedHat 6.4 or higher)

1) Turn off the VM
2) Locate the ESX host from the VM
3) Locate the datastores of the disks to edit
4) Turn on SSH on the ESX
5) Connect using SSH and go to the VM folder

# cd /vmfs/volumes/<datastore_name>/<vm_name>/


Now open the VMDK file using a VI editor like VI or nano for more information about VI/Nano
Editing files on an ESX host using vi or nano (1020302)
*Note: Nano is not available in ESXi. But can manually be installed

6) In this case we edit the TEST_PAT.vmdk file

# vi TEST_PAT.vmdk


When you look at the file you will see a ddb.adaptertype = “IDE” this is the value ESX uses to determine the adapter to use.In this case, when you add the VMDK using  “add new disk -> use existing disk” it will see IDE and add an IDE adapter.

So wee need to change this value

Specify one of these parameters: lsilogic or  buslogic .

This table shows the adapter type for the guest operating system:

 Guest Operating System Adapter Type Windows 2003, 2008, Vista lsilogic Windows NT, 2000, XP buslogic Linux lsilogic

In this case we chose the lsilogic

Change IDE to LSILOGIC and save the file.

Next go back to your virtual machine and remove the disks you edited (don’t remove it from your storage), so wisely chose “Remove from Virtual Machine”
It’s important not to remove the disk first before you start editing because the VMDK descriptor file doesn’t exist yet if the disk is not connected to a VM.

Apply the settings. Now go back to edit settings -> add -> Harddisk -> Use an existing virtual disk -> Browse to the location of the disk file and click next a few times.
As you notice it will display Disk adapter as SCSI now.