VNF Primitive Reboot: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
(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
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''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.
The purpose of the Reboot primitive is to perform a safe reboot of your VNF.


Line 33: Line 31:
         result, err = charms.sshproxy._run("/srv/myvnf/reboot.sh")
         result, err = charms.sshproxy._run("/srv/myvnf/reboot.sh")
     except:
     except:
         action_fail('Upgrade failed:' + err)
         action_fail('Reboot failed:' + err)
     else:
     else:
         action_set({'outout': result})
         action_set({'outout': result})

Latest revision as of 12:33, 26 June 2018

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).