Tuesday, 16 June 2015

Informix Virtual Cloning - Staging Architecture with Delphix

Informix Virtual Cloning - Staging Architecture with Delphix

Delphix can clone Informix instances. It works. However there are disadvantages of cloning the whole instance (binaries + storage). It works only with non root installations. Fortunately there is another way of virtual cloning of Informix. Cloning with staging instance. This time only the storage is cloned. This method has no "no root installation" limitation!

Staging Architecture

Informix Virtual Cloning - Staging Architecture.

The general idea is that this time we are not cloning everything but only storage.
The picture above shows the architecture. We have:
  • Host Informix 1 - Source Informix installation ("root" or "non root") using physical storage
  • Host Informix 2 - Staging Informix non root installation. Storage is provided by Delphix Engine.
  • Host Informix 3 - Virtual Clone non root installation. Storage is provided by Delphix Engine.

 Staging Advantages

  • We are using staging instance with storage provided by Delphix to maintain a "master" copy of data files for our virtual clones.
  • There are several ways of feeding staging instance with data. We can feed it with full system archives every snapshot. We can use backups of logical logs or even HDR configuration.
  • Maintaining the stream of data from source instance does not affect operation of our virtual clone.
  • Source instance can be root or non root installation. To instantiate the staging instance we are using full system archive applied to not root installed staging instance.
  • Snapshots of staging are very lightweight when using logical logs or HDR as feed.
  • Independent life-cycle of staging and virtually cloned end instances.

Moving Parts - Mechanics

  • informix2-source_mock - Empty folder used to create dSource "informix2-source_mock".
  • informix2-storage - Staging instance storage. We are using vFiles as storage. At first the storage folder is empty.
Staging Informix Storage



  • At the beginning we have to restore source's system backup in storage instance. First we create empty files representing chunks from source instance. Then we are using "ontape -p" to reinstate Informix instance. Our new instance has different name than source and is installed in test VM. Staging instance is left running in "Fast Recovery" mode.
  • At this point we have to create first useful snapshot of our stage. We have to stop the instance using "onmode -ky" and then just create a snapshot of "informix2-storage" vFiles. Now we are ready to provision usable virtual clone of Informix.
  • informix3-storage - We need a third VM where Informix binaries are installed. We have to configure the instance in proper way and provide a storage for the instance. The storage is delivered by creating another vFiles folder "informix3-storage" out of "informix2-storage". This is done in third VM. After provisioning the storage we are ready to startup the virtual clone of Informix.
Informix Virtual Clone Storage


Informix Virtual Clone Storage Parameters
  • In order to startup virtual clone in Informix3 host we have to issue "oninit -PHY" and "onmode -m". From that point we can make snapshots of virtually cloned Informix, rewind to previous snapshots, refresh virtual clone from parent "informix2-storage" representing storage of staging instance. 
  • It is necessary to use pre-refresh and post-refresh hook scripts to stop and start Informix instance when refreshing. The same applies to rewind operation.
  • Every time we want to snapshot staging instance's storage we have to stop the instance and ingest new data from source. The procedure of ingesting data from system backups and logical logs is different. Logical logs can be ingested on the fly by invoking "ontape -l -C". We can use HDR if configuration allows.

Conclusion

  • Using staging architecture by cloning Informix is much more flexible than cloning full stack.
  • Serious limitation related to not root installations is removed.
  • Time flow of data coming from source instance is independent from virtual clone storage and has its own life-cycle.
  • Virtually cloned instances are not bound directly to source instance.
  • We can create multiple clones based on the same "virtual dSource". This can be done because of Delphix vFiles inheritance feature.
  • Such architecture is suitable for cloning big Informix databases. 

Resources

Git: https://github.com/goliasz/delphix-informix








 

Tuesday, 2 June 2015

Delphix can clone Informix instances

Informix Instance Cloning


Delphix can clone Informix! This post describes basic scenario of cloning Informix instances. It is a beginning of interesting journey.

Scenario

Host 1: Informix instance installed. Non root installation.
Host 2: Informix instance installation folder provisioned by Delphix. Little change to network configuration file and we can enjoy new running Informix instance. We can use snapshot, refresh and rewind functionality. Using these features we can travel in time with our cloned instance.

Architecture

Informix Instance Basic Cloning Architecture

Delphix Engine 4.2.2.1
Functionality used: Unstructured Files 

Host 1 - Details

Delphix: Source Host
OS: CentOS release 6.6 (Final)
Name: informix1.kolibero.local

Informix:
  • Installation Folder: /home/informix/ixinst1
  • Version:  IBM Informix Database Server 12.10.FC5 PRODUCT RELEASE (Delevoper Edition)
  • Installation Type: non root
  • Instance name: ol_informix1210
  • Custom Database: Blog
  • Custom Table: Blog

Host 2 - Details

Delphix: Target Host
OS: CentOS release 6.6 (Final)
Name: informix2.kolibero.local 

Cloning Steps

  • Install Host 1 VM
  • Install Informix IDS from installation media. Installation folder /home/informix/ixinst1. This is non root installation.
  • Start Informix instance. Create Blog database. Create Blog table inside database.
  • Install Host 2 VM.
  • Register source and target environments in Delphix.

Source host registered in Delphix
Target host registered in Delphix
  •  Ingest /home/informix/ixinst1 folder as dSource.
Source Informix installation folder ingested into Delphix
  •  Clone ingested instance folder to target Host 2.

Cloned Informix instance folder. Now available in target Host 2.
  • Modify /home/informix/ixinst1/etc/sqlhosts.ol_informix1210 in Host2 to point to new host name. We have to modify informix1.kolibero.local to informix2.kolibero.local.
[informix@informix2 etc]$ more sqlhosts.ol_informix1210
ol_informix1210 onsoctcp informix2.kolibero.local 16323
dr_informix1210 drsoctcp informix2.kolibero.local 22217
lo_informix1210 onsoctcp 127.0.0.1 33113
[informix@informix2 etc]$
  • Export instance's environment variables
  • Start cloned instance using oninit.
At this point we can use new cloned Informix instance. We can make snapshots of the instance, rewind its state back and forth.

Conclusion

  • This is very basic example of cloning Informix using Delphix but it is good starting point to more sophisticated scenarios.
  • Using basic Delphix functionality of cloning "Unstructured Files" we can create new independent environment serving Informix instance. Our cloned instance can enjoy time machine features offered by Delphix.