mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
HVM AMIs only work when EBS backed right now.
S3 backed AMIs only work when they are unpartitioned. Remove json schema restriction and add some nicer messages in the validation function
This commit is contained in:
parent
612fe46186
commit
a3b84737f1
3 changed files with 11 additions and 15 deletions
|
@ -39,17 +39,24 @@ def validate_manifest(data, validator, error):
|
|||
|
||||
bootloader = data['system']['bootloader']
|
||||
virtualization = data['virtualization']
|
||||
backing = data['volume']['backing']
|
||||
partition_type = data['volume']['partitions']['type']
|
||||
|
||||
if virtualization == 'pvm' and bootloader != 'pvgrub':
|
||||
error('Paravirtualized AMIs only support pvgrub as a bootloader', ['system', 'bootloader'])
|
||||
|
||||
if virtualization == 'hvm':
|
||||
if backing != 'ebs':
|
||||
error('HVM AMIs currently only work when they are EBS backed', ['volume', 'backing'])
|
||||
if bootloader != 'extlinux':
|
||||
error('HVM AMIs only support extlinux as a bootloader', ['system', 'bootloader'])
|
||||
error('HVM AMIs currently only work with extlinux as a bootloader', ['system', 'bootloader'])
|
||||
if bootloader == 'extlinux' and partition_type not in ['none', 'msdos']:
|
||||
error('HVM AMIs booted with extlinux currently only support the `none\' or `msdos\' partition type',
|
||||
['system', 'bootloader'])
|
||||
error('HVM AMIs booted with extlinux currently work with unpartitioned or msdos partitions volumes',
|
||||
['volume', 'partitions', 'type'])
|
||||
|
||||
if backing == 's3':
|
||||
if partition_type != 'none':
|
||||
error('S3 backed AMIs currently only work with unpartitioned volumes', ['system', 'bootloader'])
|
||||
|
||||
|
||||
def resolve_tasks(taskset, manifest):
|
||||
|
|
|
@ -28,17 +28,6 @@
|
|||
}
|
||||
},
|
||||
"required": ["bucket", "region"]
|
||||
},
|
||||
"volume": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"partitions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": { "enum": ["none"] }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["image"],
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"partitions": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": { "enum": ["none", "msdos"] }
|
||||
"type": { "enum": ["none", "msdos", "gpt"] }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue