Migrating VNF in CSP Cluster

You can deploy, update, or migrate VNFs/VMs on a CSP cluster. The VNFs within the CSP cluster can be migrated from one cluster to another within the CSP Cluster.

Migrating VNF in CSP Cluster

Scenario 1

Migrate the VM from CSP-1 to CSP-2, when CSP-1 is reachable.

To migrate the VM from CSP-1 to CSP-2, NB sends an update to ESC by changing the locator (vim_id, vim_project) when CSP-1 is reachable.

The following sample shows the VM group from the deployment payload/XML:

<vm_group>
            <name>Group1</name>
            <locator>
              <vim_id>CSP-1</vim_id>
              <vim_project>CSP-1</vim_project>
            </locator>
The following sample shows migration success notification of VM on CSP-2:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T05:41:16.299+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>SUCCESS</status>
    <status_code>200</status_code>
    <status_message>VIM Locator Updated Successfully</status_message>
    <vm_update_type>LOCATOR_UPDATED</vm_update_type>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <vm_group>group</vm_group>
    <vm_source>
      <vmid>6b0e7179-fd5e-487e-9570-e7ba98cce0ec</vmid>
      <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
      <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
      <vim_id>CSP-2</vim_id>
      <vim_project>CSP-2</vim_project>
      <interfaces>
        <interface>
          <nicid>0</nicid>
          <type>access</type>
          <port_id>539c6df4-4680-4bba-8a0d-d621947f2228</port_id>
          <admin_state_up>true</admin_state_up>
          <network>Eth0-2</network>
          <subnet/>
          <ip_address>192.168.23.62</ip_address>
          <netmask>255.255.255.0</netmask>
        </interface>
        <interface>
          <nicid>1</nicid>
          <type>trunk</type>
          <port_id>0adc3096-509c-49b7-9bd7-a25bbf2a9345</port_id>
          <admin_state_up>true</admin_state_up>
          <network>Eth0-2</network>
          <subnet/>
        </interface>
      </interfaces>
    </vm_source>
    <event>
      <type>VM_UPDATED</type>
    </event>
  </escEvent>
</notification>
 
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T05:41:16.322+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>SUCCESS</status>
    <status_code>200</status_code>
    <status_message>Service group update completed successfully</status_message>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <tenant_id>demo</tenant_id>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <event>
      <type>SERVICE_UPDATED</type>
    </event>
  </escEvent>

Scenario 2

Migrate the VM from CSP-1 to CSP-2, when CSP-1 is not reachable.

Assuming the recovery mode is auto and recovery policy as REBOOT_ONLY during initial deployment. Consider CSP-1 host fails and ESC detects the VM failed due to CSP-1 failure. ESC tries to recover the VM but fails because CSP-1 is down. Now the NB sends an update to move the VM from CSP-1 to CSP-2.

The following sample shows recovery failure notification of VM on CSP-1:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T04:30:18.642+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>SUCCESS</status>
    <status_code>200</status_code>
    <status_message>Recovery event for VM Generated ID [dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555] triggered.</status_message>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <tenant_id>demo</tenant_id>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <vm_group>group</vm_group>
    <vm_source>
      <vmid>6b0e7179-fd5e-487e-9570-e7ba98cce0ec</vmid>
      <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
      <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
      <vim_id>CSP-1</vim_id>
      <vim_project>CSP-1</vim_project>
    </vm_source>
    <event>
      <type>VM_RECOVERY_INIT</type>
    </event>
  </escEvent>
</notification>
 
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T04:31:20.449+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>FAILURE</status>
    <status_code>500</status_code>
    <status_message> VM [dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555] failed to be rebooted.</status_message>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <tenant_id>demo</tenant_id>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <vm_group>group</vm_group>
    <vm_source>
      <vmid>6b0e7179-fd5e-487e-9570-e7ba98cce0ec</vmid>
      <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
      <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
      <vim_id>CSP-2</vim_id>
      <vim_project>CSP-2</vim_project>
    </vm_source>
    <event>
      <type>VM_RECOVERY_REBOOT</type>
    </event>
  </escEvent>
</notification>
 
 
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T04:41:20.844+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>FAILURE</status>
    <status_code>500</status_code>
    <status_message>Recovery: Recovery completed with errors for VM: [dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555]</status_message>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <tenant_id>demo</tenant_id>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <vm_group>group</vm_group>
    <vm_source>
      <vmid>6b0e7179-fd5e-487e-9570-e7ba98cce0ec</vmid>
      <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
      <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
      <vim_id>CSP-1</vim_id>
      <vim_project>CSP-1</vim_project>
    </vm_source>
    <vm_target>
      <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
      <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
    </vm_target>
    <event>
      <type>VM_RECOVERY_COMPLETE</type>
    </event>
  </escEvent>
</notification>

Consider, you have a cluster of three CSPs (CSP-1,CSP-2, and CSP-3). VM is deployed on CSP-1

Before you begin

  • A VIM Connector must be created. For more information, See Adding VIM Connector to CSP Cluster Chapter.

  • VM is deployed with the same underlying storage. For more information, See Deploying VNFs Using ESC on CSP Cluster Chapter.

The following scenarios show the migration of the VMs:

Procedure


Step 1

Update locator details in the followingdeployment payload

(Update vim_id, vim_project to CSP-1 → CSP-2)
<locator>
<vim_id>CSP-2</vim_id>
<vim_project>CSP-2</vim_project>
</locator>

Step 2

Execute the following command for migrating the VM:
esc_nc_cli --user <username> --password <password> edit-config deploy_csp_2.xml
Example payload:
deploy_csp_1.xml
<esc_datamodel xmlns="http://www.cisco.com/esc/esc">
  <flavors>
    <flavor>
      <name>FLAVOR_2_4096_10000</name>
      <vcpus>2</vcpus>
      <memory_mb>4096</memory_mb>
      <root_disk_mb>10240</root_disk_mb>
    </flavor>
  </flavors>
  <tenants>
    <tenant>
      <name>name1</name>
      <vim_mapping>false</vim_mapping>
      <deployments>
        <deployment>
          <name>dep</name>
          <vm_group>
            <name>Group1</name>
            <locator>
              <vim_id>CSP-1</vim_id>
              <vim_project>CSP-1</vim_project>
            </locator>
            <image>csr1000v-universalk9.16.06.01.qcow2</image>
            <flavor>FLAVOR_2_4096_10000</flavor>
            <bootup_time>600</bootup_time>
            <recovery_wait_time>60</recovery_wait_time>
        <recovery_policy>
                <recovery_type>AUTO</recovery_type>
                <action_on_recovery>REBOOT_ONLY</action_on_recovery>
                <max_retries>1</max_retries>
        </recovery_policy>
            <interfaces>
               <interface>
                <nicid>0</nicid>
                <type>virtual</type>
                <model>virtio</model>
                <network>Eth0-2</network>
                <ip_address>192.168.23.61</ip_address>
                </interface>
             <interface>
                <nicid>1</nicid>
                <type>virtual</type>
                <model>virtio</model>
                <network>Eth0-2</network>
                  <ip_address>192.168.23.61</ip_address>
                <admin_state_up>false</admin_state_up>
              </interface>
            </interfaces>
            <kpi_data>
              <kpi>
                <event_name>VM_ALIVE</event_name>
                <metric_value>50</metric_value>
                <metric_cond>GT</metric_cond>
                <metric_type>UINT32</metric_type>
                <metric_occurrences_true>3</metric_occurrences_true>
                <metric_occurrences_false>3</metric_occurrences_false>
                <metric_collector>
                  <type>ICMPPing</type>
                  <nicid>0</nicid>
                  <poll_frequency>15</poll_frequency>
                  <polling_unit>seconds</polling_unit>
                  <continuous_alarm>false</continuous_alarm>
                </metric_collector>
              </kpi>
            </kpi_data>
            <rules>
              <admin_rules>
                <rule>
                  <event_name>VM_ALIVE</event_name>
                  <action>ALWAYS log</action>
                  <action>FALSE recover autohealing</action>
                  <action>TRUE servicebooted.sh</action>
                </rule>
              </admin_rules>
            </rules>
            <config_data>
              <configuration>
                <dst>iosxe_config.txt</dst>
                <file>file:///var/tmp/csr_config.sh</file>
              </configuration>
            </config_data>
            <scaling>
              <min_active>1</min_active>
              <max_active>1</max_active>
              <elastic>true</elastic>
              <static_ip_address_pool>
                <network>Eth0-2</network>
                <netmask>255.255.255.0</netmask>
                 <gateway>192.168.23.1</gateway>
                 <ip_address>192.168.23.61</ip_address>
              </static_ip_address_pool>
            </scaling>
            <extensions>
              <extension>
                <name>interfaces</name>
                <containers>
                   <container>
                    <name>0</name>
                    <properties>
                      <property>
                        <name>passthroughMode</name>
                        <value>none</value>
                      </property>
                      <property>
                        <name>tagged</name>
                        <value>false</value>
                      </property>
                      <property>
                        <name>type</name>
                        <value>access</value>
                      </property>
                      <property>
                        <name>vlan</name>
                        <value>1</value>
                      </property>
                    </properties>
                  </container>
                 <container>
                    <name>1</name>
                    <properties>
                      <property>
                        <name>passthroughMode</name>
                        <value>none</value>
                      </property>
                      <property>
                        <name>tagged</name>
                        <value>false</value>
                      </property>
                      <property>
                        <name>type</name>
                        <value>access</value>
                      </property>
                       <property>
                        <name>bandwidth</name>
                        <value>160</value>
                      </property>
                      <property>
                        <name>vlan</name>
                       <value>2</value>
                      </property>
                    </properties>
                  </container>
                </containers>
              </extension>
              <extension>
                <name>serial_ports</name>
                <containers>
                  <container>
                    <name>0</name>
                    <properties>
                      <property>
                        <name>serial_type</name>
                        <value>console</value>
                      </property>
                    </properties>
                  </container>
                </containers>
              </extension>
              <extension>
                <name>image</name>
                <properties>
                  <property>
                    <name>disk-resize</name>
                    <value>true</value>
                  </property>
                  <property>
                    <name>disk_type</name>
                    <value>virtio</value>
                  </property>
                  <property>
                    <name>disk_storage_name</name>
                    <value>gluster</value>
                  </property>
                </properties>
              </extension>
            </extensions>
          </vm_group>
        </deployment>
      </deployments>
    </tenant>
  </tenants>
</esc_datamodel>

Step 3

Check the notification for the success or failure of migration.
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T05:41:16.299+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>SUCCESS</status>
    <status_code>200</status_code>
    <status_message>VIM Locator Updated Successfully</status_message>
    <vm_update_type>LOCATOR_UPDATED</vm_update_type>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <vm_group>group</vm_group>
    <vm_source>
      <vmid>6b0e7179-fd5e-487e-9570-e7ba98cce0ec</vmid>
      <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
      <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
      <vim_id>CSP-2</vim_id>
      <vim_project>CSP-2</vim_project>
      <interfaces>
        <interface>
          <nicid>0</nicid>
          <type>access</type>
          <port_id>539c6df4-4680-4bba-8a0d-d621947f2228</port_id>
          <admin_state_up>true</admin_state_up>
          <network>Eth0-2</network>
          <subnet/>
          <ip_address>192.168.23.62</ip_address>
          <netmask>255.255.255.0</netmask>
        </interface>
        <interface>
          <nicid>1</nicid>
          <type>trunk</type>
          <port_id>0adc3096-509c-49b7-9bd7-a25bbf2a9345</port_id>
          <admin_state_up>true</admin_state_up>
          <network>Eth0-2</network>
          <subnet/>
        </interface>
      </interfaces>
    </vm_source>
    <event>
      <type>VM_UPDATED</type>
    </event>
  </escEvent>
</notification>
 
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2020-09-03T05:41:16.322+00:00</eventTime>
  <escEvent xmlns="http://www.cisco.com/esc/esc">
    <status>SUCCESS</status>
    <status_code>200</status_code>
    <status_message>Service group update completed successfully</status_message>
    <depname>dep</depname>
    <tenant>demo</tenant>
    <tenant_id>demo</tenant_id>
    <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
    <event>
      <type>SERVICE_UPDATED</type>
    </event>
  </escEvent>
</notification>

Scenario 3

Migrate the VM from Local to Gluster storage on the same CSP.

To migrate the VM from local to gluster, the NB sends an update with the following properties:

  1. Add a new VIM connector with cluster name.
    <property>
               <name>cluster_name</name>
               <value>Cluster_Test</value>
               </property>
    

    For more information on adding a new VIM connector, see Adding VIM Connector to CSP Cluster.

  2. After adding the new connector, update locator and disk_storage_name to gluster in deployment payload to enable configuration change.

    Following example shows how to add disk_storage_name as gluster under image extension properties and updating with the cluster VIM Connector:
    <vm_group>
    <name>Group1</name>
    <locator>
    <vim_id>CSP-1</vim_id>
    <vim_project>CSP-1</vim_project>
    </locator>
    <extension>
                    <name>image</name>
                    <properties>
                      <property>
                        <name>disk-resize</name>
                        <value>true</value>
                      </property>
                      <property>
                        <name>disk_type</name>
                        <value>virtio</value>
                      </property>
                      <property>
                        <name>disk_storage_name</name>
                        <value>gluster</value>
                      </property>
                    </properties>
                  </extension>
    
  3. Execute the following command to deploy the VIM:
    esc_nc_cli --user <username> --password <password> edit-config deploy.xml
    Check the following notification for success/failure migration.
    <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
      <eventTime>2020-09-03T05:41:16.299+00:00</eventTime>
      <escEvent xmlns="http://www.cisco.com/esc/esc">
        <status>SUCCESS</status>
        <status_code>200</status_code>
        <status_message>VIM Locator Updated Successfully</status_message>
        <vm_update_type>LOCATOR_UPDATED</vm_update_type>
        <depname>dep</depname>
        <tenant>demo</tenant>
        <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
        <vm_group>group</vm_group>
        <vm_source>
          <vmid>6b0e7179-fd5e-487e-9570-e7ba98cce0ec</vmid>
          <vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</vmname>
          <generated_vmname>dep_group_0_46e607a8-b797-4056-96f3-42a90a63b555</generated_vmname>
          <vim_id>CSP-2</vim_id>
          <vim_project>CSP-2</vim_project>
          <interfaces>
            <interface>
              <nicid>0</nicid>
              <type>access</type>
              <port_id>539c6df4-4680-4bba-8a0d-d621947f2228</port_id>
              <admin_state_up>true</admin_state_up>
              <network>Eth0-2</network>
              <subnet/>
              <ip_address>192.168.23.62</ip_address>
              <netmask>255.255.255.0</netmask>
            </interface>
            <interface>
              <nicid>1</nicid>
              <type>trunk</type>
              <port_id>0adc3096-509c-49b7-9bd7-a25bbf2a9345</port_id>
              <admin_state_up>true</admin_state_up>
              <network>Eth0-2</network>
              <subnet/>
            </interface>
          </interfaces>
        </vm_source>
        <event>
          <type>VM_UPDATED</type>
        </event>
      </escEvent>
    </notification>
     
    <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
      <eventTime>2020-09-03T05:41:16.322+00:00</eventTime>
      <escEvent xmlns="http://www.cisco.com/esc/esc">
        <status>SUCCESS</status>
        <status_code>200</status_code>
        <status_message>Service group update completed successfully</status_message>
        <depname>dep</depname>
        <tenant>demo</tenant>
        <tenant_id>demo</tenant_id>
        <depid>06c94f58-b753-425b-b97c-f7adb9140ead</depid>
        <event>
          <type>SERVICE_UPDATED</type>
        </event>
      </escEvent>
    </notification>