Skip to content

Commit

Permalink
Restore options lost with PR #492 (#506)
Browse files Browse the repository at this point in the history
* Restore options lost with PR #492

As a result partition create is currently broken.

Signed-off-by: Simon Spinner <[email protected]>

* Remove debug statement

Signed-off-by: Simon Spinner <[email protected]>

* Fix pylint errors.

Signed-off-by: Simon Spinner <[email protected]>

* Restore additional options.

Signed-off-by: Simon Spinner <[email protected]>

* Add missing properties identified by Andreas

Signed-off-by: Simon Spinner <[email protected]>

---------

Signed-off-by: Simon Spinner <[email protected]>
  • Loading branch information
simon-spinner authored Nov 3, 2023
1 parent 4703564 commit 36b9f60
Showing 1 changed file with 174 additions and 6 deletions.
180 changes: 174 additions & 6 deletions zhmccli/_cmd_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,22 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
format(pd=DEFAULT_PARTITION_TYPE))
@optgroup.option('--description', type=str, required=False,
help='The description of the new partition.')
@optgroup.option('--short-name', type=str, required=False,
help='The short name (LPAR name) of the new partition.')
@optgroup.option('--partition-id', type=str, required=False,
help='The new partition ID (internal slot) of the partition. '
'Must be a non-conflicting hex number in the range 0 - 7F, '
'or "auto" for auto-generating it. Updating requires '
'partition to be stopped.')
@optgroup.option('--acceptable-status', type=str, required=False,
help='The set of acceptable operational status values, as a '
'comma-separated list. The empty string specifies an empty '
'list.')
@optgroup.option('--reserve-resources', type=bool, required=False,
help='Enables resource reservation, which causes all physical '
'resources backing the virtual resources configured for this '
'partition to be allocated and reserved, even when the '
'partition is in "stopped" state. Default: False')
@optgroup.group('CPU configuration')
@optgroup.option('--cp-processors', type=int, required=False,
help='The number of general purpose (CP) processors. '
Expand All @@ -278,6 +290,9 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
required=False, default=DEFAULT_PROCESSOR_MODE,
help='The sharing mode for processors. '
'Default: {d}'.format(d=DEFAULT_PROCESSOR_MODE))
@optgroup.option('--processor-management-enabled', type=bool, required=False,
help='Indicates whether the processor management is enabled. '
'Default: false')
@optgroup.option('--initial-cp-processing-weight',
type=click.IntRange(MIN_PROCESSING_WEIGHT,
MAX_PROCESSING_WEIGHT),
Expand Down Expand Up @@ -319,6 +334,26 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
help='Represents the maximum amount of general purpose '
'processor resources allocated to the partition. '
'Default: {d}'.format(d=MAX_PROCESSING_WEIGHT))
@optgroup.option('--cp-absolute-capping', type=float, required=False,
help='Absolute CP processor capping. A numeric value prevents '
'the partition from using any more than the specified number '
'of physical processors. An empty string disables absolute '
'CP capping.')
@optgroup.option('--ifl-absolute-capping', type=float, required=False,
help='Absolute IFL processor capping. A numeric value prevents'
' the partition from using any more than the specified number '
'of physical processors. An empty string disables absolute '
'IFL capping.')
@optgroup.option('--cp-processing-weight-capped', type=bool, required=False,
help='Indicates whether the CP processor weight is capped. '
'If True, the processing weight is an upper limit. If False, '
'the processing weight is a target that can be exceeded if '
'excess CP processor resources are available.')
@optgroup.option('--ifl-processing-weight-capped', type=bool, required=False,
help='Indicates whether the IFL processor weight is capped. '
'If True, the processing weight is an upper limit. If False, '
'the processing weight is a target that can be exceeded if '
'excess IFL processor resources are available.')
@optgroup.group('Memory configuration')
@optgroup.option('--initial-memory', type=int, required=False,
default=DEFAULT_INITIAL_MEMORY_MB,
Expand All @@ -332,6 +367,11 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
'partition is running. '
'Default: {d} MiB'.format(d=DEFAULT_MAXIMUM_MEMORY_MB))
@optgroup.group('Boot configuration')
@optgroup.option('--boot-timeout', required=False, metavar='INTEGER',
type=click.IntRange(MIN_BOOT_TIMEOUT, MAX_BOOT_TIMEOUT),
help='The time in seconds that is waited before an ongoing '
'boot is aborted. This is applicable for all boot sources. '
'Default: 60')
@optgroup.option('--boot-ftp-host', type=str, required=False,
help='Boot from an FTP server: The hostname or IP address of '
'the FTP server.')
Expand All @@ -347,6 +387,10 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
@optgroup.option('--boot-media-file', type=str, required=False,
help='Boot from removable media on the HMC: The path to the '
'image file on the HMC.')
@optgroup.option('--boot-media-type', type=click.Choice(['usb', 'cdrom']),
required=False,
help='Boot from removable media on the HMC: The type of media.'
' Must be specified if --boot-media-file is specified.')
@optgroup.group('Special permission configuration')
@optgroup.option('--access-global-performance-data', type=bool, required=False,
help='Indicates if global performance data authorization '
Expand All @@ -368,15 +412,21 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
@optgroup.option('--access-extended-counter-set', type=bool, required=False,
help='Indicates if extended counter set authorization control '
'is requested. Default: False')
@optgroup.option('--access-coprocessor-group-set', type=bool, required=False,
help='Indicates if coprocessor group set authorization '
'control is requested. Default: False')
@optgroup.option('--access-basic-sampling', type=bool, required=False,
help='Indicates if basic CPU sampling authorization control '
'is requested. Default: False')
@optgroup.option('--access-diagnostic-sampling', type=bool, required=False,
help='Indicates if diagnostic sampling authorization control '
'is requested. Default: False')
@optgroup.option('--permit-des-key-import-functions', type=bool, required=False,
help='Enables the importing of DES keys for the partition. '
'Default: True')
@optgroup.option('--permit-aes-key-import-functions', type=bool, required=False,
help='Enables the importing of AES keys for the partition. '
'Default: True')
@optgroup.option('--permit-ecc-key-import-functions', type=bool, required=False,
help='Enables the importing of ECC keys for the partition. '
'Default: True')
@optgroup.group('SSC configuration (only applicable to SSC partitions)')
@optgroup.option('--ssc-host-name', type=str, required=False,
help='Secure Service Container host name. '
Expand All @@ -385,6 +435,10 @@ def partition_dump(cmd_ctx, cpc, partition, **options):
help='Default IPv4 Gateway to be used. '
'Empty string sets no IPv4 Gateway. '
'Default: No IPv4 Gateway')
@optgroup.option('--ssc-ipv6-gateway', type=str, required=False,
help='Default IPv6 Gateway to be used. '
'Empty string sets no IPv6 Gateway. '
'Only applicable to ssc type partitions.')
@optgroup.option('--ssc-dns-servers', type=str, required=False,
help='DNS IP addresses (comma-separated). '
'Empty string sets no DNS IP addresses. '
Expand Down Expand Up @@ -415,10 +469,22 @@ def partition_create(cmd_ctx, cpc, **options):
help='The new name of the partition.')
@optgroup.option('--description', type=str, required=False,
help='The new description of the partition.')
@optgroup.option('--short-name', type=str, required=False,
help='The new short name (LPAR name) of the partition.')
@optgroup.option('--partition-id', type=str, required=False,
help='The new partition ID (internal slot) of the partition. '
'Must be a non-conflicting hex number in the range 0 - 7F, '
'or "auto" for auto-generating it. Updating requires '
'partition to be stopped.')
@optgroup.option('--acceptable-status', type=str, required=False,
help='The new set of acceptable operational status values, '
'as a comma-separated list. The empty string specifies an '
'empty list.')
@optgroup.option('--reserve-resources', type=bool, required=False,
help='Enables resource reservation, which causes all physical '
'resources backing the virtual resources configured for this '
'partition to be allocated and reserved, even when the '
'partition is in "stopped" state. Default: False')
@optgroup.group('CPU configuration')
@optgroup.option('--cp-processors', type=int, required=False,
help='The new number of general purpose (CP) processors.')
Expand All @@ -427,6 +493,8 @@ def partition_create(cmd_ctx, cpc, **options):
@optgroup.option('--processor-mode', type=click.Choice(['dedicated', 'shared']),
required=False,
help='The new sharing mode for processors.')
@optgroup.option('--processor-management-enabled', type=bool, required=False,
help='Indicates whether the processor management is enabled.')
@optgroup.option('--initial-cp-processing-weight',
type=click.IntRange(MIN_PROCESSING_WEIGHT,
MAX_PROCESSING_WEIGHT), required=False,
Expand Down Expand Up @@ -456,6 +524,26 @@ def partition_create(cmd_ctx, cpc, **options):
MAX_PROCESSING_WEIGHT), required=False,
help='Represents the maximum amount of general purpose '
'processor resources allocated to the partition.')
@optgroup.option('--cp-absolute-capping', type=float, required=False,
help='Absolute CP processor capping. A numeric value prevents '
'the partition from using any more than the specified number '
'of physical processors. An empty string disables absolute '
'CP capping.')
@optgroup.option('--ifl-absolute-capping', type=float, required=False,
help='Absolute IFL processor capping. A numeric value '
'prevents the partition from using any more than the '
'specified number of physical processors. An empty string '
'disables absolute IFL capping.')
@optgroup.option('--cp-processing-weight-capped', type=bool, required=False,
help='Indicates whether the CP processor weight is capped. '
'If True, the processing weight is an upper limit. If False, '
'the processing weight is a target that can be exceeded if '
'excess CP processor resources are available.')
@optgroup.option('--ifl-processing-weight-capped', type=bool, required=False,
help='Indicates whether the IFL processor weight is capped. '
'If True, the processing weight is an upper limit. If False, '
'the processing weight is a target that can be exceeded if '
'excess IFL processor resources are available.')
@optgroup.group('Memory configuration')
@optgroup.option('--initial-memory', type=int, required=False,
help='The new initial amount of memory (in MiB) when the '
Expand Down Expand Up @@ -508,10 +596,83 @@ def partition_create(cmd_ctx, cpc, **options):
@optgroup.option('--boot-media-file', type=str, required=False,
help='Boot from removable media on the HMC: The path to the '
'image file on the HMC.')
@optgroup.option('--boot-media-type', type=click.Choice(['usb', 'cdrom']),
required=False,
help='Boot from removable media on the HMC: The type of '
'media. Must be specified if --boot-media-file is specified.')
@optgroup.option('--boot-iso', is_flag=True, required=False,
help='Boot from an ISO image mounted to this partition. '
'The ISO image can be mounted using "zhmc partition '
'mountiso".')
@optgroup.option('--boot-iso-insfile', type=str, required=False,
help='Boot from an ISO image: The path to the INS-file in the '
'boot image.')
@optgroup.option('--boot-timeout', required=False, metavar='INTEGER',
type=click.IntRange(MIN_BOOT_TIMEOUT, MAX_BOOT_TIMEOUT),
help='The time in seconds that is waited before an ongoing '
'boot is aborted. This is applicable for all boot sources.')
@optgroup.option('--boot-ficon-loader-mode', required=False,
type=click.Choice(['ccw', 'list']),
help='The boot loader mode when booting from a FICON volume. '
'Must be "ccw" if secure-boot is false. If not specified, it '
'to is automatically set to "ccw" if secure-boot is false, '
'and "list" if secure-boot is true. If set to "list", the '
'FICON volume must have the correct format to work in '
'"list-directed" mode.')
@optgroup.option('--boot-record-location', type=str, required=False,
help='Location of the boot record on the FICON volume when '
'booting from a FICON volume, in the format '
'"cylinder.head.record" (each as a hex number). The empty '
'string will set the corresponding property to null, causing '
'the boot record location to be derived from the volume '
'label. After creation of the partition, the corresponding '
'property is null.')
@optgroup.option('--boot-record-lba', type=str, required=False,
help='Logical block number (as a hex number) of the anchor '
'point for locating the operating system when booting from '
'a SCSI volume. The way in which this parameter is used to '
'locate the operating system depends on the operating system '
'and its boot process. For Linux on IBM Z, for example, this '
'parameter specifies the block number of the master boot '
'record. After creation of the partition, the corresponding '
'property is 0.')
@optgroup.option('--boot-load-parameters', type=str, required=False,
help='Parameters that are passed unmodified to the operating '
'system boot process. The way in which these parameters are '
'used depends on the operating system, but in general, these '
'parameters are intended to be used to select an entry in '
'the boot menu or the boot loader. The length is restricted '
'to 8 characters, and valid characters are: 0-9, A-Z, @, $, '
'#, blank ( ), and period (.).'
'After creation of the partition, the corresponding property '
'is the empty string.')
@optgroup.option('--boot-os-specific-parameters', type=str, required=False,
help='Parameters that are passed unmodified to the operating '
'system boot process. The way in which these parameters are '
'used depends on the operating system, but in general, these '
'parameters are intended to specify boot-time configuration '
'settings. For Linux on IBM Z, for example, these parameters '
'specify kernel parameters. '
'After creation of the partition, the corresponding property '
'is the empty string.')
# TODO: boot-configuration, boot-configuration-selector
@optgroup.option('--boot-configuration', type=str, required=False,
help='Selects the boot configuration to use from among '
'multiple such boot configurations that have been defined '
'by the operating system to be loaded. Whether and how this '
'parameter is used to determine boot parameters depends on '
'the operating system and its boot process. For Linux on '
'IBM Z, for example, this parameter selects which of the '
'operating system\'s pre-configured boot configurations is to '
'be used, with the selected boot configuration in turn '
'specifying parameters such as the kernel to be loaded, the '
'kernel parameters to be used, or which disk is used as part '
'of the boot process. Must be a decimal number from 0 to 30, '
'or the string "auto". Using "auto" causes the boot loader '
'to automatically search for a boot configuration and to use '
'the first valid boot configuration defined in the operating '
'system. After creation of the partition, the corresponding '
'properties indicate to select boot configuration 0.')
@optgroup.option('--secure-boot', type=bool, required=False,
help='Check the software signature of what is booted against '
'what the distributor signed it with. '
Expand Down Expand Up @@ -543,15 +704,18 @@ def partition_create(cmd_ctx, cpc, **options):
@optgroup.option('--access-extended-counter-set', type=bool, required=False,
help='Indicates if extended counter set authorization control '
'is requested. Default: False')
@optgroup.option('--access-coprocessor-group-set', type=bool, required=False,
help='Indicates if coprocessor group set authorization '
'control is requested. Default: False')
@optgroup.option('--access-basic-sampling', type=bool, required=False,
help='Indicates if basic CPU sampling authorization control '
'is requested. Default: False')
@optgroup.option('--access-diagnostic-sampling', type=bool, required=False,
help='Indicates if diagnostic sampling authorization control '
'is requested. Default: False')
@optgroup.option('--permit-des-key-import-functions', type=bool, required=False,
help='Enables the importing of DES keys for the partition.')
@optgroup.option('--permit-aes-key-import-functions', type=bool, required=False,
help='Enables the importing of AES keys for the partition.')
@optgroup.option('--permit-ecc-key-import-functions', type=bool, required=False,
help='Enables the importing of ECC keys for the partition.')
@optgroup.group('SSC configuration (only applicable to SSC partitions)')
@optgroup.option('--ssc-host-name', type=str, required=False,
help='Secure Service Container host name.')
Expand All @@ -563,6 +727,10 @@ def partition_create(cmd_ctx, cpc, **options):
@optgroup.option('--ssc-ipv4-gateway', type=str, required=False,
help='Default IPv4 Gateway to be used. '
'Empty string sets no IPv4 Gateway.')
@optgroup.option('--ssc-ipv6-gateway', type=str, required=False,
help='Default IPv6 Gateway to be used. '
'Empty string sets no IPv6 Gateway. '
'Only applicable to ssc type partitions.')
@optgroup.option('--ssc-dns-servers', type=str, required=False,
help='DNS IP addresses (comma-separated). '
'Empty string sets no DNS IP addresses.')
Expand Down

0 comments on commit 36b9f60

Please sign in to comment.