1.10. 使用 JSON 进行复杂参数
JSON 是描述复杂参数的首选方法。
JSON 格式的内容示例如下所示:
# hammer compute-profile values create --compute-profile-id 22 --compute-resource-id 1 --compute-attributes= '{ "cpus": 2, "corespersocket": 2, "memory_mb": 4096, "firmware": "efi", "resource_pool": "Resources", "cluster": "Example_Cluster", "guest_id": "rhel8", "path": "/Datacenters/EXAMPLE/vm/", "hardware_version": "Default", "memoryHotAddEnabled": 0, "cpuHotAddEnabled": 0, "add_cdrom": 0, "boot_order": [ “disk", "network" ], "scsi_controllers":[ { "type": "ParaVirtualSCSIController", "key":1000 }, { "type": "ParaVirtualSCSIController", "key":1001 }it ] }'