RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1# ! Already an OVA is installed. Now we are going to run the script that will deactivate/uninstall old OVA and add the new one
RP/0/RSP0/CPU0:R1#sh running-config virtual-service 
virtual-service enable
virtual-service ipsecf_0
 vnic interface TenGigE0/0/1/2
 vnic interface TenGigE0/0/1/3
 vnic interface TenGigE0/0/1/4
 vnic interface TenGigE0/0/1/5
 vnic interface TenGigE0/0/1/6
 vnic interface TenGigE0/0/1/7
 vnic interface TenGigE0/0/1/8
 vnic interface TenGigE0/0/1/9
 activate
!

RP/0/RSP0/CPU0:R1#sh virtual-service list detail 

Virtual Service : ipsecf_0

VM Name                Admin Status      Oper Status      
____________________________________________________________
ipsecf_0CP             Activated         Up               
ipsecf_0DP             Activated         Up               
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1#  
RP/0/RSP0/CPU0:R1#sh running-config event manager environment 
event manager environment _eem_vsm_slot 0
event manager environment _eem_tftp_ova_file tftp://202.153.144.25//auto/tftp-blr-users3/pjeyapal/images/522_23i/asr9k-vsm-ipsec-fp-DT-5.2.2.18i.ova

RP/0/RSP0/CPU0:R1#  ! Adding the required env variables
RP/0/RSP0/CPU0:R1# 
RP/0/RSP0/CPU0:R1#conf t
RP/0/RSP0/CPU0:R1(config)#event manager environment  _eem_tftp_ova_file  tftp://202.153.144.25//auto/tftp-blr-users3/pjeyapal/images/522_23i/asr9k-vsm-ipsec-hp-DT-5.2.2.18i.ova
RP/0/RSP0/CPU0:R1(config)#event manager environment _eem_ova_profile half
RP/0/RSP0/CPU0:R1(config)#commit
RP/0/RSP0/CPU0:R1(config)#
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1# ! Checking the configured EEM environmental variables
RP/0/RSP0/CPU0:R1#sh running-config event manager environment 
event manager environment _eem_vsm_slot 0
event manager environment _eem_ova_profile half
event manager environment _eem_tftp_ova_file tftp://202.153.144.25//auto/tftp-blr-users3/pjeyapal/images/522_23i/asr9k-vsm-ipsec-hp-DT-5.2.2.18i.ova
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1# 
RP/0/RSP0/CPU0:R1# ! Triggering the script
RP/0/RSP0/CPU0:R1#event manager run no_ova_install_activate.tcl
RP/0/RSP0/CPU0:R1# 

RP/0/RSP0/CPU0:R1#sh logging | i EEM             
RP/0/RSP0/CPU0:Dec 16 07:55:34.297 : tclsh[65861]: %HA-HA_EEM-6-ACTION_SYSLOG_LOG_INFO : no_ova_install_activate.tcl: Script to Install/Activate OVA started, this will remove  any existing ova on provided vsm and install the new ova.  Press ctrl+c to abort. 
RP/0/RSP0/CPU0:Dec 16 07:55:35.923 : tclsh[65861]: %HA-HA_EEM-6-ACTION_SYSLOG_LOG_INFO : no_ova_install_activate.tcl: Arguments passed by User and Validated to be correct are as follows 
RP/0/RSP0/CPU0:Dec 16 07:55:35.924 : tclsh[65861]: %HA-HA_EEM-6-ACTION_SYSLOG_LOG_INFO : no_ova_install_activate.tcl: |*| _eem_tftp_ova_file  : tftp://202.153.144.25//auto/tftp-blr-users3/pjeyapal/images/522_23i/asr9k-vsm-ipsec-hp-DT-5.2.2.18i.ova |*| _eem_router_ova_path : disk0a:/usr |*| _eem_vsm_slot : 0 |*| _eem_ova_type : ipsec |5| _eem_ova_profile : half 
RP/0/RSP0/CPU0:Dec 16 07:55:35.924 : tclsh[65861]: %HA-HA_EEM-6-ACTION_SYSLOG_LOG_INFO : no_ova_install_activate.tcl: |*| _eem_service_members : 2 3 4 5 |*| _eem_need_bundle_config : 0    |*| _eem_service_name : ipsech_0 
RP/0/RSP0/CPU0:Dec 16 07:55:35.924 : tclsh[65861]: %HA-HA_EEM-6-ACTION_SYSLOG_LOG_INFO : no_ova_install_activate.tcl: Please press ctrl+c to abort if the above arguments needs to be  changed and policy needs to be rerun  
RP/0/RSP0/CPU0:Dec 16 08:07:44.457 : tclsh[65861]: %HA-HA_EEM-6-ACTION_SYSLOG_LOG_INFO : no_ova_install_activate.tcl: OVA Installed and Activated successfully 
RP/0/RSP0/CPU0:R1# ! Above log marks the end of Installation and Activation
RP/0/RSP0/CPU0:R1# ! Following commands shows the successful Installation and Activation

RP/0/RSP0/CPU0:R1#sh virtual-service list detail 

Virtual Service : ipsech_0

VM Name                Admin Status      Oper Status      
____________________________________________________________
ipsech_0CP             Activated         Up               
ipsech_0DP             Activated         Up               
RP/0/RSP0/CPU0:R1#sh virtual-service list        

Virtual Service List:

Service Name           Status            Package Name             Node Name    
______________________________________________________________________________  
ipsech_0               Activated         ipsec_half.ova           0/0/CPU0     
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1#sh running-config virtual-service 
virtual-service enable
virtual-service ipsech_0
 vnic interface TenGigE0/0/1/2
 vnic interface TenGigE0/0/1/3
 vnic interface TenGigE0/0/1/4
 vnic interface TenGigE0/0/1/5
 activate
!
RP/0/RSP0/CPU0:R1#
RP/0/RSP0/CPU0:R1# ! Connect to CP VM and check the base configuration that is been done by script 
RP/0/RSP0/CPU0:R1#virtual-service connect name ipsech_0CP console node 0/0/CPU0 
Trying 192.0.128.3...
Connected to 192.0.128.3.
Escape sequence is '^^e'.

Router>en 
Password: lab  
Router#shrun        
Router#shrunin
Router#sh run 
Router#sh running-config in
Router#sh running-config interface gi
Router#sh running-config interface gigabitEthernet 0/0
Building configuration...

Current configuration : 135 bytes
!
interface GigabitEthernet0/0
 ip address 10.0.150.226 255.255.255.252
 duplex auto
 speed auto
 media-type rj45
 no mop enabled
end

Router#sh running-config interface gigabitEthernet 0/1
Building configuration...

Current configuration : 135 bytes
!
interface GigabitEthernet0/1
 ip address 10.0.151.226 255.255.255.252
 duplex auto
 speed auto
 media-type rj45
 no mop enabled
end

Router#sh ip int br
Router#sh ip int brief 
Interface                  IP-Address      OK? Method Status                Protocol
GigabitEthernet0/0         10.0.150.226    YES manual up                    up      
GigabitEthernet0/1         10.0.151.226    YES manual up                    up      
Router#