Softlayer - 使用此方法需要模板访客记录
Softlayer- A template guest record is required to use this method
我正在使用邮递员 REST 客户端执行 softlayer REST API's
。当前正在尝试创建 vm
的快照
我遇到错误,
"A template guest record is required to use this method"
执行以下 rest 调用时:
https://[username]:[api-key]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_guest_id]/
使用以下文件在表单数据中
createArchiveTransaction.json
:
{
"parameters":[
"my-new-standard-image-name ",
[
{
"id": 6862924,
"complexType": "SoftLayer_Virtual_Guest_Block_Device"
}
],
"api note"
]
}
谁能帮我解决这个问题?
按照以下步骤从虚拟来宾创建映像。
1 从虚拟客户机获取块设备
以下休息请求将对此有所帮助:
https://[username]:[api-key]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/22334455/getBlockDevices?objectMask=mask[diskImage[name, description]]
Method: Get
将 22334455 替换为您的 VSI id。
你会得到这样的结果:
[
{
"bootableFlag": 1,
"createDate": "2015-09-21T15:20:27-03:00",
"device": "0",
"diskImageId": 10629873,
"guestId": 22334455,
"hotPlugFlag": 0,
"id": 11223344,
"modifyDate": "2015-10-19T13:25:53-03:00",
"mountMode": "RW",
"mountType": "Disk",
"statusId": 1,
"uuid": "c1d1d92a-42ee-cdef-47sdfsf3543456e1e17",
"diskImage": {
"description": "test.softlayer.com",
"name": "test.softlayer.com"
}
},
{
"bootableFlag": 0,
"createDate": "2015-10-19T13:24:58-03:00",
"device": "1",
"diskImageId": 11277111,
"guestId": 22334455,
"hotPlugFlag": 0,
"id": 111122233,
"modifyDate": null,
"mountMode": "RW",
"mountType": "Disk",
"statusId": 1,
"uuid": "38987d23-8395-aasdfsdf23434a602",
"diskImage": {
"description": "22334455-SWAP",
"name": "22334455-SWAP"
}
},
{
"bootableFlag": 1,
"createDate": "2015-09-21T15:20:42-03:00",
"device": "3",
"diskImageId": null,
"guestId": 22334455,
"hotPlugFlag": 1,
"id": 33445566,
"modifyDate": "2015-10-19T13:31:35-03:00",
"mountMode": "RO",
"mountType": "CD",
"statusId": 1,
"uuid": "4b3e59af-ed6a-3c96-sfsdf234a4aa708ff"
}
]
2 创建图像模板
确保不包括交换分区和 CD 挂载。
https://[username]:[api-key]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/22334455/createArchiveTransaction
Method: Post
{
"parameters":[
"testGroupNameRcv",
[
{
"id":11223344
}
],
"Note for test"
]
}
将 11223344 和 22334455 替换为您的虚拟访客及其块设备的标识符
参考文献:
我正在使用邮递员 REST 客户端执行 softlayer REST API's
。当前正在尝试创建 vm
我遇到错误,
"A template guest record is required to use this method"
执行以下 rest 调用时:
https://[username]:[api-key]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[virtual_guest_id]/
使用以下文件在表单数据中
createArchiveTransaction.json
:
{
"parameters":[
"my-new-standard-image-name ",
[
{
"id": 6862924,
"complexType": "SoftLayer_Virtual_Guest_Block_Device"
}
],
"api note"
]
}
谁能帮我解决这个问题?
按照以下步骤从虚拟来宾创建映像。
1 从虚拟客户机获取块设备
以下休息请求将对此有所帮助:
https://[username]:[api-key]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/22334455/getBlockDevices?objectMask=mask[diskImage[name, description]]
Method: Get
将 22334455 替换为您的 VSI id。
你会得到这样的结果:
[
{
"bootableFlag": 1,
"createDate": "2015-09-21T15:20:27-03:00",
"device": "0",
"diskImageId": 10629873,
"guestId": 22334455,
"hotPlugFlag": 0,
"id": 11223344,
"modifyDate": "2015-10-19T13:25:53-03:00",
"mountMode": "RW",
"mountType": "Disk",
"statusId": 1,
"uuid": "c1d1d92a-42ee-cdef-47sdfsf3543456e1e17",
"diskImage": {
"description": "test.softlayer.com",
"name": "test.softlayer.com"
}
},
{
"bootableFlag": 0,
"createDate": "2015-10-19T13:24:58-03:00",
"device": "1",
"diskImageId": 11277111,
"guestId": 22334455,
"hotPlugFlag": 0,
"id": 111122233,
"modifyDate": null,
"mountMode": "RW",
"mountType": "Disk",
"statusId": 1,
"uuid": "38987d23-8395-aasdfsdf23434a602",
"diskImage": {
"description": "22334455-SWAP",
"name": "22334455-SWAP"
}
},
{
"bootableFlag": 1,
"createDate": "2015-09-21T15:20:42-03:00",
"device": "3",
"diskImageId": null,
"guestId": 22334455,
"hotPlugFlag": 1,
"id": 33445566,
"modifyDate": "2015-10-19T13:31:35-03:00",
"mountMode": "RO",
"mountType": "CD",
"statusId": 1,
"uuid": "4b3e59af-ed6a-3c96-sfsdf234a4aa708ff"
}
]
2 创建图像模板
确保不包括交换分区和 CD 挂载。
https://[username]:[api-key]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/22334455/createArchiveTransaction
Method: Post
{
"parameters":[
"testGroupNameRcv",
[
{
"id":11223344
}
],
"Note for test"
]
}
将 11223344 和 22334455 替换为您的虚拟访客及其块设备的标识符
参考文献: