mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Use volume.size instead of asking the partitionmap
This commit is contained in:
parent
218936d09e
commit
a433f1c299
4 changed files with 4 additions and 4 deletions
|
@ -33,7 +33,7 @@ class CreateFromSnapshot(Task):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
volume_size = int(info.volume.partition_map.get_total_size() / 1024)
|
volume_size = int(info.volume.size / 1024)
|
||||||
snapshot = info.manifest.plugins['prebootstrapped']['snapshot']
|
snapshot = info.manifest.plugins['prebootstrapped']['snapshot']
|
||||||
ebs_volume = info.connection.create_volume(volume_size,
|
ebs_volume = info.connection.create_volume(volume_size,
|
||||||
info.host['availabilityZone'],
|
info.host['availabilityZone'],
|
||||||
|
|
|
@ -163,7 +163,7 @@ class PackageBox(Task):
|
||||||
# VHDURI = "http://go.microsoft.com/fwlink/?LinkId=137171"
|
# VHDURI = "http://go.microsoft.com/fwlink/?LinkId=137171"
|
||||||
volume_uuid = info.volume.get_uuid()
|
volume_uuid = info.volume.get_uuid()
|
||||||
[disk] = root.findall('./ovf:DiskSection/ovf:Disk', namespaces)
|
[disk] = root.findall('./ovf:DiskSection/ovf:Disk', namespaces)
|
||||||
attr(disk, 'ovf:capacity', info.volume.partition_map.get_total_size() * 1024 * 1024)
|
attr(disk, 'ovf:capacity', info.volume.size * 1024 * 1024)
|
||||||
attr(disk, 'ovf:format', info.volume.ovf_uri)
|
attr(disk, 'ovf:format', info.volume.ovf_uri)
|
||||||
attr(disk, 'ovf:uuid', volume_uuid)
|
attr(disk, 'ovf:uuid', volume_uuid)
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ class EBSVolume(Volume):
|
||||||
conn = e.connection
|
conn = e.connection
|
||||||
zone = e.zone
|
zone = e.zone
|
||||||
import math
|
import math
|
||||||
size = int(math.ceil(self.partition_map.get_total_size() / 1024))
|
size = int(math.ceil(self.size / 1024))
|
||||||
self.volume = conn.create_volume(size, zone)
|
self.volume = conn.create_volume(size, zone)
|
||||||
while self.volume.volume_state() != 'available':
|
while self.volume.volume_state() != 'available':
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
|
@ -166,7 +166,7 @@ class RegisterAMI(Task):
|
||||||
from boto.ec2.blockdevicemapping import BlockDeviceType
|
from boto.ec2.blockdevicemapping import BlockDeviceType
|
||||||
from boto.ec2.blockdevicemapping import BlockDeviceMapping
|
from boto.ec2.blockdevicemapping import BlockDeviceMapping
|
||||||
block_device = BlockDeviceType(snapshot_id=info.snapshot.id, delete_on_termination=True,
|
block_device = BlockDeviceType(snapshot_id=info.snapshot.id, delete_on_termination=True,
|
||||||
size=info.volume.partition_map.get_total_size() / 1024)
|
size=info.volume.size / 1024)
|
||||||
registration_params['block_device_map'] = BlockDeviceMapping()
|
registration_params['block_device_map'] = BlockDeviceMapping()
|
||||||
registration_params['block_device_map'][root_dev_name] = block_device
|
registration_params['block_device_map'][root_dev_name] = block_device
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue