VNF Primitive Reboot

From OSM Public Wiki
Revision as of 09:14, 26 June 2018 by Israelad (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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('Upgrade 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).