VCS 6.1 : How to Administrate VCS Service Groups using the hagrp
[vc_row][vc_column width=”2/3″][vc_text_separator title=”Other Learning Articles that you may like to read” color=”black”][vc_tta_tour style=”flat” spacing=”2″ gap=”2″ controls_size=”sm” active_section=”1″ css=”.vc_custom_1469259876636{background-color: #ffffff !important;}” no_fill_content_area=”true”][vc_tta_section title=”Latest Articles” tab_id=”1468871183598-9466d85c-9ce4″][vc_masonry_grid post_type=”post” max_items=”50″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”2″ item=”17530″ grid_id=”vc_gid:1469282723468-c7b025065176ca8c9d9de4399966c6ec-7″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258760195{background-color: #eaeaea !important;}”][/vc_tta_section][vc_tta_section title=”Information Centers” tab_id=”1468869118809-6c32c26d-7a73″][vc_masonry_grid post_type=”post” max_items=”30″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”2″ item=”17530″ btn_title=”Show me More Posts” btn_shape=”round” grid_id=”vc_gid:1469282723519-5bda201289ffc3488d36d95b9a511fdc-10″ taxonomies=”674″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469282769356{background-color: #dbdbdb !important;}”][/vc_tta_section][vc_tta_section title=”Linux Admin” tab_id=”1468863117966-71d46596-1349″][vc_masonry_grid post_type=”post” max_items=”100″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”2″ item=”17530″ initial_loading_animation=”none” grid_id=”vc_gid:1469282723571-63cba23831dc7526adf19df94fd0828e-3″ taxonomies=”35, 649, 427″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258736301{background-color: #ededed !important;}”][/vc_tta_section][vc_tta_section title=”Solaris Admin” tab_id=”1468859378329-df794d2f-31ff”][vc_masonry_grid post_type=”post” max_items=”50″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”5″ item=”17530″ initial_loading_animation=”none” grid_id=”vc_gid:1469282723619-7293ebb36536eb1860a075d903dcb71f-5″ taxonomies=”125, 65, 84″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258528977{background-color: #eaeaea !important;}”][/vc_tta_section][vc_tta_section title=”VxVM Admin” tab_id=”1468863449237-8094f6e6-e47a”][vc_masonry_grid post_type=”post” max_items=”40″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”5″ item=”17530″ initial_loading_animation=”none” grid_id=”vc_gid:1469282723666-38716db4886d75c4e259e23ceed8d18e-4″ taxonomies=”20″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258547772{background-color: #eaeaea !important;}”][/vc_tta_section][vc_tta_section title=”VCS Admin” tab_id=”1468859393073-b591c633-e80c”][vc_masonry_grid post_type=”post” max_items=”40″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”2″ item=”17530″ grid_id=”vc_gid:1469282723714-67f3aac26e429b44918631262b219431-0″ taxonomies=”587, 636, 95, 93, 94, 96, 98, 583″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258815100{background-color: #e5e5e5 !important;}”][/vc_tta_section][vc_tta_section title=”Career Guidance” tab_id=”1468859409803-7e8f1d27-b880″][vc_masonry_grid post_type=”post” max_items=”50″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”2″ item=”17530″ grid_id=”vc_gid:1469282723757-bf496e80da38119f50feee30d2d9bae7-1″ taxonomies=”27, 156″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258835863{background-color: #e5e5e5 !important;}”][/vc_tta_section][vc_tta_section title=”Scripting” tab_id=”1468863616077-d75c044f-0d6a”][vc_masonry_grid post_type=”post” max_items=”50″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”5″ item=”17530″ grid_id=”vc_gid:1469282723805-e82cf3f477d33494c907fdfc921fb261-2″ taxonomies=”117″ btn_add_icon=”true” btn_custom_onclick=”true”][/vc_tta_section][vc_tta_section title=”Storage Admin” tab_id=”1468864446328-8f46c04c-e442″][vc_masonry_grid post_type=”post” max_items=”50″ style=”load-more” items_per_page=”7″ element_width=”12″ gap=”2″ item=”17530″ initial_loading_animation=”none” grid_id=”vc_gid:1469282723828-fc94cceb74954650b42d157258f9c6e0-7″ taxonomies=”87, 63, 86, 124, 109″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469259411409{background-color: #e0e0e0 !important;}”][/vc_tta_section][vc_tta_section title=”Quick Reference” tab_id=”1468864576012-b7f2e683-10d4″][vc_masonry_grid post_type=”post” max_items=”30″ style=”load-more” items_per_page=”6″ element_width=”12″ gap=”2″ item=”17530″ grid_id=”vc_gid:1469282723883-7e90c912885cc85cdc19d133fe4849f2-2″ taxonomies=”116, 625, 624, 626″ btn_add_icon=”true” btn_custom_onclick=”true” css=”.vc_custom_1469258877449{background-color: #dddddd !important;}”][/vc_tta_section][/vc_tta_tour][/vc_column][vc_column width=”1/3″][vc_text_separator title=”Free Courses We Offer” color=”black”][vc_btn title=”Linux Administration Interview Preparation `{`Free Email Crash Course`}`” style=”outline-custom” outline_custom_color=”#666666″ outline_custom_hover_background=”#666666″ outline_custom_hover_text=”#ffffff” shape=”square” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fblog%2F2016%2F03%2Ffree-email-crash-course-for-linux-admin-interview-preparation%2F||target:%20_blank|” button_block=”true”][vc_btn title=”Roles and Responsibilities of System Admin `{`Free Course`}` ” style=”outline-custom” outline_custom_color=”#666666″ outline_custom_hover_background=”#666666″ outline_custom_hover_text=”#ffffff” shape=”square” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fcourse%2Fknow-about-solaris-system-administration-job%2F||target:%20_blank|” button_block=”true”][vc_btn title=”Getting Started with RHEL7 Administration `{`Free Course`}` ” style=”outline-custom” outline_custom_color=”#666666″ outline_custom_hover_background=”#666666″ outline_custom_hover_text=”#ffffff” shape=”square” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fcourse%2Ffree-course-getting-started-with-red-hat-enterprise-linux-7%2F||target:%20_blank|” button_block=”true”][vc_text_separator title=”Paid Training Courses we Offer” color=”black”][vc_tta_tabs style=”flat” color=”black” gap=”2″ active_section=”1″ no_fill_content_area=”true” css=”.vc_custom_1469259083495{background-color: #f2f2f2 !important;border-radius: 1px !important;}”][vc_tta_section title=”Self Paced Courses” tab_id=”1469255118344-7aa625f2-e823″][vc_btn title=”Solaris11 Self Paced Video Learning” style=”classic” color=”primary” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fcourse%2Fsolaris11-administration-for-experience-solaris10-administrators%2F||target:%20_blank|” button_block=”true”][vc_btn title=”RHEL7 Self Paced Video Learning” style=”classic” color=”primary” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fproduct%2Fbecome-an-expert-in-red-hat-enterprise-linux-7%2F||target:%20_blank|” button_block=”true”][vc_btn title=”VxVM + VCS Self Paced Video Learning” style=”classic” color=”primary” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fproduct%2Fstorage-foundation-and-vcs-administration-for-unix-and-linux-engineers%2F||target:%20_blank|” button_block=”true”][vc_btn title=”Solaris10 Self Paced Video Learning” style=”classic” color=”primary” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fproduct%2Fsolaris-associate-membership%2F||target:%20_blank|” button_block=”true”][vc_btn title=”Puppet Automation Self Paced Video Learning” style=”classic” color=”primary” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fcourse%2Fautomation-with-puppet-self-paced-video-learning%2F||target:%20_blank|” button_block=”true”][/vc_tta_section][vc_tta_section title=”Live Webex” tab_id=”1469255118345-d6338902-a6d4″][vc_btn title=”Solaris 11 Administration Live WebEx” style=”classic” color=”warning” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fcourse%2Fsolaris11-administration-for-experience-solaris10-administrators%2F||target:%20_blank|” button_block=”true”][vc_btn title=”Puppet Automation – Live WebEx” style=”classic” color=”warning” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fcourse%2Fautomation-with-puppet-self-paced-video-learning%2F||target:%20_blank|” button_block=”true”][vc_btn title=”Veritas ( VCS+VxVM) Live Webex” style=”classic” color=”warning” align=”center” link=”url:http%3A%2F%2Funixadminschool.com%2Fmember%2Fproduct%2Fveritas-training-vxvm-vcs-live-webex-training%2F||target:%20_blank|” button_block=”true”][/vc_tta_section][/vc_tta_tabs][vc_separator][/vc_column][/vc_row]

Querying service groups using hagrp
::: To display the state of a service group on a system
# hagrp -state [service_group] [-sys system]
::: To display the resources for a service group
# hagrp -resources service_group
::: To display a list of a service group’s dependencies
# hagrp -dep [service_group]
::: To display a service group on a system
# hagrp -display [service_group] [-sys system]
::: To display the attributes of a system ( Note that system names are case-sensitive.)
# hagrp -display [service_group] [-attribute attribute] [-sys system]
::: To display the value of a service group attribute
# hagrp -value service_group attribute
::: To forecast the target system for failover
# hagrp -forecast service_group [-policy failoverpolicy value] [-verbose]
- You cannot use the -forecast option when the service group state is in transition. For example, VCS rejects the command if the service group is in transition to an online state or to an offline state.
- The -forecast option is supported only for failover service groups. In case of offline failover service groups, VCS selects the target system based on the service group’s failover policy.
- The BiggestAvailable policy is applicable only when the service group attribute Load is defined and cluster attribute Statistics is enabled.
- The actual service group FailOverPolicy can be configured as any policy, but the forecast is done as though FailOverPolicy is set to BiggestAvailable.
Administrating Service Groups
::: To add a service group to your cluster
# hagrp -add service_group
::: To delete a service group
# hagrp -delete service_group
::: To modify a service group attribute
# hagrp -modify service_group attribute value [-sys system]The variable value represents:system_name1 priority1 system_name2 priority2
# hagrp -modify groupx SystemList -add SystemA 1 SystemB 2
# hagrp -modify groupx AutoStartList SystemA SystemB
# hagrp -modify groupx Parallel 1
- You cannot modify this attribute if resources have already been added to the service group.
- You can modify the attributes SystemList, AutoStartList, and Parallel only by using the command hagrp -modify.
- You cannot modify attributes created by the system, such as the state of the service group.
::: To Modifying the SystemList attribute using
# hagrp -modify groupx SystemList -add SystemC 3You must take the service group offline on the system that is being modified.
- When you add a system to a service group’s system list, the system must have been previously added to the cluster. When you use the command line, you can use the hasys -add command.
- When you delete a system from a service group’s system list, the service group must not be online on the system to be deleted.
- If you attempt to change a service group’s existing system list by using hagrp -modify without other options (such as -add or -update) the command fails.
::: To bring a service group online
# hagrp -online service_group -sys system# hagrp -online service_group -site [site_name]
::: To start a service group on a system and bring online only the resources already online on another system
# hagrp -online service_group -sys system -checkpartial other_system
::: To bring a service group and its associated child service groups online
# hagrp -online -propagate service_group -sys system# hagrp -online -propagate service_group -any# hagrp -online -propagate service_group -site site
::: To take a service group offline
# hagrp -offline service_group -sys system# hagrp -offline service_group -site site_name
::: To take a service group offline only if all resources are probed on the system
# hagrp -offline [-ifprobed] service_group -sys system
::: To take a service group and its associated parent service groups offline
# hagrp -offline -propagate service_group -sys system# hagrp -offline -propagate service_group -any# hagrp -offline -propagate service_group -site site_name
::: To switch a service group from one system to another
# hagrp -switch service_group -to system# hagrp -switch service_group -site site_name
# hagrp -switch service_group -any -clus remote_cluster
::: To migrate a service group from one system to another
# hagrp -migrate service_group -to system
- A single mandatory resource that can be migrated, having the SupportedOperations attribute set to migrate and the Operations attribute set to OnOff
- Other optional resources with Operations attribute set to None or OnOnly
- Stand alone service groups
- Service groups having one or both of the following configurations:
- Parallel child service groups with online local soft or online local firm dependencies
- Parallel or failover parent service group with online global soft or online remote soft dependencies
::: To freeze a service group (disable online, offline, and failover operations)
# hagrp -freeze service_group [-persistent]
::: To unfreeze a service group (reenable online, offline, and failover operations)
# hagrp -unfreeze service_group [-persistent]
::: To enable a service group
# hagrp -enable service_group [-sys system]
::: To disable a service group
# hagrp -disable service_group [-sys system]
::: To enable all resources in a service group
# hagrp -enableresources service_group
::: To disable all resources in a service group
# hagrp -disableresources service_group
::: To clear faulted, non-persistent resources in a service group
# hagrp -clear service_group [-sys system]
- If system is specified, all faulted, non-persistent resources are cleared from that system only.
- If system is not specified, the service group is cleared on all systems in the group’s SystemList in which at least one non-persistent resource has faulted.
::: To clear resources in ADMIN_WAIT state in a service group
# hagrp -clearadminwait [-fault] service_group -sys system
::: To flush a service group on a system
- Use the command hagrp -flush to clear the internal state of VCS.
- The hagrp -flush command transitions resource state from ‘waiting to go online’ to ‘not waiting’.
- You must use the hagrp -flush -force command to transition resource state from ‘waiting to go offline’ to ‘not waiting’.
# hagrp -flush [-force] group -sys system [-clus cluster | -localclus]
::: To flush all service groups on a system using a script . e.g : /opt/VRTSvcs/bin/haflush script
# haflush systemname
#!/bin/kshPATH=/opt/VRTSvcs/bin:$PATH; export PATHif [ $# -ne 1 ]; thenecho “usage: $0 <system name>”exit 1fihagrp -list |while read grp sys junkdolocsys=”${sys##*:}”case “$locsys” in“$1”)hagrp -flush “$grp” -sys “$locsys”;;esacdone
::: To link service groups
# hagrp -link parent_group child_group gd_category gd_location [gd_type]
- parent_group Name of the parent group
- child_group Name of the child group
- gd_category Category of group dependency (online/offline).
- gd_location The scope of dependency (local/global/remote/site).
- gd_type Type of group dependency (soft/firm/hard). Default is firm.
::: To unlink service groups
# hagrp -unlink parent_group child_group