VNF Primitive Upgrade: Difference between revisions
From OSM Public Wiki
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF. | The purpose of the Upgrade primitive is to perform an upgrade of operational software on your VNF. | ||
{|class="wikitable" | |||
!colspan="3" style="text-align:center;" | Config | |||
!colspan="1" rowspan="2" | Required | |||
|- | |||
! style="text-align:left;" | Day 0 | |||
! Day 1 | |||
! Day 2 | |||
|- | |||
| style="text-align:center;" | No | |||
| style="text-align:center;" | Yes | |||
| style="text-align:center;" | Yes | |||
| style="text-align:center;" | No | |||
|} | |||
Example code: | |||
<pre> | <pre> | ||
@when('actions.upgrade') | @when('actions.upgrade') | ||
Line 10: | Line 23: | ||
err = '' | err = '' | ||
try: | 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") | result, err = charms.sshproxy._run("/srv/myvnf/upgrade.sh") | ||
except: | except: | ||
action_fail(' | action_fail('Upgrade failed:' + err) | ||
else: | else: | ||
action_set({'outout': result}) | action_set({'outout': result}) |
Revision as of 09:12, 26 June 2018
DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.
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).