请输入搜索词进行查询
搜索 <book_title>...
产品文档
Last Published:
2019-11-18
Product(s):
Resiliency Platform & CloudMobility (3.4)
- 部分 I. 概述和规划
- Resiliency Platform 简介
- 关于 Resiliency Platform 功能和组件
- Resiliency Platform 部署中的复制
- 关于 Veritas Resiliency Platform Data Mover
- 使用 Resiliency Platform 的恢复选项
- 部署检查清单
- 系统要求
- 管理许可证
- 使用 Web 控制台
- Resiliency Platform 简介
- 部分 II. 部署和配置虚拟设备
- 部署和配置
- 通过 AWS Marketplace 在 AWS 中部署虚拟设备
- 在 AWS 中使用 OVA 文件部署虚拟设备
- 在 AWS 中部署数据网关
- 使用 PowerShell 脚本在 Azure 中部署虚拟设备
- 通过 Azure Marketplace 在 Azure 中部署虚拟设备
- 在 vCloud 中部署虚拟设备
- 在华为云中部署虚拟设备
- 在 Orange Recovery Engine 中部署虚拟设备
- 关于配置 Resiliency Platform 组件
- 虚拟设备安全功能
- 关于修补程序
- 应用更新
- 关于应用 Resiliency Platform 更新
- 设置 YUM 服务器
- 部署和配置
- 部分 III. 设置和管理 Resiliency Domain
- 管理 Resiliency Domain
- 与 NetBackup 集成
- 与 InfoScale Operations Manager 集成
- 部分 IV. 添加资产基础架构
- 管理 Resiliency Platform 主机资产
- 管理 VMware 资产
- 管理 Veritas Replication VIB
- 管理 Hyper-V 资产
- 管理网关
- 关于 Replication Gateway 对
- 管理数据网关
- 管理 Enclosure 资产
- 部分 V. 管理网络
- 管理网络
- 关于网络对象
- 管理设置
- 管理网络
- 部分 VI. 使用 Resiliency Group
- 组织资产
- 管理 Virtual Business Service
- 组织应用程序
- 管理自定义应用程序
- 管理 Service Objective
- 部分 VII. 配置灾难恢复
- 使用 Resiliency Platform Data Mover 配置
- 在 Amazon Web Services 中管理用于远程恢复 (DR) 的虚拟机
- 管理用于远程恢复 (DR) 到 Azure 的虚拟机
- 管理用于远程恢复 (DR) 到 OpenStack 的虚拟机
- 管理用于远程恢复 (DR) 到华为云的虚拟机
- 管理用于远程恢复 (DR) 到 Orange Recovery Engine 的虚拟机
- 在 vCloud Director 中管理用于远程恢复 (DR) 的虚拟机
- 使用 Resiliency Platform Data Mover 管理用于远程恢复 (DR) 的虚拟机
- 使用 Resiliency Platform Data Mover 管理物理计算机以进行远程恢复 (DR)
- 使用 NetBackup 配置
- 使用第三方复制技术配置
- 使用 Resiliency Platform Data Mover 配置
- 部分 VIII. 管理灾难恢复
- 对虚拟机执行 DR 操作
- 对 VBS 执行 DR 操作
- 对应用程序执行 DR 操作
- 撤离资产
- 管理 Resiliency Plan
- 关于自定义脚本
- 部分 IX. 产品设置
- 部分 X. 使用 Resiliency Platform API
- 部分 XI. 故障排除和使用命令行界面
- 故障排除
- 从灾难场景中恢复 Resiliency Platform 组件
- 解决管理员等待状态
- 使用 klish 菜单
- 使用 Application Enablement SDK
- 故障排除
示例脚本
找到以下示例模板,您可以使用该模板来开发应用程序模块脚本。同时还提供了使用硬编码数据的示例脚本,可以对其进行修改以开发您的脚本。
示例脚本
use strict; use warnings; use VRTS::AppSDK::AppEnablementSDK::Application; use VRTS::AppSDK::AppEnablementSDK::Constants qw(:LOG_LEVELS : APP_INST_ATTRS :APP_UNIT_ATTRS :APP_FILE_ATTRS : APP_CUSTOM_ATTRS :APP_INPUT_KEYS); # Define an application here my $appObj = new VRTS::AppSDK::AppEnablementSDK::Application("SampleApp"); if(defined $appObj) { # Set and register various operations that this application script # supports. $appObj->set_discovery_types("DEEP, PROBE"); $appObj->set_operation_types("START, STOP"); $appObj->register_operation_callback("START",\&start); $appObj->register_operation_callback("STOP",\&stop); $appObj->register_discovery_callback("PROBE",\&probe); $appObj->register_discovery_callback("DEEP",\&deep); print ($appObj->commit()); } ################################# #Function: start # #Starts an application instance # #Parameters: #arg - hash containing the application instance name # #Returns: # 0 if successful else 1 # you can also return success or failure message which is optional. ################################# sub start { my ($arg) = @_; my $FuncName = ( caller 0 )[3]; $appObj->log(LOGLEVEL_DEBUG,"Inside $FuncName"); my $inst_name = $arg->{INSTANCE_NAME}; $appObj->log(LOGLEVEL_DEBUG,"Application instance name: [$inst_name]"); #Write the code here to start an application instance #and return an appropriate status code and message. #Return 0 for success and 1 for failure. return 0, "Start is successful"; } ################################# #Function: stop # #Stops an application instance # #Parameters: #arg - hash containing the application instance name # #Returns: # 0 if successful else 1 # you can also return success or failure message which is optional. ################################# sub stop { my ($arg) = @_; my $FuncName = ( caller 0 )[3]; $appObj->log(LOGLEVEL_DEBUG,"Inside $FuncName"); my $inst_name = $arg->{INSTANCE_NAME}; $appObj->log(LOGLEVEL_DEBUG,"Application instance name: [$inst_name]"); #Write the code here to stop an application instance #and return an appropriate status code and message. #Return 0 for success and 1 for failure. return 0, "Stop is successful"; } ################################# #Function: probe # #Discovers and reports the application instance state # #Parameters: #arg - hash containing the application instance name # #Returns: # 0 if successful else 1 # you can also return success or failure message which is optional. ################################# sub probe { my ($arg) = @_; my $FuncName = ( caller 0 )[3]; $appObj->log(LOGLEVEL_DEBUG,"Inside $FuncName"); #Write the code here to discover and report the application instance name. #Report the state of the discovered application instance # on the Resiliency Platform. my $inst_name = $appObj->add_application_inst("app_inst"); if (defined $inst) { # The state must be reported either 'online' or 'offline' $inst_name->set_property(APP_INST_STATE,"Online"); } #return 0 if successful else 1 return 0, "Probe is successful"; } ################################# #Function: deep # #Discovers and reports the sub-components and data file information of #an application instance. # #Parameters: #arg - hash containing the application instance name # #Returns: # 0 if successful else 1 # you can also return success or failure message which is optional. ################################# sub deep { my ($arg) = @_; my $FuncName = ( caller 0 )[3]; $appObj->log(LOGLEVEL_DEBUG,"Inside $FuncName"); #Write the code here to discover and report the sub-components # and the data file information of an application instance. my $inst_name = $appObj->add_application_inst("app_inst"); if (defined $inst) { # Set application instance properties # Ensure that the following property is set, else the application # state is not displayed on the Resiliency Platform web console. # You cannot perform operations if the state is not displayed # on the console. # Accepted values are 'online' and 'offline' $inst_name->set_property(APP_INST_STATE,"Online"); # Following properties are optional $inst->set_property(APP_INST_VERSION,"1.0"); $inst->set_property(APP_INST_OWNER,"Administrator"); $inst->set_property(APP_INST_ISPARALLEL,"false"); $inst->set_property(APP_INST_HOMEDIR,"inst_homedir"); $inst->set_property(APP_INST_APP_TYPE,"emp_database"); $inst->set_property(APP_INST_APP_CATEGORY,"database"); $inst->set_property(APP_INST_TOTAL_SIZE,"100"); $inst->set_property(APP_INST_USED_SIZE,"90"); # Set application instance custom properties # Setting custom properties is optional. $inst->set_custom_property("app_disp_name", "sample_instance"); ################################# # If your application is clustered using any high availability # technology, then you need to set the following custom properties. # $inst->set_custom_property("ClusterType", "MSCS"); # $inst->set_custom_property("ServiceGroupName", "sample_sg"); # $inst->set_custom_property("IsClustered", "true"); #------------------------------- # Check if your application module script requires additional # information such as user name and password from the user # who is accessing the Resiliency Platform web console. # If information is required, then check if the information # is already asked and do we have its responses available here # using the following API. Use those responses to complete # your task. # Use following API with QID as input my $response1 = $inst->get_qresponse('1'); my $response2 = $inst->get_qresponse('2'); #------------------------------- # If response is not available then ask for information # again using the following API: # Define questions to be asked in a hash my $qid1 = { 'QID' => '1', 'QText' => 'Administrator user name', 'Mandatory' => 'yes', 'QDescription' => 'Specify the administrator user name to discover its data files.', 'Encrypted' => 'no'}; my $qid2 = { 'QID' => '2', 'QText' => 'Administrator password', 'Mandatory' => 'yes', 'QDescription' => 'Specify the administrator user password to discover its data files.', 'Encrypted' => 'yes'}; # Add the hash using the following API: $inst->add_question($qid1); $inst->add_question($qid2); #------------------------------- # Write the code here to discover an application unit (application # sub-components) and application files information. # Note: Discovering application unit is not mandatory # but discovering application files is mandatory. # Add application sub-component here my $unit = $inst->add_application_unit("app_unit"); # Add properties for application unit # Following properties are optional: $unit->set_property(APP_UNIT_OWNER, "unit_owner"); $unit->set_property(APP_UNIT_VERSION, "1.0"); $unit->set_property(APP_UNIT_STATE, "online"); $unit->set_property(APP_UNIT_ISPARALLEL, "false"); $unit->set_property(APP_UNIT_HOMEDIR, "unit_homedir"); $unit->set_property(APP_UNIT_TYPE, "database"); $unit->set_property(APP_UNIT_TOTAL_SIZE, "100"); $unit->set_property(APP_UNIT_USED_SIZE, "50"); # Setting custom properties is optional. $unit->set_custom_property("unit_disp_name", "sample_unit"); #------------------------------- # Write the code here to discover information of application data files. my $file = $inst->add_application_file("app_file"); # Following property is important and mandatory if you want to # configure your application for disaster recovery. # Value of this property could be data, log, etc. but the # Resiliency Platform considers only those DR configuration files # which are marked as 'data'. $file->set_property(APP_FILE_TYPE, "data"); # Following property is important and mandatory if you want to # configure your application for disaster recovery. # Value of the property must be full file path # e.g. '/root/app_inst/app_file.data' or # 'c:\\app_inst\\app_file.data' $file->set_property(APP_FILE_PATH, "c:\\app_inst\\app_file.data"); # Following properties are optional: $file->set_property(APP_FILE_NAME, "app_file.data"); $file->set_property(APP_FILE_VERSION, "1.0"); $file->set_property(APP_FILE_OWNER, "administrator"); $file->set_property(APP_FILE_STATE, "online"); $file->set_property(APP_FILE_SIZE, "10"); $file->set_property(APP_FILE_PERMISSION, "all"); # Setting custom properties is optional. $file->set_custom_property("file_desc", "Database file"); } #return 0 if successful else 1 return 0, "deep discovery is successful"; }
更多信息