Commit edf3104d authored by aticig's avatar aticig Committed by calvinosanc1
Browse files

Adding Updating Status of Created Items Periodically in Reference

parent a44df41a
Loading
Loading
Loading
Loading
+67 −0
Original line number Diff line number Diff line
@@ -95,4 +95,71 @@ Disk IO quota describes the disk IO operations resource allocation policy. Limit
- reserve: Defines the guaranteed minimum reservation. If needed, the machine will definitely get allocated the reserved amount of resources.
- shares: Number of shares allocated. Specifies the proportional weighted share for the domain. If this element is omitted, the service defaults to the OS provided defaults.

## Updating Status of Created Items Periodically in RO Module

RO module configuration file includes the following settings to perform periodic status updates of created items:

- refresh_active: The period to poll the active VM status
- refresh_build: The period to poll the VM status which is still building
- refresh_image: The period to check the status of a created image, flavor item
- refresh_error: The period to check the status of a failed item
- queue_size: RO task queue size

RO module configuration file includes the default values of refresh periods in seconds as follows:

```bash
[period]
refresh_active: 60
refresh_build: 15
refresh_image: 3600 * 10
refresh_error: 600
queue_size: 100
```

`refresh_active` parameter is used to update the VM status from VIM for every given period of time seconds. This parameter is allowed to take the values which are equal/greater than 60 or -1. Setting `refresh_active` to -1 disables the periodic VM updates from VIM. There aren't defined configuration constraints for the other parameters.


### Polling VM status

RO module updates the VDU details in VNF records periodically unless disabled. For VIM types other than Openstack, RO updates the VM status based on vm_id which is kept in the completed ro_tasks collection in the MongoDB. For each virtual machine, it sends several requests to the Cloud APIs to get VM details, networks and ports details. 
For Openstack VIM type, RO executes a monitoring job which is executed periodically according to refresh_active period. This job collects all the VM details and port details belongs to a VIM account by sending only two requests to Openstack cloud APIs. Then, collected bulk data is parsed and all the active VM status are updated. This improvement in VM polling mechanism for Openstack, prevents hammering Cloud APIs if there are numerous VMs need to be monitored.

### Configuring VM status Updates 

#### Configuring Refresh Periods in OSM

Kubernetes Deployment of RO Module is updated to add the environment variables with custom values.

```yaml
image: opensourcemano/ro:testing-daily
env:
- name:  OSMRO_PERIOD_REFRESH_ACTIVE
  value: 120
- name:  OSMRO_PERIOD_REFRESH_BUILD
  value: 30
- name:  OSMRO_PERIOD_REFRESH_IMAGE
  value: 3600
- name:  OSMRO_PERIOD_REFRESH_ERROR
  value: 600
- name:  OSMRO_PERIOD_QUEUE_SIZE
  value: 100
imagePullPolicy: IfNotPresent
name: ro
```

#### Configuring Refresh Periods in Charmed-OSM

RO charm could be configured to change the refresh periods with the following configuration parameters: 

- period_refresh_active
- period_refresh_build
- period_refresh_image
- period_refresh_error
- period_refresh_queue_size


Sample command to get the VM status updates for each 100 seconds:

```bash
juju config ro period_refresh_active=100
```