This commit is contained in:
Fred Park 2018-02-28 08:38:57 -08:00
Родитель 8664c6cfa6
Коммит e79baee8f9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 3C4D545F457737EB
5 изменённых файлов: 41 добавлений и 3 удалений

Просмотреть файл

@ -7,10 +7,12 @@ pool_specification:
sku: 16.04-LTS
version: latest
native: false
license_type: null
custom_image:
arm_image_id: /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Compute/images/<image_name>
node_agent: <node agent sku id>
native: false
license_type: null
vm_size: STANDARD_D2_V2
vm_count:
dedicated: 4

Просмотреть файл

@ -1061,6 +1061,7 @@ def _construct_pool_object(
vm_configuration.arm_image_id,
),
node_agent_sku_id=pool_settings.vm_configuration.node_agent,
license_type=pool_settings.vm_configuration.license_type,
)
logger.debug(
('deploying custom image to pool in native mode: {} '
@ -1073,6 +1074,7 @@ def _construct_pool_object(
vmconfig = batchmodels.VirtualMachineConfiguration(
image_reference=image_ref,
node_agent_sku_id=na_ref,
license_type=pool_settings.vm_configuration.license_type,
)
logger.debug('deploying pool in native mode')
# attach container config
@ -1127,6 +1129,7 @@ def _construct_pool_object(
vm_configuration.arm_image_id,
),
node_agent_sku_id=pool_settings.vm_configuration.node_agent,
license_type=pool_settings.vm_configuration.license_type,
)
logger.debug('deploying custom image: {} node agent: {}'.format(
vmconfig.image_reference.virtual_machine_image_id,
@ -1157,6 +1160,7 @@ def _construct_pool_object(
vmconfig = batchmodels.VirtualMachineConfiguration(
image_reference=image_ref,
node_agent_sku_id=na_ref,
license_type=pool_settings.vm_configuration.license_type,
)
# create start task commandline
start_task.append(

Просмотреть файл

@ -130,6 +130,7 @@ PoolVmPlatformImageSettings = collections.namedtuple(
'sku',
'version',
'native',
'license_type',
]
)
PoolVmCustomImageSettings = collections.namedtuple(
@ -137,6 +138,7 @@ PoolVmCustomImageSettings = collections.namedtuple(
'arm_image_id',
'node_agent',
'native',
'license_type',
]
)
PoolAutoscaleScenarioSettings = collections.namedtuple(
@ -767,6 +769,7 @@ def _populate_pool_vm_configuration(config):
sku=sku,
version=_kv_read_checked(conf, 'version', default='latest'),
native=True,
license_type=_kv_read_checked(conf, 'license_type'),
)
else:
vm_config = PoolVmPlatformImageSettings(
@ -775,6 +778,7 @@ def _populate_pool_vm_configuration(config):
sku=sku,
version=_kv_read_checked(conf, 'version', default='latest'),
native=False,
license_type=None,
)
# TODO re-enable this when platform support is available
# auto convert vm config to native if specified
@ -788,6 +792,7 @@ def _populate_pool_vm_configuration(config):
sku='16-04-lts',
version='latest',
native=True,
license_type=None,
)
elif (vm_config.publisher == 'openlogic' and
vm_config.offer == 'centos' and
@ -798,6 +803,7 @@ def _populate_pool_vm_configuration(config):
sku='7-3',
version='latest',
native=True,
license_type=None,
)
elif (vm_config.publisher == 'openlogic' and
vm_config.offer == 'centos-hpc' and
@ -808,6 +814,7 @@ def _populate_pool_vm_configuration(config):
sku='7-3',
version='latest',
native=True,
license_type=None,
)
return vm_config
else:
@ -815,12 +822,15 @@ def _populate_pool_vm_configuration(config):
node_agent = conf['node_agent'].lower()
if node_agent == 'batch.node.windows amd64':
native = True
license_type = _kv_read_checked(conf, 'license_type')
else:
native = _kv_read(conf, 'native', default=False)
license_type = None
return PoolVmCustomImageSettings(
arm_image_id=_kv_read_checked(conf, 'arm_image_id'),
node_agent=node_agent,
native=native,
license_type=license_type,
)

Просмотреть файл

@ -15,10 +15,12 @@ pool_specification:
sku: 16.04-LTS
version: latest
native: false
license_type: null
custom_image:
arm_image_id: /subscriptions/<subscription_id>/resourceGroups/<resource_group>/providers/Microsoft.Compute/images/<image_name>
node_agent: <node agent sku id>
native: false
license_type: null
vm_size: STANDARD_D2_V2
vm_count:
dedicated: 4
@ -123,9 +125,16 @@ specify both. If using a custom image, please see the
in this mode such as task-level data ingress or task-level data
egress that is not bound for Azure Storage Blobs. If there is
no `native` conversion equivalent for the specified `publisher`,
`offer`, `sku` then no conversion is performed. Note that `native`
mode is not compatible with Singularity conatiners. The default is
`false`.
`offer`, `sku` then no conversion is performed and this option will
be force disabled. Note that `native` mode is not compatible with
Singularity conatiners. The default is `false`.
* (optional) `license_type` specifies the type of on-premises license
to be used when deploying the operating system. This activates the
[Azure Hybrid Use Benefit](https://azure.microsoft.com/en-us/pricing/hybrid-benefit/)
for qualifying license holders. This only applies to Windows OS
types. You must comply with the terms set forth by this program;
please consult the [FAQ](https://azure.microsoft.com/en-us/pricing/hybrid-benefit/faq/)
for further information. The only valid value is `windows_server`.
* (required for custom image) `custom_image` defines the custom image to
use. AAD `batch` credentials are required to use custom iamges for both
Batch service and User Subscription modes.
@ -141,6 +150,13 @@ specify both. If using a custom image, please see the
features that are not available in this mode such as task-level data
ingress or task-level data egress that is not bound for Azure Storage
Blobs. The default is `false`.
* (optional) `license_type` specifies the type of on-premises license
to be used when deploying the operating system. This activates the
[Azure Hybrid Use Benefit](https://azure.microsoft.com/en-us/pricing/hybrid-benefit/)
for qualifying license holders. This only applies to Windows OS
types. You must comply with the terms set forth by this program;
please consult the [FAQ](https://azure.microsoft.com/en-us/pricing/hybrid-benefit/faq/)
for further information. The only valid value is `windows_server`.
* (required) `vm_size` is the
[Azure Virtual Machine Instance Size](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/).
Please note that not all regions have every VM size available.

Просмотреть файл

@ -29,6 +29,9 @@ mapping:
type: str
native:
type: bool
license_type:
type: str
enum: ['windows_server']
custom_image:
type: map
mapping:
@ -40,6 +43,9 @@ mapping:
required: true
native:
type: bool
license_type:
type: str
enum: ['windows_server']
vm_size:
type: str
required: true