Академический Документы
Профессиональный Документы
Культура Документы
Griffin Hernandez
Senior Technical Consultant
Hitachi Data Systems
June 29th, 2014
Table of Contents
DOCUMENT CONTROL..............................................................................................6
HITACHI UNIVERSAL REPLICATOR..............................................................................7
OVERVIEW....................................................................................................................................... 7
Replication Configuration Process......................................................................................................................... 7
HUR LAYOUT DIAGRAM...................................................................................................................... 8
JOURNAL CREATION........................................................................................................................... 9
Create / Modify Journal........................................................................................................................................ 10
MONITORING SCRIPTS............................................................................................47
CALCULATING RPO FOR UR VIA CLI................................................................................................... 47
Overview................................................................................................................................. 47
Process.................................................................................................................................... 48
MONITORING JOURNAL USAGE........................................................................................................... 48
Overview................................................................................................................................. 48
HDSF(X)................................................................................................................ 50
OVERVIEW..................................................................................................................................... 50
AVAILABLE FUNCTIONS..................................................................................................................... 51
EXAMPLE SI RESYNC SCRIPT............................................................................................................. 52
Document References
Ref Referenced Item
1 Requirement document
The physical disks are carved into thick provisioned Ldev, the ldevs are dedicated to a journal, the journal is dedicated to
replicating one or more copy groups. Copy Groups are defined as a logical grouping of ldevs participating in replication,
the devices within the copy group will not have any RPO drift between the devices. Everything will occur at the same time.
When defining copy groups, determine all of the data that needs to be protected across all of the provisioned
devices. Anything that cannot survive an RPO Drift needs to be in the same Copy Group. For example, if you
have an SQL Database that is spread across multiple devices, then the devices should be grouped together in a
“Copy Group” (also known as a Device Group), and that will be one replicated grouping.
Speaking to replicated groupings of data (not a hitachi term), any data that is striped across ldevs (disks, volumes, luns)
and cannot suffer a RPO drift between different ldevs should be placed within the same consistency group.
When working with SRM, HSC or any other replication management software, all of the ldevs with data to be protected
must be replicated. In SRM, you may only have one or two datastores to be replicated and the VM’s within those
datastores are completely enclosed. In HSC in regards to databases, the consistency group should follow the entire
database instance, all of the data, transaction, and possibly the DB Dumps LDEVs should be defined within the same
group.
9) Click Set.
After creating HORCM instances, they can be automatically started with the system by adding a line to /etc/rc.d’s init file.
Also set the environment variable HORCM_EVERYCLI=1 for all users, set it in the same execution file prior to executing
“horcmstart.sh” .
To set permission changes across reboot using Linux 2.6 Kernels, udev rules need to be built around the devices to
manipulate.
The following example will change all Command devices to be owned by user “hdsndm”.
KERNEL=="sd?", ATTRS{model}=="OPENVCM ", GROUP="hdsndm", OWNER="hdsndm",
MODE="0660"
This line needs to be added to a file in /etc/udev/rules.d/, the easiest method is to create a new file. Example:
echo "KERNEL==\"sd?\", ATTRS{model}==\"OPENVCM \", GROUP=\"hdsndm\", OWNER=\"$
hdsndm\", MODE=\"0660\"" > /etc/udev/rules.d/10hitachinonroot.rules
If needing to revert, we can always delete this new file and permissions will revert next time udev is triggered.
Troubleshooting
[testuser@RHEL642 HORCM]$ raidcom get resource I0
[testuser@RHEL642 HORCM]$ raidcom get port I0
[testuser@RHEL642 HORCM]$ raidqry l I0
No Group Hostname HORCM_ver Uid Serial# Micro_ver Cache(MB)
1 RHEL642 012903/06 0 53086 700604/00 38912
3) Fix:
1. chown R <user>:<usergroup> /HORCM/log
Below is a list of all of the files that require permissions / ownership change:
Owner / Group Change
/dev/sdb
o from root to hdsndm
/dev/sdc
o from root to hdsndm
/HORCM/.uds
o from root to hdsndm
/HORCM/usr
o from root to hdsndm
/HORCM/usr/var
o from root to hdsndm
/HORCM/usr/bin
o from root to hdsndm
/HORCM/usr/bin/horcctl
o from root to hdsndm
/HORCM/usr/bin/raidvchkset
o from root to hdsndm
/HORCM/usr/bin/horcmshutdown.sh
o from root to hdsndm
/HORCM/usr/bin/raidar
o from root to hdsndm
Command devices allow HORCM to directly communicate with the Array. HORCM files require a command device (IP or
Physical) to be able to manipulate replication or configure the array.
Open the file. Update the instance number (search for entry HORCM_INST=), then add an additional line
of “set HORCM_EVERYCLI=1” below the HORCM_INST.
3) Select the LDEVs you want to create the pool from. Ensure that you take all of the LDEVs from a Parity group. Do not
mix LDEVs between pools.
6) After hitting OK, the screen will list the number of LDEVs selected and the total capacity of the LDEVs.
Replication Statuses
Overview
Each state of replication has a specific status. The statuses are uniform across all of the replication types, with certain
additional ones for Disaster Recovery Software (UR / TC / TC:ED).
General
PAIR
o Replication is established. Changes are being tracked updated on the Target Volume (S-VOL / R2)
In Universal Replicator and TC:ED the changes may be kept in a journal if the bandwidth is not
available or if the link is severed.
PSUS / SSUS
o Primary Suspend / Secondary Suspend
Replication is suspended. Changes are being tracked and a differential update will be applied to
the Target Volumes (S-VOL / R2) when resynced
COPY
o Shown when performing an Initial Copy OR after performing a resync
o Updates are being applied
PSUE / SSUE
o Primary Suspend Under Error / Secondary Suspend Under Error
An error has occurred with replication. Replication has suspended
Most times a resync will return this to a “PAIR” state.
Usually a differential copy
Universal Replicator / TC
SWSS
o When S-VOL paths become active due to host, path, or MCU failure, RCU automatically splits S-VOL with
write enabled status (SSWS).
o SSWS is an erroneous state.
TC / TC Async / TC: ED
PFUL
Additional statuses, their meanings, and information on troubleshooting can be found in the:
Hitachi Command Control Interface User and Reference Guide
Document Number: MK-90RD7010
Overview
HORCM is the Hitachi Online Replication Control Manager, it is also known as CCI, the Command Control Interface.
HORCM Files define both the connection method to an array and any replication to be controlled. A HORCM file can only
control a singular array, therefore it is very important to know which instance you are working with.
Horcm Instances are labeled by number, for example, horcm0.conf is Horcm Instance 0. Inside of the horcm0.conf you
define the connection to a single array. Once that is done, horcm0 will only operate for that singular array. There can be
many HORCM instances pointed at the same array.
There are two types of HORCM files, one type specifically for raidcom (Hitachi Data Systems CLI configuration utility), and
one for controlling replication.
An instance for raidcom will only allow array commands, though, with the addition of device groups, copy groups, and Thin
Image, some In System Replication can be controlled from the raidcom program.
An instance for replication requires a partnered pair to communicate with. HORCM, when started, becomes a daemon
which will listen on a specified UDP port. All replication tasks (other than DR specific) require a secondary instance to
communicate with.
Traditionally replication is controlled from a HORCM file designed for replication. The replication does not happen
between the hosts, HORCM instructs the array to perform replication tasks.
Introduction
A Traditional Horcm File for Replication
In a Traditional Horcm File there are four sections which need to be defined and configured in the following order
1. HORCM_MON
a. Defines the IP Address to listen on, UDP Port, and timeout values
2. HORCM_CMD
a. Defines the local Command Devices, or the Remote IP Address of a singular array
3. HORCM_LDEV / HORCM_LDEVG / HORCM_DEV
a. Defines one or more lists of devices participating in replication
4. HORCM_INST
a. The remote location of the list of devices
#/************************* For HORCM_MON *************************************/
HORCM_MON
#ip_address service poll(10ms) timeout(10ms)
10.0.0.50 12010 6000 3000
#/************************** For HORCM_CMD ************************************/
HORCM_CMD
#dev_name dev_name dev_name
\\.\CMD211033
#/************************** For HORCM_LDEV ***********************************/
HORCM_LDEV
#dev_group dev_name Serial# CU:LDEV(LDEV#) MU#
test1 0059_0034 211033 00:59 h1
#/************************* For HORCM_INST ************************************/
HORCM_INST
#dev_group ip_address service
test1 10.0.0.51 12011
HORCM_MON
The above text constitutes a horcm file which is deployed on host 10.0.0.50, and will listen on 10.0.0.50:12010 UDP for HORCM commands.
HORCM_CMD
Tells the HORCM Process which array we are controlling. It requires a valid command device pathed to the host with a valid /dev/node
HORCM_LDEV
Defines that LDEV 00:59 is participating in Replication.
To control replication for this device, you would use the device group name “test1” to split, resync, and pair (suspend, re-establish, establish).
HORCM_INST
Tells HORCM where the sister configuration file for the remote array. Note that the Device Group defined above is defined in this section as well.
This is how you specify the remote array.
#/************************* For HORCM_MON *************************************/
HORCM_MON
#ip_address service poll(10ms) timeout(10ms)
<Local IP> <Local Listening UDP Port> 6000 3000
#/************************** For HORCM_CMD ************************************/
HORCM_CMD
#dev_name dev_name dev_name
\\.\CMD<Serial of Array to Control>
#/************************** For HORCM_LDEV ***********************************/
HORCM_LDEV
#dev_group dev_name Serial# CU:LDEV(LDEV#) MU#
<Replication Group Name> <Shared Unique Name> <Local Array SN> <LDEV ID> <MU>
#/************************* For HORCM_INST ************************************/
HORCM_INST
#dev_group ip_address service
<Replication Group Name> <Remote IP> <Remote UDP Port>
Example:
HORCM_CMD
#dev_name dev_name dev_name
\\.\CMD211033
Explanation:
HORCM_CMD
#dev_name dev_name dev_name
\\.\CMD<Serial of Array to Control>
Note: A raidcom only horcm file will only allow control of the array, as well as some in-system replication (specifically only
if raidcom device groups / raidcom copy groups are employed)
Replication occurs between two or more LDEVs. Each direct replication (P-VOL -> S-VOL) is a pairing. Where the P-VOL
is the Primary Volume (Production Volume), and the S-VOL is the Secondary Volume (DR or Snapshot Copy). HORCM
Files define this pairing by using two separate HORCM Files.
Traditionally even numbered HORCM files are Production, odd numbered are Snapshot or DR (Ex: horcm0.conf is
Production, horcm1.conf is DR).
Each HORCM file points at its paired HORCM file for control of replication.
The following page is an excel table which shows two HORCM files HORCM_LDEVG section.
To control replication for this environment, the group name must be invoked.
Installation
*nix
Installation of HORCM on a Nix based box is as simple as expanding the CPIO file, placing the expanded
directory under root, and then executing the “horcminstall.sh” script (now located under /HORCM).
1. Locate the correct RMHORC file for the system and architecture you are using
2. Copy this to /tmp on the host
3. Extract the CPIO
a. cpio -idmu < RMHORC
4. Move the new directory to /
a. mv HORCM /
5. Execute script to make symlinks
a. /HORCM/horcminstall.sh
Copy paste:
cpio idmu < RMHORC
mv HORCM /
/HORCM/horcminstall.sh
Windows
Windows uses an executable for installation. Simply double click on the setup, click next a few times, and its
installed.
Explanation of Flags:
v<L/R>
o vl or vr
Vector Local, or Vector Remote
VL means that the instance number defined in IH0 will be the PRIMARY Volumes
The volumes listed in horcm1.conf will be OVERWRITTEN.
VR means that the instance number defined in IH0 will be the TARGET Volumes
The volumes listed in horcm0.conf will be OVERWRITTEN.
Plain English
Local or Remote determines which volumes will be OVERWRITTEN. VL ALWAYS means
the instance specified in the -I flag will be the PRIMARY volumes.
jp <Local JID>
o Local Array (in this case the array controlled by Horcm Instance 0) Journal ID Number
js <Remote JID>
o Remote Array (as defined in horcm0.conf HORCM_INST section) Journal ID Number
f async <CTG>
o “async” specifies HUR replication
“never” specifies True Copy Sync replication
o <CTG>
is the Consistency Group Number
Always use the Local Journal Number.
Note: Using VR Remotely is the equivalent of running VL locally.
HUR Replication is used via the “async” command with paircreate.
Synchronous replication options for fencing are:
a. data
a. In the case of a replication link down event, P-VOL access is suspended (fenced) until the MCU / RCU
Paths are restored. As long as the S-VOL cannot be updated, the P-VOL is locked for writing.
b. never
a. Writes need to be committed to the DR Array before the host receives a write acknowledgement. In the
case of a replication link down event, the P-VOL remains writable.
c. status
a. P-VOL access is suspended (fenced)
Reverse Resync (Restore) - HUR / TC
pairresync g sanadmhds001d IH0 swapp
Needs to be executed on the host with the horcm0.conf file
Reverses replication, Swaps the P-VOL with the S-VOL. Secondary Site becomes Primary (HUR / TC)
Overview
P-VOL Takeover
The PVOL-takeover function releases the pair state as a group, since that maintains the consistency of the
secondary volume at having accepted horctakeover command when the primary volume is fenced (“data or
status” and “PSUE or PDUB” state, “PSUE or PDUB” volume are contained in the group). This function allows the
takeover node to use the primary volume (for example, reading and writing are enabled), on the assumption that
the remote node (possessing the secondary volume) cannot be used. PVOL takeover can be specified for a
paired volume or a group.
For Asynchronous software: P-VOL-takeover will not be executed.
Swaptakeover
When the P-VOL status of the remote node is PAIR and the S-VOL data is consistent, it is possible to swap the
primary and secondary volumes. The swaptakeover function is used by the HA control script when a package is
manually moved to an alternate data center while all hardware is operational. Swaptakeover can be specified for a
paired volume or a group.
The swaptakeover function internally executes the following commands to swap the primary and secondary
volumes:
1. Execute suspend for swapping the local volume (S-VOL). If this step fails, swaptakeover is disabled and an error
is returned.
2. Execute resync for swapping to the S-VOL (local volume). This will swap P-VOL and S-VOL, and redirect the copy
direction. The result of this is:
The old P-VOL will be the new S-VOL. The old S-VOL will be the new P-VOL.
And of course, this will also change the remote copy direction and it will synchronize the pair. To move back to the
original state you need to repeat this procedure (where, of course P-VOL and S-VOL are the new current ones). If
this step fails, swap-takeover returns at SVOL-SSUS-takeover, and the local volume (S- VOL) is maintained in
SSUS(PSUS) state which allows and keeps track of write I/Os using a bitmap for the S-VOL. This special state is
displayed as SSWS using the -fc option of the pairdisplay command.
The swaptakeover function does not use SMPL or No Copy mode for swapping to guarantee mirror consistence,
and this is included as a function of SVOL takeover.
S-VOL Takeover
The data consistency of the UR S-VOL is evaluated by its pair status and fence level. If successful, the SVOL
takeover function returns swap takeover as the return value of the horctakeover command. If not successful, the
SVOL takeover function returns SVOL-SSUS-takeover as the return value of the horctakeover command. In case
of a host failure, Swap takeover is returned. In case of an ESCON/FC or P-VOL site failure, SVOL-SSUS-
takeover is returned.
Plain English:
Horctakeover is a decision tree that determines the best way to get volumes up and running. If both sides
are currently operational (determined by the communication of the horcm instance and MCU-RCU Paths),
executing a horctakeover will subprocess the “pairresync -swaps” which will flush traffic, then swap the P-VOL
and S-VOL. The Target Volumes will become production.
If there is connectivity problems, depending on the horcm instance which horctakeover is executed, either
the replication will be simplexed (destroyed / unestablished), or put into a pair suspend under error mode.
Fail to Remote Site - HUR / TC - horctakeover command
horctakeover IH0 g sanadmhds001d t <RPO>
W
In the case where the Production array is non-viable (complete fabric failure, site failure, array failure, HORCM
instance failure, etc) a protected environment will remain in “PAIR” Status. Normal HORCM commands will no
longer work (excepting pairdisplay using the “-l” flag to disable attempting to connect to the remote array). In this
Scenario let us assume someone has pressed the emergency power off button for the Production datacenter.
In this Scenario, the Horcm host, fabric, and array are now down. The S-VOL at the DR site will remain “PAIR”
incase it is a simple link failure between sites.
Executing pairsplit, pairesync, and pairdisplay using normal flags will fail due to a communications Time Out.
Note: These must be ran from the DR Side. The side with the S-VOLs.
HORCM Commands which will work at the DR site while Prod is Down:
pairdisplay g sanadmhds001d IH1 l
pairsplit g sanadmhds001d IH1 RS
The pairsplit -RS command will tell the local array to forcibly split (suspend) replication without notifying the
primary array. The S-VOL will become write enabled, and it will have a unique Replication Status of “SSWS”. The
Primary Volume will remain “PAIR”.
At this point the application / database can be brought up at the DR site. Data will be in a “crash consistent” state.
This is a DR Event.
During a hard poweroff state, Enterprise arrays will use their internal batteries to maintain the cache, in most
cases allowing for HUR to come back up without performing a full resync.
Finish Failover - HUR / TC - Manual Operation - DR Roll Back
pairresync -swaps
After performing an emergency Fail Over to the DR site, the replication is stuck in a PAIR / PSUE, SSWS state.
At this point you probably have the DR site up and running, and have production applications / databases running
and updating your original DR copy. Failing back to the Production Site after a failure is fairly straightforward and
requires two resyncs and a split.
1) From the DR Site, initiate a copy back to Prod
a. pairresync g sanadmhds001d IH1 swaps
2) Shut Down all applications at the DR site. In a moment the DR Site Volumes will be Read-Only.
a. This ensures that data is properly flushed to the Prod site.
i. pairsplit g sanadmhds001d IH1
3) Reverse Replication Again
a. pairresync g sanadmhds001d IH1 swapp
Explanation of Flags:
v<L/R>
o vl or vr
Vector Local, or Vector Remote
VL means that the instance number defined in IH0 will be the PRIMARY Volumes
The volumes listed in horcm1.conf will be OVERWRITTEN.
VR means that the instance number defined in IH0 will be the TARGET Volumes
The volumes listed in horcm0.conf will be OVERWRITTEN.
Plain English
Local or Remote determines which volumes will be OVERWRITTEN. VL ALWAYS means
the instance specified in the -I flag will be the PRIMARY volumes.
v
Creating Replication (Establish) - In System (Thin Image)
paircreate g sanadmhds001d IH0 v<L/R> pid <TI Pool>
Needs to be executed on the host with the horcm0.conf file
Starts an initial full copy between two sets of LDEVS on the SAME array.
Explanation of Flags:
v<L/R>
o vl or vr
Vector Local, or Vector Remote
VL means that the instance number defined in IH0 will be the PRIMARY Volumes
The volumes listed in horcm1.conf will be OVERWRITTEN.
VR means that the instance number defined in IH0 will be the TARGET Volumes
The volumes listed in horcm0.conf will be OVERWRITTEN.
Plain English
Local or Remote determines which volumes will be OVERWRITTEN. VL ALWAYS means
the instance specified in the -I flag will be the PRIMARY volumes.
-pid
o A number corresponding to the Thin Image Pool the S-VOLs should save their DELTAs (∆) in.
Note: Additional Flags are detailed in the “Command Control Interface Command Reference” Handbook included
in the HORCM Binary CD. Document Number: MK-90RD7009
Consistency and write order are handled at the Journal / Consistency Group level.
The FC Protocol guarantees transmission of frames in a non-erroneous state.
As each write is committed to the local array, a hexadecimal number is assigned to that block of data and it is
placed into queue for sending (Q-Marker).
Process
When issuing a “pairdisplay -v jnl” command the last committed Q-Marker both locally and remotely is displayed:
# pairdisplay g VG01 v jnl
JID MU CTG JNLS AP U(%) QMarker QCNT DSZ(BLK) Seq# Nnm LDEV#
001 0 2 PJNN 4 21 43216fde 30 512345 62500 2 265
002 0 2 SJNN 4 95 3459fd43 52000 512345 62538 3 270
In the above sample output, the bold and underlined section is the Commited Q-Marker for the execution time.
Over time (determined by bandwidth and remote array busy time) during subsequent executions the second
number will catch up to 43216fde. The number is incremented for each successful transfer between the two sites.
RPO Can be calculated by multiple executions of “pairdisplay g VG01 v jnl” and counting the number
of seconds before the secondary journals Q-Marker is greater than or equal to the original executions primary
journal.
Available Functions
The functions provided in HDSfunctions are listed below:
writeLog
writeDebugLog
writeERROR
closeLog
recoveryLog
logCleanUp
getEpoch
getCurrentISRGroup
catDebugLog
getGlobalConf
checkArgs
getSpecificConf
startLog
startHORCM
resyncPair
createClone
splitPair
DBScript
PairVolChk
rotateISR
COWCheck
HURCheck
remoteFunction
remoteCommand
remoteStartHORCM
SolUnmount
SolMountChk
vxdgDeport
SolMount
vxdgImport
vxdgChkState
verifyVGsNotImported
VMwareBackup
VMwareResignatureDisks
VMwareBackupRename
xosfx
Example Commands
Get info about a specific LDEV
raidcom get ldev ldev_id 21:01 I0 fx
This will print all of the applicable configuration information about LDEV 21:01. Using the -fx, LDEV
information will be displayed in Hex only for the LDEV IDs displayed. No other data will be in hex.
You could also specify the LDEV_ID in decimal, or without a colon using 0x2101.
Delete a LDEV
raidcom delete ldev ldev_id [LDEV] I0
Deletes an LDEV from the array, All data on the LDEV is lost.