Migrates a WorkSpace from one operating system or bundle type to another, while retaining the data on the user volume.
The migration process recreates the WorkSpace by using a new root volume from the target bundle image and the user volume from the last available snapshot of the original WorkSpace. During migration, the original D:\Users\%USERNAME% user profile folder is renamed to D:\Users\%USERNAME%MMddyyTHHmmss%.NotMigrated. A new D:\Users\%USERNAME%\ folder is generated by the new OS. Certain files in the old user profile are moved to the new user profile.
For available migration scenarios, details about what happens during migration, and best practices, see Migrate a WorkSpace.
If the source WorkSpace has nested virtualization enabled and the target bundle does not support nested virtualization, the migration fails.
Parameters:
-
source_workspace_id
(WorkspaceId)
–
The identifier of the WorkSpace to migrate from.
-
bundle_id
(BundleId)
–
The identifier of the target bundle type to migrate the WorkSpace to.
Raises:
Source code in docs_src/capo_workspaces/_services/async_work_spaces.py
| async def migrate_workspace(
self,
source_workspace_id: "capo_workspaces.types.workspace_id.WorkspaceId",
bundle_id: "capo_workspaces.types.bundle_id.BundleId",
*,
config_overrides: Optional[AsyncWorkSpacesClientConfig] = None,
) -> "capo_workspaces.types.migrate_workspace_result.MigrateWorkspaceResult":
r"""<p>Migrates a WorkSpace from one operating system or bundle type to another, while retaining the data on the user volume.</p> <p>The migration process recreates the WorkSpace by using a new root volume from the target bundle image and the user volume from the last available snapshot of the original WorkSpace. During migration, the original <code>D:\Users\%USERNAME%</code> user profile folder is renamed to <code>D:\Users\%USERNAME%MMddyyTHHmmss%.NotMigrated</code>. A new <code>D:\Users\%USERNAME%\</code> folder is generated by the new OS. Certain files in the old user profile are moved to the new user profile.</p> <p>For available migration scenarios, details about what happens during migration, and best practices, see <a href="https://docs.aws.amazon.com/workspaces/latest/adminguide/migrate-workspaces.html">Migrate a WorkSpace</a>.</p> <note> <p>If the source WorkSpace has nested virtualization enabled and the target bundle does not support nested virtualization, the migration fails.</p> </note>
Args:
source_workspace_id: <p>The identifier of the WorkSpace to migrate from.</p>
bundle_id: <p>The identifier of the target bundle type to migrate the WorkSpace to.</p>
Raises:
capo_workspaces.errors.access_denied_exception.AccessDeniedException: <p>The user is not authorized to access a resource.</p>
capo_workspaces.errors.invalid_parameter_values_exception.InvalidParameterValuesException: <p>One or more parameter values are not valid.</p>
capo_workspaces.errors.operation_in_progress_exception.OperationInProgressException: <p>The properties of this WorkSpace are currently being modified. Try again in a moment.</p>
capo_workspaces.errors.operation_not_supported_exception.OperationNotSupportedException: <p>This operation is not supported.</p>
capo_workspaces.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource could not be found.</p>
capo_workspaces.errors.resource_unavailable_exception.ResourceUnavailableException: <p>The specified resource is not available.</p>
capo_workspaces.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_workspaces.types.migrate_workspace_request.MigrateWorkspaceRequest]",
) -> AsyncOperationResponse[
"capo_workspaces.types.migrate_workspace_result.MigrateWorkspaceResult"
]:
import capo_workspaces._operations.workspaces_service.migrate_workspace
(
output,
http_response,
) = await capo_workspaces._operations.workspaces_service.migrate_workspace.async_migrate_workspace(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("MigrateWorkspace")
)
input_: capo_workspaces.types.migrate_workspace_request.MigrateWorkspaceRequest = {
"source_workspace_id": source_workspace_id,
"bundle_id": bundle_id,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|