bootstrap-vz/bootstrapvz/providers/ec2/tasks/ebs.py
Anders Ingemann 3b23ccf92c Don't use DictClass for provider namespaces
It's a hack only for the manifest vars and shouldn't be used for anything else
2014-04-10 00:20:35 +02:00

30 lines
694 B
Python

from bootstrapvz.base import Task
from bootstrapvz.common import phases
class Create(Task):
description = 'Creating the EBS volume'
phase = phases.volume_creation
@classmethod
def run(cls, info):
info.volume.create(info._ec2['connection'], info._ec2['host']['availabilityZone'])
class Attach(Task):
description = 'Attaching the volume'
phase = phases.volume_creation
predecessors = [Create]
@classmethod
def run(cls, info):
info.volume.attach(info._ec2['host']['instanceId'])
class Snapshot(Task):
description = 'Creating a snapshot of the EBS volume'
phase = phases.image_registration
@classmethod
def run(cls, info):
info._ec2['snapshot'] = info.volume.snapshot()