-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update task handling of hypervisor cluster create
Update the polling of a hypervisor cluster create task. In the case of hypervisor create, the `sourceResourceUri` field in the final task response points to a `system` and not the hypervisor cluster that has just been created. (This differs from the task behaviour for datastores.) Switch to instead extract the hypervisor cluster uuid from the returned task body's `associatedResources` list. (Note that the `associatedResources` list for datastores is empty, so we cannot consistently use this approach.) ``` "associatedResources": [ { "name": "cluster1", "resourceUri": "/virtualization/v1beta1/hypervisor-clusters/298a299e-78f5-5acb-86ce-4e9fdc290ab7", "type": "hypervisor-cluster" } ] ``` This change avoids terraform erroring after a successful hypervisor create.
- Loading branch information
1 parent
0ccc6fa
commit f203f27
Showing
4 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
internal/simulator/fixtures/hypervisorclusters/create/asyncfake.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"associatedResources":[],"createdAt":"2024-07-12T13:29:49.396923456Z","customerId":"aeb7487a336f11ec9ad0c2951b4ee305","displayName":"Deleting the virtual machine 'mclaren18'","endedAt":"2024-07-12T13:29:50.440016018Z","error":null,"estimatedRunningDurationMinutes":300,"generation":3,"groups":[{"id":"aeb7487a336f11ec9ad0c2951b4ee305","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"99992745-532b-404c-860c-20a6571b92c3","logMessages":[{"message":"delete task is created","timestamp":"2024-07-12T13:29:49.396929492Z"},{"message":"delete task is running","timestamp":"2024-07-12T13:29:49.396930707Z"},{"message":"attempting to delete the virtual machine","timestamp":"2024-07-12T13:29:49.566952371Z"},{"message":"delete task completed","timestamp":"2024-07-12T13:29:50.440017383Z"}],"name":"delete","parent":null,"progressPercent":100,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/99992745-532b-404c-860c-20a6571b92c3","rootOperation":{"id":"99992745-532b-404c-860c-20a6571b92c3","name":"","resourceUri":"/data-services/v1beta1/async-operations/99992745-532b-404c-860c-20a6571b92c3","type":"task"},"services":["private-cloud-business-edition","backup-and-recovery"],"sourceResourceUri":"/virtualization/v1beta1/hypervisor-clusters/298a299e-78f5-5acb-86ce-4e9fdc290ab7","startedAt":"2024-07-12T13:29:49.396925772Z","state":"SUCCEEDED","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-12T13:29:50.456819656Z","userId":"[email protected]"} | ||
{"associatedResources":[{"name":"mclaren01","resourceUri":"/virtualization/v1beta1/hypervisor-clusters/298a299e-78f5-5acb-86ce-4e9fdc290ab7","type" :"hypervisor-cluster"}],"createdAt":"2024-07-12T13:29:49.396923456Z","customerId":"aeb7487a336f11ec9ad0c2951b4ee305","displayName":"Deleting the virtual machine 'mclaren18'","endedAt":"2024-07-12T13:29:50.440016018Z","error":null,"estimatedRunningDurationMinutes":300,"generation":3,"groups":[{"id":"aeb7487a336f11ec9ad0c2951b4ee305","name":"Default Group"}],"hasChildOperations":false,"healthStatus":"OK","id":"99992745-532b-404c-860c-20a6571b92c3","logMessages":[{"message":"delete task is created","timestamp":"2024-07-12T13:29:49.396929492Z"},{"message":"delete task is running","timestamp":"2024-07-12T13:29:49.396930707Z"},{"message":"attempting to delete the virtual machine","timestamp":"2024-07-12T13:29:49.566952371Z"},{"message":"delete task completed","timestamp":"2024-07-12T13:29:50.440017383Z"}],"name":"delete","parent":null,"progressPercent":100,"recommendations":[],"resourceUri":"/data-services/v1beta1/async-operations/99992745-532b-404c-860c-20a6571b92c3","rootOperation":{"id":"99992745-532b-404c-860c-20a6571b92c3","name":"","resourceUri":"/data-services/v1beta1/async-operations/99992745-532b-404c-860c-20a6571b92c3","type":"task"},"services":["private-cloud-business-edition","backup-and-recovery"],"sourceResourceUri":"/private-cloud-business/v1beta1/systems/126fd201-9e6e-5e31-9ffb-a766265b1fd3","startedAt":"2024-07-12T13:29:49.396925772Z","state":"SUCCEEDED","subtreeOperationCount":0,"suggestedPollingIntervalSeconds":30,"type":"task","updatedAt":"2024-07-12T13:29:50.456819656Z","userId":"[email protected]"} |