- ("beparams", ht.EmptyDict, ht.TDict),
- ("disks", ht.NoDefault, ht.TListOf(ht.TDict)),
- ("disk_template", ht.NoDefault, _CheckDiskTemplate),
- ("file_driver", None, ht.TOr(ht.TNone, ht.TElemOf(constants.FILE_DRIVER))),
- ("file_storage_dir", None, ht.TMaybeString),
- ("force_variant", False, ht.TBool),
- ("hvparams", ht.EmptyDict, ht.TDict),
- ("hypervisor", None, ht.TMaybeString),
- ("iallocator", None, ht.TMaybeString),
- ("identify_defaults", False, ht.TBool),
- ("ip_check", True, ht.TBool),
- ("mode", ht.NoDefault, ht.TElemOf(constants.INSTANCE_CREATE_MODES)),
- ("name_check", True, ht.TBool),
- ("nics", ht.NoDefault, ht.TListOf(ht.TDict)),
- ("no_install", None, ht.TMaybeBool),
- ("osparams", ht.EmptyDict, ht.TDict),
- ("os_type", None, ht.TMaybeString),
- ("pnode", None, ht.TMaybeString),
- ("snode", None, ht.TMaybeString),
- ("source_handshake", None, ht.TOr(ht.TList, ht.TNone)),
- ("source_instance_name", None, ht.TMaybeString),
+ _PForceVariant,
+ _PWaitForSync,
+ _PNameCheck,
+ ("beparams", ht.EmptyDict, ht.TDict, "Backend parameters for instance"),
+ ("disks", ht.NoDefault,
+ # TODO: Generate check from constants.IDISK_PARAMS_TYPES
+ ht.TListOf(ht.TDictOf(ht.TElemOf(constants.IDISK_PARAMS),
+ ht.TOr(ht.TNonEmptyString, ht.TInt))),
+ "Disk descriptions, for example ``[{\"%s\": 100}, {\"%s\": 5}]``;"
+ " each disk definition must contain a ``%s`` value and"
+ " can contain an optional ``%s`` value denoting the disk access mode"
+ " (%s)" %
+ (constants.IDISK_SIZE, constants.IDISK_SIZE, constants.IDISK_SIZE,
+ constants.IDISK_MODE,
+ " or ".join("``%s``" % i for i in sorted(constants.DISK_ACCESS_SET)))),
+ ("disk_template", ht.NoDefault, _BuildDiskTemplateCheck(True),
+ "Disk template"),
+ ("file_driver", None, ht.TOr(ht.TNone, ht.TElemOf(constants.FILE_DRIVER)),
+ "Driver for file-backed disks"),
+ ("file_storage_dir", None, ht.TMaybeString,
+ "Directory for storing file-backed disks"),
+ ("hvparams", ht.EmptyDict, ht.TDict,
+ "Hypervisor parameters for instance, hypervisor-dependent"),
+ ("hypervisor", None, ht.TMaybeString, "Hypervisor"),
+ ("iallocator", None, ht.TMaybeString,
+ "Iallocator for deciding which node(s) to use"),
+ ("identify_defaults", False, ht.TBool,
+ "Reset instance parameters to default if equal"),
+ ("ip_check", True, ht.TBool, _PIpCheckDoc),
+ ("mode", ht.NoDefault, ht.TElemOf(constants.INSTANCE_CREATE_MODES),
+ "Instance creation mode"),
+ ("nics", ht.NoDefault, ht.TListOf(_TestNicDef),
+ "List of NIC (network interface) definitions, for example"
+ " ``[{}, {}, {\"%s\": \"198.51.100.4\"}]``; each NIC definition can"
+ " contain the optional values %s" %
+ (constants.INIC_IP,
+ ", ".join("``%s``" % i for i in sorted(constants.INIC_PARAMS)))),
+ ("no_install", None, ht.TMaybeBool,
+ "Do not install the OS (will disable automatic start)"),
+ ("osparams", ht.EmptyDict, ht.TDict, "OS parameters for instance"),
+ ("os_type", None, ht.TMaybeString, "Operating system"),
+ ("pnode", None, ht.TMaybeString, "Primary node"),
+ ("snode", None, ht.TMaybeString, "Secondary node"),
+ ("source_handshake", None, ht.TOr(ht.TList, ht.TNone),
+ "Signed handshake from source (remote import only)"),
+ ("source_instance_name", None, ht.TMaybeString,
+ "Source instance name (remote import only)"),