VNF Primitive Reboot: Difference between revisions
From OSM Public Wiki
(Created page with "'''DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.''' The purpose of the Reboot primitive is to perform a safe reboot of your VNF. {|cla...") |
No edit summary |
||
Line 33: | Line 33: | ||
result, err = charms.sshproxy._run("/srv/myvnf/reboot.sh") | result, err = charms.sshproxy._run("/srv/myvnf/reboot.sh") | ||
except: | except: | ||
action_fail(' | action_fail('Reboot failed:' + err) | ||
else: | else: | ||
action_set({'outout': result}) | action_set({'outout': result}) |
Revision as of 09:16, 26 June 2018
DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.
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).