small updates to snapshotting

This commit is contained in:
tmetsch 2012-10-19 16:28:05 +02:00
parent 9d692982e3
commit 5f12796b60
3 changed files with 19 additions and 7 deletions

View File

@ -12,7 +12,7 @@ Usage
0. Install dependencies: `pip install pyssf`
1. Install this egg: `python setup.py install` (or `pip install
openstackocci`)
occi-os-folsom`)
2. Configure OpenStack - Add application to `api-paste.ini` of nova and
enable the API
@ -39,7 +39,7 @@ picked yourself):
# pipeline = sizelimit authtoken keystonecontext ratelimit occiapp
[app:occiapp]
use = egg:openstackocci#occi_app
use = egg:occi-os-folsom#occi_app
Make sure the API (name from above) is enabled in `nova.conf`:
@ -60,4 +60,4 @@ There is further documentation on [setting up your development environment
in the wiki](https://github.com/tmetsch/occi-os/wiki/DevEnv).
# Deployment using Puppet
This library can be integrated using puppet as a configuration management tool. See [this blog post for more details](http://www.cloudcomp.ch/2012/09/automating-occi-installations/).
This library can be integrated using puppet as a configuration management tool. See [this blog post for more details](http://www.cloudcomp.ch/2012/09/automating-occi-installations/).

View File

@ -126,9 +126,12 @@ class StorageBackend(backend.KindBackend, backend.ActionBackend):
LOG.warn('The operations online, offline, backup and resize are '
'currently not supported!')
elif action == infrastructure.SNAPSHOT:
volume_id = int(entity.attributes['occi.core.id'])
name = str(volume_id) + date.today().isoformat()
description = entity.attributes['occi.core.summary']
volume_id = entity.attributes['occi.core.id']
name = volume_id + date.today().isoformat()
if 'occi.core.summary' in entity.attributes:
description = entity.attributes['occi.core.summary']
else:
description = 'N/A'
storage.snapshot_storage_instance(volume_id, name, description,
extras['nova_ctx'])

View File

@ -328,6 +328,8 @@ class SystemTest(unittest.TestCase):
"""
Test attaching and detaching storage volumes + snapshotting etc.
"""
# TODO: test snapshot!
# create new VM
cats = ['m1.tiny; scheme="http://schemas.openstack'
'.org/template/resource#"',
@ -342,10 +344,17 @@ class SystemTest(unittest.TestCase):
attrs = ['occi.storage.size = 1.0']
vol_location = create_node(self.token, cats, attrs)
time.sleep(25)
# get individual node.
LOG.debug(get_node(self.token, vol_location)['x-occi-attribute'])
time.sleep(15)
# snapshot volume
#trigger_action(self.token, vol_location +
# '?action=snapshot',
# 'snapshot; scheme="http://schemas.ogf'
# '.org/occi/infrastructure/storage/action#"')
# not doing above - since than I cannot delete the volume later...
# link volume and compute
cats = ['storagelink; scheme="http://schemas.ogf'