VNF Primitive Reboot
From OSM Public Wiki
The purpose of the Reboot primitive is to perform a safe reboot of your VNF.
| Config | Required | ||
|---|---|---|---|
| Day 0 | Day 1 | Day 2 | |
| No | Yes | Yes | No |
Example code:
@when('actions.reboot')
def reboot():
err = ''
try:
"""
Run the command(s) necessary to perform a safe reboot of your VNF
This could be a single command that encapsulates your reboot process...
Or a series of commands for each step, such as:
- remove vnf from service
- reboot the vnf
- return vnf to service
"""
result, err = charms.sshproxy._run("/srv/myvnf/reboot.sh")
except:
action_fail('Reboot failed:' + err)
else:
action_set({'outout': result})
finally:
clear_flag('actions.reboot')
For a full example of creating a VNF charm, please see Creating your own VNF charm (Release FOUR).