bootstrap-vz/providers/ec2/tasks/ebs.py

28 lines
599 B
Python
Raw Normal View History

from base import Task
from common import phases
class Create(Task):
description = 'Creating the EBS volume'
phase = phases.volume_creation
2013-06-26 20:14:37 +02:00
def run(self, info):
info.volume.create(info.connection, info.host['availabilityZone'])
2013-06-26 20:14:37 +02:00
class Attach(Task):
description = 'Attaching the volume'
phase = phases.volume_creation
predecessors = [Create]
def run(self, info):
info.volume.attach(info.host['instanceId'])
class Snapshot(Task):
2013-07-07 19:24:52 +02:00
description = 'Creating a snapshot of the EBS volume'
phase = phases.image_registration
def run(self, info):
info.snapshot = info.volume.snapshot()