Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/azure-cli-core/azure/cli/core/profiles/_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def default_api_version(self):
'disk_accesses': '2020-05-01',
'snapshots': '2020-05-01',
'galleries': '2019-12-01',
'gallery_images': '2019-12-01',
'gallery_images': '2020-09-30',
'gallery_image_versions': '2019-12-01',
'virtual_machine_scale_sets': '2020-06-01'
}),
Expand Down
1 change: 1 addition & 0 deletions src/azure-cli/azure/cli/command_modules/vm/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ def load_arguments(self, _):
c.argument('release_note_uri', help='The release note uri')
c.argument('end_of_life_date', help="the end of life date, e.g. '2020-12-31'")
c.argument('disallowed_disk_types', nargs='*', help='disk types which would not work with the image, e.g., Standard_LRS')
c.argument('features', help='A list of gallery image features. E.g. "IsSecureBootSupported=true IsMeasuredBootSupported=false"')

with self.argument_context('sig create') as c:
c.argument('description', help='the description of the gallery')
Expand Down
18 changes: 14 additions & 4 deletions src/azure-cli/azure/cli/command_modules/vm/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3177,10 +3177,10 @@ def create_gallery_image(cmd, resource_group_name, gallery_name, gallery_image_n
release_note_uri=None, eula=None, description=None, location=None,
minimum_cpu_core=None, maximum_cpu_core=None, minimum_memory=None, maximum_memory=None,
disallowed_disk_types=None, plan_name=None, plan_publisher=None, plan_product=None, tags=None,
hyper_v_generation='V1'):
hyper_v_generation='V1', features=None):
# pylint: disable=line-too-long
GalleryImage, GalleryImageIdentifier, RecommendedMachineConfiguration, ResourceRange, Disallowed, ImagePurchasePlan = cmd.get_models(
'GalleryImage', 'GalleryImageIdentifier', 'RecommendedMachineConfiguration', 'ResourceRange', 'Disallowed', 'ImagePurchasePlan')
GalleryImage, GalleryImageIdentifier, RecommendedMachineConfiguration, ResourceRange, Disallowed, ImagePurchasePlan, GalleryImageFeature = cmd.get_models(
'GalleryImage', 'GalleryImageIdentifier', 'RecommendedMachineConfiguration', 'ResourceRange', 'Disallowed', 'ImagePurchasePlan', 'GalleryImageFeature')
client = _compute_client_factory(cmd.cli_ctx)
location = location or _get_resource_group_location(cmd.cli_ctx, resource_group_name)

Expand All @@ -3197,11 +3197,21 @@ def create_gallery_image(cmd, resource_group_name, gallery_name, gallery_image_n
if any([plan_name, plan_publisher, plan_product]):
purchase_plan = ImagePurchasePlan(name=plan_name, publisher=plan_publisher, product=plan_product)

feature_list = None
if features:
feature_list = []
for item in features.split():
try:
key, value = item.split('=', 1)
feature_list.append(GalleryImageFeature(name=key, value=value))
except ValueError:
raise CLIError('usage error: --features KEY=VALUE [KEY=VALUE ...]')

image = GalleryImage(identifier=GalleryImageIdentifier(publisher=publisher, offer=offer, sku=sku),
os_type=os_type, os_state=os_state, end_of_life_date=end_of_life_date,
recommended=recommendation, disallowed=Disallowed(disk_types=disallowed_disk_types),
purchase_plan=purchase_plan, location=location, eula=eula, tags=(tags or {}),
hyper_vgeneration=hyper_v_generation)
hyper_vgeneration=hyper_v_generation, features=feature_list)
return client.gallery_images.create_or_update(resource_group_name, gallery_name, gallery_image_name, image)


Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,12 @@ def test_vm_disk_max_shares_etc(self, resource_group):
])

self.cmd('sig create -g {rg} --gallery-name {g1}')
self.cmd('sig image-definition create -g {rg} --gallery-name {g1} --gallery-image-definition image --os-type linux -p publisher1 -f offer1 -s sku1')
self.cmd('sig image-definition create -g {rg} --gallery-name {g1} --gallery-image-definition image --os-type linux -p publisher1 -f offer1 -s sku1 --features "IsSecureBootSupported=true IsMeasuredBootSupported=false" --hyper-v-generation V2', checks=[
self.check('features[0].name', 'IsSecureBootSupported'),
self.check('features[0].value', 'true'),
self.check('features[1].name', 'IsMeasuredBootSupported'),
self.check('features[1].value', 'false'),
])
self.cmd('disk create -g {rg} -n disk --size-gb 10')
self.cmd('snapshot create -g {rg} -n s1 --source disk')
gallery_image = self.cmd('sig image-version create -g {rg} --gallery-name {g1} --gallery-image-definition image --gallery-image-version 1.0.0 --os-snapshot s1').get_output_in_json()['id']
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ azure-mgmt-billing==0.2.0
azure-mgmt-botservice==0.2.0
azure-mgmt-cdn==5.0.0
azure-mgmt-cognitiveservices==6.3.0
azure-mgmt-compute==13.1.1
azure-mgmt-compute==14.0.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==3.0.0rc15
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ azure-mgmt-billing==0.2.0
azure-mgmt-botservice==0.2.0
azure-mgmt-cdn==5.0.0
azure-mgmt-cognitiveservices==6.3.0
azure-mgmt-compute==13.1.1
azure-mgmt-compute==14.0.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==3.0.0rc15
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ azure-mgmt-billing==0.2.0
azure-mgmt-botservice==0.2.0
azure-mgmt-cdn==5.0.0
azure-mgmt-cognitiveservices==6.3.0
azure-mgmt-compute==13.1.1
azure-mgmt-compute==14.0.0
azure-mgmt-consumption==2.0.0
azure-mgmt-containerinstance==1.5.0
azure-mgmt-containerregistry==3.0.0rc15
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
'azure-mgmt-botservice~=0.2.0',
'azure-mgmt-cdn==5.0.0',
'azure-mgmt-cognitiveservices~=6.3.0',
'azure-mgmt-compute~=13.0',
'azure-mgmt-compute~=14.0',
'azure-mgmt-consumption~=2.0',
'azure-mgmt-containerinstance~=1.4',
'azure-mgmt-containerregistry==3.0.0rc15',
Expand Down