VNF Primitive Upgrade

From OSM Public Wiki
Revision as of 12:33, 26 June 2018 by Israelad (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF.

Config Required
Day 0 Day 1 Day 2
No Yes Yes No

Example code:

@when('actions.upgrade')
def upgrade_vnf():
    err = ''
    try:
        """
        Run the command(s) necessary to perform a safe software upgrade of your VNF
        This could be a single command that encapsulates your upgrade process...
        Or a series of commands for each step, such as:
         - check if update is available
         - remove vnf from service
         - download
         - upgrade
         - install
         - verify or fail
         - rollback
         - return vnf to service
        """
        result, err = charms.sshproxy._run("/srv/myvnf/upgrade.sh")
    except:
        action_fail('Upgrade failed:' + err)
    else:
        action_set({'outout': result})
    finally:
        clear_flag('actions.upgrade')

For a full example of creating a VNF charm, please see Creating your own VNF charm (Release FOUR).