rageek

A place for Unix Thoughts and Ideas

Managing VCS zone dependencies in Veritas 5.1

I have been provisioning all my new servers with VCS 5.1sp1 and somewhere between 5.0mp4 and 5.1sp1 they changed the Zones Agent in some fundamental ways. Previously, zones were defined as a resource in the group and could be linked to other resources such as proxy/group/mount resources.

In 5.1, there is a zone resource, but the definition is handled via the ContainerInfo property on the Service group:

5.0 Config:

group ems_zones (
        SystemList = { testnode01 = 0, testnode02 = 1 }
        Parallel = 1
        AutoStartList = { testnode01, testnode02 }

        Zone ems_zones_01_02 (
                Critical = 0
                ZoneName @testnode02 = testzn_ems-02
                ZoneName @testnode01 = testzn_ems-01
                )

        requires group cvm_mounts online local firm

5.1 Config:

group ems_zones (
        SystemList = { testnode02 = 1, testnode01 = 0 }
        ContainerInfo @testnode02 = { Name = testzn_ems-02, Type = Zone, Enabled = 1 }
        ContainerInfo @testnode01 = { Name = testzn_ems-01, Type = Zone, Enabled = 1 }
        Parallel = 1
        AutoStartList = { testnode02, testnode01 }
        )

        Zone ems_zones (
                Critical = 0
                )

        requires group cvm_mounts online local firm

Despite there still being a zone resource and there being support for resource dependencies, resource dependencies only work for dependencies that require the zone resources.

For example, the following group appears to be correctly configured, where the volume group and mount points  will be required to go online before the zones does.
Note: There is a LOFS mount is defined in the zone configuration.

group bw_zones (
        SystemList = { testnode2 = 0, testnode3 = 1, testnode4 = 2 }
        ContainerInfo @testnode2 = { Name = testzn_01, Type = Zone, Enabled = 1 }
        ContainerInfo @testnode3 = { Name = testzn_02, Type = Zone, Enabled = 1 }
        ContainerInfo @testnode4 = { Name = testzn_03, Type = Zone, Enabled = 1 }
        Parallel = 1
        AutoStartList = { testnode2, testnode3, testnode4 }
        )

        CFSMount bw_mnt (
                MountOpt @testnode2 = "nosuid,rw"
                MountOpt @testnode3 = "nosuid,rw"
                MountOpt @testnode4 = "nosuid,rw"
                BlockDevice = "/dev/vx/dsk/bwdg/bw"
                MountPoint = "/zones/.zonemounts/shared_apps_bw"
                )

        CVMVolDg bw_voldg (
                CVMActivation @testnode2 = sw
                CVMActivation @testnode3 = sw
                CVMActivation @testnode4 = sw
                CVMDiskGroup = bwdg
                )

        Zone bw_zones (
                Critical = 0
                )

        requires group cvm online local firm
        bw_mnt requires bw_voldg
        bw_zones requires bw_mnt

But this service group doesn’t work as you would expect, the zone will start before the mounts coming online, causing resource errors or situations where it looks like it onlines proper but the filesystem doesn’t actually show up in the zone.

The fix is to either split the required mounts into a different required service group, or the remove LOFS mount from the zone configuration and define it in the service group instead.

Here is a working example with the LOFS defined in VCS, rather than the zone configuration:

group bw_zones (
        SystemList = { testnode1 = 0, testnode2 = 1, testnode3 = 2}
        ContainerInfo @testnode1 = { Name = testzn_01, Type = Zone, Enabled = 1 }
        ContainerInfo @testnode2 = { Name = testzn_02, Type = Zone, Enabled = 1 }
        ContainerInfo @testnode3 = { Name = testzn_03, Type = Zone, Enabled = 1 }
        Parallel = 1
        AutoStartList = { testnode1, testnode2, testnode3 }
        )

        CFSMount shared_apps_bw_mnt (
                MountOpt @testnode1 = "rw,suid"
                MountOpt @testnode2 = "rw,suid"
                MountOpt @testnode3 = "rw,suid"
                BlockDevice = "/dev/vx/dsk/bwdg/bw"
                MountPoint = "/zones/.zonemounts/shared_apps_bw"
                )

        CVMVolDg bwdg_voldg (
CVMActivation = sw
                CVMDiskGroup = bwdg
                )

        Mount bw_lofs_mnt (
                BlockDevice = "/zones/.zonemounts/shared_apps_bw"
                MountPoint @testnode1 = "/zones/testsz_01/root/opt/apps/shared_apps_bw"
                MountPoint @testnode2 = "/zones/testsz_02/root/opt/apps/shared_apps_bw"
                MountPoint @testnode3 = "/zones/testsz_03/root/opt/apps/shared_apps_bw"
                FSType = lofs
                )

        Zone bw_zones (
                Critical = 0
                )

        requires group cvm online local firm
        bw_lofs_mnt requires bw_zones
        bw_lofs_mnt requires shared_apps_bw_mnt
        shared_apps_bw_mnt requires bwdg_voldg
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: