mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +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
|
||||
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']
|
||||
ebs_volume = info.connection.create_volume(volume_size,
|
||||
info.host['availabilityZone'],
|
||||
|
|
|
@ -163,7 +163,7 @@ class PackageBox(Task):
|
|||
# VHDURI = "http://go.microsoft.com/fwlink/?LinkId=137171"
|
||||
volume_uuid = info.volume.get_uuid()
|
||||
[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:uuid', volume_uuid)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class EBSVolume(Volume):
|
|||
conn = e.connection
|
||||
zone = e.zone
|
||||
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)
|
||||
while self.volume.volume_state() != 'available':
|
||||
time.sleep(5)
|
||||
|
|
|
@ -166,7 +166,7 @@ class RegisterAMI(Task):
|
|||
from boto.ec2.blockdevicemapping import BlockDeviceType
|
||||
from boto.ec2.blockdevicemapping import BlockDeviceMapping
|
||||
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'][root_dev_name] = block_device
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue