bootstrap-vz/providers/ec2/tasks/ebs.py
Anders Ingemann e1ab4dc1ae EC2 provider can now bootstrap EBS volumes again
Use tasksets in EC2 provider
2013-10-27 18:11:58 +01:00

27 lines
592 B
Python

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