woensdag 17 oktober 2012

Configure an Oracle database for vCenter Appliance 5.1


We recently purchased a few extra ESX servers and this was a good time to also upgrade our vCenter. We were still running Vmware ESX 4.1 and Vcenter 4.1. We did not upgrade to 5.0 because of the vRAM licensing model. Fortunately, this is again a thing of the past.

Our vCenter contains 15 host and a few hundred VMs and this was getting a bit too much for MSSQL Express. Rather than go for MSSQL Standard, we decided to use an Oracle database for vCenter. This made sense since we are an Oracle shop with a couple of dedicated Oracle DBA's.

We decided to use the Vmware vCenter appliance an connect that to an Oracle database. Since the appliance expects a database that is already populated, we needed to setup the database ourselves. We followed the instructions "Configure Oracle Databases" in the vSphere Installation and Setup guide.

Documentation caveats

The documentation for configuring the Oracle database does not seem very accurate:
  • a user is created before the tablespace used by the user.
  • the scripts are not executed, they do not contain a /. This means that after pressing enter, you have to type / and press enter again.
  • half the scripts executed returned errors. the scripts were expecting tables, views and stored procedures that were not available. We found that all the objects that we needed were created by running a few extra .sql scripts in the dbschema directory.
  • the Vmware documentation says that temptable0_proc_oracle.sql, temptable1_proc_oracle.sql and temptable2_proc_oracle.sql should be run. We had some trouble finding these files, but could not execute them either because the required tables were missing. We could not find any "create table" statement for the required tables in any of the .sql files. Because vmware kb "Verifying jobs and stored procedures installed in vCenter Server 5.1" does not mention the temptable stored procedures while the same kb for 5.0 does, we think these are no longer required.

Procedure

Create the Oracle database and start with creating a tablespace for the VCENTER schema:

create tablespace VPX datafile '' size 2000M autoextend on next 500M maxsize unlimited;
create user VCENTER profile "DEFAULT" identified by "" default tablespace "VPX" account unlock;

Run the script VCDB_oracle.sql:
@VCDB_oracle.SQL
This script creates the tables and indexes.

Now run some extra scripts not mentioned in the documentation to create some stored procedures and views that are required by the other scripts:
@VCDB_views_oracle.sql
@insert_stats_proc_oracle.sql
@l_stats_rollup1_proc_oracle.sql
@l_stats_rollup2_proc_oracle.sql
@l_purge_stat2_proc_oracle
@l_stats_rollup3_proc_oracle.sql
@l_purge_stat3_proc_oracle

Continue with the scripts mentioned in the documentation
@load_stats_proc_oracle.sql
@purge_stat2_proc_oracle.sql
@purge_stat3_proc_oracle.sql
@purge_usage_stats_proc_oracle.sql
@stats_rollup1_proc_oracle.sql
@stats_rollup2_proc_oracle.sql
@stats_rollup3_proc_oracle.sql
@cleanup_events_oracle.sql
@delete_stats_proc_oracle.sql
@load_usage_stats_proc_oracle.sql
@TopN_DB_oracle.sql
@calc_topn1_proc_oracle.sql
@calc_topn2_proc_oracle.sql
@calc_topn3_proc_oracle.sql
@calc_topn4_proc_oracle.sql
@clear_topn1_proc_oracle.sql
@clear_topn2_proc_oracle.sql
@clear_topn3_proc_oracle.sql
@clear_topn4_proc_oracle.sql
@rule_topn1_proc_oracle.sql
@rule_topn2_proc_oracle.sql
@rule_topn3_proc_oracle.sql
@rule_topn4_proc_oracle.sql
@process_license_snapshot_oracle.sql

The process_temptable scripts can be skipped.
@process_temptable0_proc_oracle.sql
@process_temptable1_proc_oracle.sql
@process_temptable2_proc_oracle.sql

Run the scripts to create a few jobs:
@job_schedule1_oracle.sql
@job_schedule2_oracle.sql
@job_schedule3_oracle.sql
@job_cleanup_events_oracle.sql
@job_topn_past_day_oracle.sql
@job_topn_past_week_oracle.sql
@job_topn_past_month_oracle.sql
@job_topn_past_year_oracle.sql
@job_property_bulletin_oracle.sql

vrijdag 1 juli 2011

HP P4000 SAN CLI

The past few months, I've been busy with scripting our HP P4000 SAN - among others. For scripting HP provides the CLI interface. Strangely, HP is making a weird distinction between Windows and other platforms. For Windows the CLI is a local installation available on the "HP StorageWorks P4000 Management Software for Microsoft Windows DVD". On non-Windows platforms, you have to SSH to port 16022 on your box to access what HP calls the on-system CLI.

While some vendors (e.g Juniper SSG, Citrix Xenserver) first put new features in the command-line interface and make them available in th GUI later, this is not the case with the HP P4000. The CLI seems to be trailing the GUI.

There are also some differences between the Windows CLI and the on-system CLI. A first step is to check the "CLIQ - The SAN/iQ Command-Line Interface User Guide" to see if a command is available. For each command the availability is listed, e.g:

assignVolumeToServer
This command assigns a volume to a server.
Availability: Windows, SAN/iQ


Working with the CLI - in our case the on-system CLI - for some time, I learned the good and the bad and wanted to share some of this, since there is clearly not too much information available on this subject. All in all, the CLI is easy to work with, but there are a few traps you should avoid.

A P4000 SAN has a minimum of 1 node and typically multiple nodes for high-availability. Each node has its own IP and the cluster also has an IP address: the VIP. What I learned the hard way, is that a few commands do not work when you connect to the VIP. Therefore it is recommended to connect to one of the nodes to execute CLIQ commands.

The command that did not work for me was 'createremotesnapshot'. After some digging, I found out that this is a bug in the firmware when you connect to the VIP. See this HP Support document: http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c02635577&lang=en&cc=us&taskId=101&prodSeriesId=4004602&prodTypeId=12169

When you lookup the command assignVolume in the User Guide, this is what you will find:

assignVolume
This command assigns a volume to a server. This assignment sets the access to a volume, based on host iqn(s).


No mention that this command removes anything. But beware! The command assignVolume will assign the volume to an initiator like you ask, but existing assignments will be removed!

If you only want to add an assignment, it is better to use the command assignVolumeToServer. The unassignvolume command is maybe even more dangerous, but at least it is clearly mentioned in the documentation that all assignments will be removed.

unassignVolume
This command disassociates a volume from all servers.

vrijdag 18 april 2008

Solaris for Linux sysadmins

Last week, I started playing with Solaris. As a long-time Linux and Unix sysadmin, I have been in contact with Solaris before, but it has been quite a while since our last encounter.

Although I have touched Solaris before, these were only brief encounter. This time I decided to really get close. Sun and virtualization make this a lot easier than it was in the past. I downloaded Solaris 10 x86_64 from the Sun web site and installed it in a virtual machine. I will spare you the details of this installation, there are already sufficient resources available elsewhere and to be honest ... installation is not that hard.

What I want to write about, is a Solaris introduction for those already comfortable with Linux. So basically, I will highlight the main differences. This should allow Linux sysadmins to get quickly up to speed with Sun Solaris 10.

Let me start by giving you a summary of areas of interest:
  • SMF
  • Networking
  • Disk partitioning + ZFS
  • Resource Limits
With Solaris 10, Sun has done away with the traditional start/stop scripts in /etc/rc?.d/ directories. We all know this system has a few disadvantages:
  • Scripts start one after the other, startup time could benefit from parallellism.
  • No real dependencies between services. This means that although the network failed to start, eg the NFS server will still try to start.
Service Management Framework (SMF) in Solaris 10 fixes these shortcomings.