VNF Operations
You can start, stop, and reboot VNFs. You can perform start, stop, and reboot operations using the RESTful interface.
POST ESCManager/v0/{internal_tenant_id}/deployments/service/{internal_deployment_id}
Example,
<?xml version='1.0' encoding='UTF-8'?>
<service_operation xmlns='urn:ietf:params:xml:ns:netconf:base:1.0'>
<operation>stop</operation>
</service_operation>
You must mention start, stop, or reboot in the operation field.
-
Start VNF: Starts all VMs, enables monitoring, and reassigns thresholds according to the KPI details. The VMs start running and move to VM_ALIVE_STATE. The service is in service_active_state. Only undeploy can interrupt the start VNF workflow.
-
Stop VNF: After the service is stopped, monitoring is disabled and all the VM services are stopped. The VMs are no longer available. The service is in service_stopped_state. VM is in shutoff_state. You can’t perform any recovery, scale out, scale in. You can only undeploy the VNFs.
-
Reboot VNF: Disables monitoring, and reboots all VMs. It stops and then starts in OpenStack, enables monitoring, and reassigns thresholds according to the KPI details. The VM is in VM_ALIVE_STATE and the service is in service_alive_state. Only undeploy can interrupt the reboot operation.
You can’t start monitoring a VNF which is already running. After a reboot, logging back into the VM must indicate the reboot, update, and monitoring details. It must also indicate recovery.
VM Operations
Similar to VNF operations, you can start, stop, and reboot, resize and migrate individual VMs.
POST ESCManager/v0/{internal_tenant_id}/deployments/vm/{vm_name}
Example,
<?xml version='1.0' encoding='UTF-8'?>
<vm_operation xmlns='urn:ietf:params:xml:ns:netconf:base:1.0'>
<operation>stop</operation>
<force>true/false</force>
</vm_operation>
You must mention start, stop, or reboot, resize, or migrate in the operation field.
VM Resize
Note |
The VM Resize feature is available from the 5.7 release. |
The VM resize feature in ESC provides flexibility in resizing the VMs once deployed by changing the flavor per VM group.
Changing the VM Flavor for Existing Deployment
To change the flavor of a VM, perform a service update request through the Netconf or REST API.
When a resize request is made from the ESC, the ESC stops monitoring the VM and makes the appropriate API request to OpenStack to resize the VM.
When OpenStack accepts the resize operation, the VM moves to the “VERIFY_RESIZE” state in OpenStack.
You can send a CONFIRM_RESIZE or REVERT_RESIZE request from ESC. Once the VM moves to the ACTIVE state, the ESC monitors the VM.
The REST API and RPC command in esc_nc_cli supports the confirm or revert requests.
Pre-requisite:
-
The new flavor, for example, SolTest-Cirros-Flavor-v2 to which the VM resize needs to be done must be present in OpenStack.
Service Update Request for Change Flavor:
-
For Netconf:
esc_nc_cli edit-config sample_deployment_update.xml
-
For REST API:
PUT /v0/deployments/{internal_deployment_id}
ESC NETCONF:
Changing [VM - ACTIVE to VERIFY_RESIZE state]
The following example shows the sample_deployment_update.xml for VM resize service update request for NETCONF and REST API. In this xml file, you needs to modify the existing flavor
name to a new flavor name for example SolTest-Cirros-Flavor-v2
that is present in OpenStack.
<?xml version="1.0" encoding="UTF-8"?>
<esc_datamodel xmlns="http://www.cisco.com/esc/esc">
<tenants>
<tenant>
<name>admin</name>
<deployments>
<deployment>
<name>Cirros-VNF</name>
<vm_group>
<name>SolTest-Cirros-VM-Group</name>
<bootup_time>60</bootup_time>
<recovery_wait_time>0</recovery_wait_time>
<image>SolTest-Cirros-Image</image>
<flavor>SolTest-Cirros-Flavor-v2</flavor>
<interfaces>
<interface>
<nicid>0</nicid>
<network>SolTest-Network</network>
</interface>
</interfaces>
<scaling>
<min_active>1</min_active>
<max_active>1</max_active>
<elastic>true</elastic>
</scaling>
<kpi_data>
<kpi>
<event_name>VM_ALIVE</event_name>
<metric_value>1</metric_value>
<metric_cond>GT</metric_cond>
<metric_type>UINT32</metric_type>
<metric_collector>
<type>ICMPPing</type>
<nicid>0</nicid>
<poll_frequency>3</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>"TRUE servicebooted.sh"</action>
<action>"FALSE recover autohealing"</action>
</rule>
</admin_rules>
</rules>
<config_data/>
</vm_group>
</deployment>
</deployments>
</tenant>
</tenants>
</esc_datamodel>
Upon successful deployment, an XML payload returns with <ok/>.
Upon unsuccessful deployment, a validation error or OpenStack API error with an appropriate error message returns.
ESC REST API:
An HTTP PUT operation specifies the ESCManager API with a deployment XML payload passed with an updated flavor name inside the tag.
For Example: <flavor>UpdateflavorName</flavor>.
PUT:/ESCManager/v0/deployments/{internal_deployment_id}
Upon successful deployment, an HTTP 200 code returns.
Upon an unsuccessful deployment, a validation error or OpenStack API error, along with an appropriate HTTP error code, and error messages return.
Notifications:
-
ESC sends the SERVICE_UPDATED notification, once the request in OpenStack VIM for resizing the operation is accepted.
Sample Notification sent by ESC for VM RESIZE request:
2022-04-11 05:45:47.232 INFO 2022-04-11 05:45:47.232 INFO ===== SEND NOTIFICATION STARTS ===== 2022-04-11 05:45:47.232 INFO Type: SERVICE_UPDATED 2022-04-11 05:45:47.232 INFO Status: SUCCESS 2022-04-11 05:45:47.232 INFO Status Code: 200 2022-04-11 05:45:47.232 INFO Status Msg: Service group update completed successfully 2022-04-11 05:45:47.233 INFO Tenant: admin 2022-04-11 05:45:47.233 INFO Deployment ID: 84779a3b-01e0-4eeb-9b1c-fe30317b6bb5 2022-04-11 05:45:47.233 INFO Deployment name: Cirros-VNF 2022-04-11 05:45:47.233 INFO ===== SEND NOTIFICATION ENDS =====
-
ESC sends the VM_VERIFY_RESIZE notification, once the VM goes to VERIFY_RESIZE state.
Sample Notification sent by ESC for VM RESIZE request:
2022-04-11 05:46:09.425 INFO 2022-04-11 05:46:09.425 INFO ===== SEND NOTIFICATION STARTS ===== 2022-04-11 05:46:09.425 INFO Type: VM_VERIFY_RESIZE 2022-04-11 05:46:09.425 INFO Status: SUCCESS 2022-04-11 05:46:09.426 INFO Status Code: 200 2022-04-11 05:46:09.426 INFO Status Msg: VM Resize request processed 2022-04-11 05:46:09.426 INFO VM State: VERIFY_RESIZE 2022-04-11 05:46:09.426 INFO Tenant ID: 31fb89f6647b4c109efda76479c07332 2022-04-11 05:46:09.426 INFO Deployment ID: 84779a3b-01e0-4eeb-9b1c-fe30317b6bb5 2022-04-11 05:46:09.426 INFO Deployment name: Cirros-VNF 2022-04-11 05:46:09.426 INFO VM group name:SolTest-Cirros-VM-Group 2022-04-11 05:46:09.426 INFO VM Source: 2022-04-11 05:46:09.426 INFO VM ID: 3b24cef1-5cf4-4e9c-b98e-682bfbdf8240 2022-04-11 05:46:09.426 INFO VM Name:cirros-vm_0_357b379e-bac5-4c6a-a214-0c0b1343ad4d 2022-04-11 05:46:09.427 INFO VM Name (Generated): cirros-vm_0_357b379e-bac5-4c6a-a214-0c0b1343ad4d 2022-04-11 05:46:09.427 INFO VIM ID: default_openstack_vim 2022-04-11 05:46:09.427 INFO VIM Project: admin 2022-04-11 05:46:09.427 INFO VIM Project ID: 31fb89f6647b4c109efda76479c07332 2022-04-11 05:46:09.427 INFO Host ID: 549a38c4fd21432060486a69bf9f82839f126adbe7f02e9cd2f4f3b6 2022-04-11 05:46:09.427 INFO Host Name: esc-soltest-116 2022-04-11 05:46:09.427 INFO ===== SEND NOTIFICATION ENDS ===== 2022-04-11 05:46:09.427 INFO
Confirm or Revert Request:
ESC NETCONF:
To confirm or revert the request, that is to change [VM - VERIFY_RESIZE to ACTIVE state], use the following RPC command.
esc_nc_cli Impaction <action: CONFIRM_RESIZE or REVERT_RESIZE><Generated VM Name>
For Example:
esc_nc_cli vm-action CONFIRM_RESIZE cirros-vm_0_357b379e-bac5-4c6a-a214-0c0b1343ad4d
Upon successful action, an XML payload returns with <ok/>
Upon unsuccessful action that is validation error or OpenStack API error, an appropriate error message returns.
ESC REST API:
An HTTP POST operation specifies the ESCManager API with an XML payload passed with the operation name inside the tag.
For Example,<operation>confirm_resize</operation> or <operation>revert_resize</operation>
POST:/ESCManager/v0/SystemAdminTenantId/deployments/vm/{Generated_vm_name}
The following shows the POST Sample payload:
[admin@dnd-admin-5-7-0-52-vtp-scan ~]$ cat operation.xml
<vm_operation xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operation>confirm_resize</operation>
</vm_operation>
To revert VM resize, use the following payload:
<vm_operation xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operation>revert_resize</operation>
</vm_operation>
Upon successful deployment, an HTTP 200 code returns.
Upon an unsuccessful deployment that is for a validation error or OpenStack API error, an appropriate HTTP error code, and error messages returns.
Notifications:
To confirm resize:
-
ESC sends the VM_CONFIRM_RESIZE_INIT notification once the confirm request in OpenStack VIM is accepted.
-
ESC sends the VM_CONFIRM_RESIZE_COMPLETE notification once it receives confirmation that the operation completed successfully in OpenStack VIM.
-
ESC sends the VM_ALIVE notification once the monitor is set and the VM is in the ACTIVE state.
To revert resize:
-
ESC sends the VM_REVERT_RESIZE_INIT notification once the confirm request in OpenStack VIM is accepted..
-
ESC sends the VM_REVERT_RESIZE_COMPLETE notification once it confirms that the operation completes successfully in OpenStack VIM.
-
ESC sends the VM_ALIVE notification once you set the monitor, and the VM is in the ACTIVE state.
Note |
In ESC, the flavor change request is at the VM Group level. But a VM Group can have more than one VM. This resize feature works only when the VM Group has a single VM in it. |
VM Migrate
Note |
The VM Migrate feature is available from the 5.7 release. |
ESC provides flexibility in migrating the VMs. Migration is of two types:
-
Live Migration
-
Cold Migration
Live migration transfers a live VM from one host to another while cold migration transfers a powered-off VM from one host to another.
VM Live Migration:
Use the following commands to perform VM live migration from one host to another:
Note |
The host parameter is optional. If the host parameter is not included, the NOVA scheduler selects the host. |
Example for REST API:
POST /v0/{internal_tenant_id}/deployments/migrate-vm/{vm_name}
curl -X POST 'http://localhost:8080/ESCManager/v0/test-tenant/deployments/migrate-vm/test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008' \
-H 'Content-Type: application/xml' \
-H 'Callback: http://localhost:9009/callback' \
-H 'Callback-ESC-Events: http://localhost:9009/event' \
--data-raw '<vm_migrate_operation xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operation>migrate</operation>
<migrationType>live</migrationType>
<host>Host-24</host>
</vm_migrate_operation>'
Example for RPC Payload:
<vmMigrate xmlns=http://www.cisco.com/esc/esc>
<vmName>test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008</vmName>
<migrationType>live</migrationType>
<host>Host-24</host>
</vmMigrate>
Example for NETCONF:
esc_nc_cli supports VM migration as follows:
Migrate VM Action : migrate-vm-action <vm-name> <migration-type> [block-migration] [host]
migration-type : = live|cold
block-migration : = true|false (live migration only)
Example for esc_nc_cli live migrate:
esc_nc_cli migrate-vm-action test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008 live
Example for esc_nc_cli live migrate with host:
esc_nc_cli migrate-vm-action test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008 live Host-22
Example for esc_nc_cli live migrate with block-migration:
esc_nc_cli migrate-vm-action test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008 live true
Example for esc_nc_cli live migrate with host and block-migration:
esc_nc_cli migrate-vm-action test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008 live true Host-22
Notifications:
ESC sends the following notifications once the live migration is successful:
VM_MIGRATE_INIT
VM_MIGRATED
VM_MIGRATE_COMPLETE
VM Cold Migration:
Use the following commands to perform VM cold migration from one host to another:
Note |
The host parameter is optional. If the host parameter is not included, the NOVA scheduler selects the host. |
Example for REST API:
POST /v0/{internal_tenant_id}/deployments/migrate-vm/{vm_name}
curl -X POST 'http://localhost:8080/ESCManager/v0/test-tenant/deployments/migrate-vm/test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008' \
-H 'Content-Type: application/xml' \
-H 'Callback: http://localhost:9009/callback' \
-H 'Callback-ESC-Events: http://localhost:9009/event' \
--data-raw '<vm_migrate_operation xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operation>migrate</operation>
<migrationType>cold</migrationType>
<host>Host-24</host>
</vm_migrate_operation>'
Example for RPC Payload:
<vmMigrate xmlns="http://www.cisco.com/esc/esc">
<vmName>test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008</vmName>
<migrationType>cold</migrationType>
<host>Host-24</host>
</vmMigrate>
Example for NETCONF:
Example for esc_nc_cli cold migrate:
esc_nc_cli migrate-vm-action test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008 cold
Example for esc_nc_cli cold migrate with host:
esc_nc_cli migrate-vm-action test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008 cold Host-22
Confirm or revert the migration once ESC sends the VM_VERIFY_RESIZE notification.
To confirm or revert, use either of the following commands: esc_nc_cli (Netconf) command or REST API command
VM Action : vm-action <action> <generated vm name>
action:=STOP|START|REBOOT|DISABLE_MONITOR|ENABLE_MONITOR|CONFIRM_RESIZE|REVERT_RESIZE
Example for esc_nc_cli to confirm the migration or resize:
esc_nc_cli vm-action CONFIRM_RESIZE test-dep_g1_0_6be93ee9-f7fb-473e-a3f6-eca281802008
Once the action is triggered, the following notifications are received:
-
VM_CONFIRM_RESIZE_INIT
-
VM_CONFIRM_RESIZE_COMPLETE
-
VM_ALIVE
REST API to confirm the migration or resize:
POST /v0/{internal_tenant_id}/deployments/vm/{vm_name}
Sample payload:
<vm_operation xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operation>confirm_resize</operation>
</vm_operation>
Notifications:
ESC sends the following notifications once the cold migration is successful:
VM_MIGRATE_INIT
VM_MIGRATED
VM_VERIFY_RESIZE
VM_CONFIRM_RESIZE_INIT
VM_CONFIRM_RESIZE_COMPLETE
VM_ALIVE
or
VM_REVERT_RESIZE_INIT
VM_REVERT_RESIZE_COMPLETE
VM_ALIVE