2013-06-23 12:00:17 +02:00
|
|
|
from base import Task
|
2013-06-23 15:26:08 +02:00
|
|
|
from common import phases
|
2013-09-15 13:19:45 +02:00
|
|
|
from common.tasks import volume
|
2013-06-24 23:12:39 +02:00
|
|
|
|
2013-06-23 12:00:17 +02:00
|
|
|
|
2013-07-13 13:55:12 +02:00
|
|
|
class Create(Task):
|
2013-09-15 13:19:45 +02:00
|
|
|
description = 'Creating the EBS volume'
|
2013-07-09 20:32:50 +02:00
|
|
|
phase = phases.volume_creation
|
2013-09-15 13:19:45 +02:00
|
|
|
before = [volume.Attach]
|
2013-06-26 20:14:37 +02:00
|
|
|
|
2013-06-23 12:00:17 +02:00
|
|
|
def run(self, info):
|
2013-09-15 13:19:45 +02:00
|
|
|
info.volume.create(info.connection, info.host['availabilityZone'])
|
2013-06-23 12:00:17 +02:00
|
|
|
|
2013-06-26 20:14:37 +02:00
|
|
|
|
2013-07-13 13:55:12 +02:00
|
|
|
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):
|
2013-09-15 13:19:45 +02:00
|
|
|
info.snapshot = info.volume.snapshot()
|