Files

Veritas VxVM/VCS Storage Expansion Toolkit

Bash examples for expanding storage in a Veritas environment. These scripts are sanitized operational tooling for a Linux Infrastructure Engineer portfolio: they show the flow, guardrails, logging, and validation patterns used in controlled infrastructure change work.

Diagram

flowchart TD
  A["veritas"] --> B["01_detect_new_luns.sh"]
  A --> C["02_precheck_vcs_vxvm.sh"]
  A --> D["03_freeze_vcs_group.sh"]
  A --> E["04_init_vxvm_disks.sh"]
  A --> F["05_extend_diskgroup.sh"]
  A --> G["06_extend_volume_fs.sh"]
  A --> H["07_postcheck_vcs_vxvm.sh"]
  A --> I["08_unfreeze_vcs_group.sh"]
  A --> J["veritas_extend_runbook.sh"]

VxVM vs VCS

Veritas Volume Manager (VxVM) manages disks, disk groups, volumes, plexes, and subdisks. It is the storage virtualization layer used to initialize SAN LUNs, add capacity to disk groups, and grow volumes.

Veritas Cluster Server (VCS) manages application availability through service groups and resources. During storage changes, freezing the relevant service group can prevent unexpected automated failover actions while operators perform controlled work.

Safety Notes

  • Default mode is always dry-run.
  • Real execution requires --execute.
  • Mutating scripts require an interactive EXECUTE confirmation after --execute.
  • Disk names are never assumed. Candidate disks must be supplied explicitly.
  • Disks are initialized only when VxVM reports the expected online invalid state.
  • Filesystem growth is conservative and depends on detected filesystem type.
  • Exact Veritas and filesystem commands can differ by product version, OS, and site standards.

Required Tools

Common commands used by the toolkit:

  • Linux: bash, lsblk, df, findmnt, awk, grep, tee
  • VCS: hastatus, hagrp, hares
  • VxVM: vxdctl, vxdisk, vxdisksetup, vxdg, vxprint, vxassist
  • Filesystem resize tools as applicable: fsadm, xfs_growfs, resize2fs
  • Optional log checks: journalctl, dmesg

Scripts

  • 00_env.sh - shared configuration, logging, dry-run handling, argument helpers.
  • 01_detect_new_luns.sh - discovers Linux block devices and VxVM online invalid candidates.
  • 02_precheck_vcs_vxvm.sh - validates cluster, diskgroup, volume, and filesystem state.
  • 03_freeze_vcs_group.sh - freezes a VCS service group.
  • 04_init_vxvm_disks.sh - initializes candidate VxVM disks.
  • 05_extend_diskgroup.sh - adds initialized disks to a diskgroup.
  • 06_extend_volume_fs.sh - grows a VxVM volume and resizes the filesystem where safe.
  • 07_postcheck_vcs_vxvm.sh - validates final state and gathers post-change evidence.
  • 08_unfreeze_vcs_group.sh - unfreezes the VCS service group.
  • veritas_extend_runbook.sh - prints the recommended order and can optionally run the steps.

Example Workflow

Print the runbook only:

./veritas_extend_runbook.sh \
  --sg app_sg \
  --dg appdg \
  --vol appvol \
  --mount /app \
  --size +100G \
  --disks "emc0_1234 emc0_1235"

Run all steps in dry-run mode:

./veritas_extend_runbook.sh \
  --run \
  --sg app_sg \
  --dg appdg \
  --vol appvol \
  --mount /app \
  --size +100G \
  --disks "emc0_1234 emc0_1235"

Run a controlled execution. Each mutating step still asks for EXECUTE:

./veritas_extend_runbook.sh \
  --run \
  --execute \
  --sg app_sg \
  --dg appdg \
  --vol appvol \
  --mount /app \
  --size +100G \
  --disks "emc0_1234 emc0_1235"

Run individual steps:

./01_detect_new_luns.sh
./02_precheck_vcs_vxvm.sh --sg app_sg --dg appdg --vol appvol --mount /app
./03_freeze_vcs_group.sh --sg app_sg
./04_init_vxvm_disks.sh --disks "emc0_1234 emc0_1235"
./05_extend_diskgroup.sh --dg appdg --disks "emc0_1234 emc0_1235"
./06_extend_volume_fs.sh --dg appdg --vol appvol --mount /app --size +100G
./07_postcheck_vcs_vxvm.sh --sg app_sg --dg appdg --vol appvol --mount /app
./08_unfreeze_vcs_group.sh --sg app_sg

Exit Codes

  • 0 - OK.
  • 1 - operational validation or execution failure.
  • 2 - invalid input or missing required command.

Operational Reminder

Use these scripts as examples and adapt them to local runbooks, naming standards, multipath stack, Veritas release, filesystem type, and change-control policy before live use.