-
Notifications
You must be signed in to change notification settings - Fork 1.2k
VMware to KVM Migrations improvements #11594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nvazquez
merged 27 commits into
apache:main
from
shapeblue:422-vmware-to-kvm-improvements
Oct 10, 2025
Merged
Changes from 9 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3b1ab6f
Add source VM name on virt-v2v migration log entries
nvazquez e194ba9
Improve the feedback by displaying the running importing tasks
nvazquez 83fd30d
Add source VM name prefix on more conversion logs
nvazquez f9e9466
Improve listing and also list completed tasks
nvazquez 9200dd0
Pass extra parameters to virt-v2v if administrator allows via global …
nvazquez c3b06da
Add Force converting directly to storage pool option
nvazquez e9176ee
Refactor based on review comments
nvazquez 2a92813
Add properties for env vars for the instance conversion
nvazquez 2f08049
Add separate component for Import VM Tasks
nvazquez 6493720
applying copilot suggestions from code review
shwstppr 1ba03c0
Merge branch 'main' into 422-vmware-to-kvm-improvements
sureshanaparti 7196e09
Fix importing unmanaged instances due to incorrect internal name
nvazquez 03ed3cf
Add VM prefix on each log operation for conversion
nvazquez f952e76
Log the original VM name instead of the cloned VM in case of cloning
nvazquez b981367
Allow searching storage pool by UUID after conversion to support Shar…
nvazquez b1012d2
Fix search pools logic
nvazquez 63c0eac
Improve UI and add checks for force convert to pool parameter
nvazquez 0638763
Merge branch 'main' into 422-vmware-to-kvm-improvements
nvazquez 2c52bfa
Support Local storage when forceconverttopool is set to true
nvazquez 977f6b6
Merge branch 'main' into 422-vmware-to-kvm-improvements
nvazquez c506ee8
Merge branch 'main' into 422-vmware-to-kvm-improvements
nvazquez 4c5b87d
Add config key to for allowed extra params and add validation
nvazquez 4f73495
Fix params lists
nvazquez 9431b9d
Fix compile error
nvazquez 83c6585
Remove extra stubbings
nvazquez d9c0f74
Merge branch 'main' into 422-vmware-to-kvm-improvements
nvazquez dac73f4
Fix extra params execution
nvazquez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
123 changes: 123 additions & 0 deletions
123
api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ListImportVMTasksCmd.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
| package org.apache.cloudstack.api.command.admin.vm; | ||
|
|
||
| import com.cloud.exception.ConcurrentOperationException; | ||
| import com.cloud.exception.InsufficientCapacityException; | ||
| import com.cloud.exception.NetworkRuleConflictException; | ||
| import com.cloud.exception.ResourceAllocationException; | ||
| import com.cloud.exception.ResourceUnavailableException; | ||
| import com.cloud.user.Account; | ||
| import org.apache.cloudstack.acl.RoleType; | ||
| import org.apache.cloudstack.api.APICommand; | ||
| import org.apache.cloudstack.api.ApiConstants; | ||
| import org.apache.cloudstack.api.BaseListCmd; | ||
| import org.apache.cloudstack.api.Parameter; | ||
| import org.apache.cloudstack.api.ResponseObject; | ||
| import org.apache.cloudstack.api.ServerApiException; | ||
| import org.apache.cloudstack.api.response.AccountResponse; | ||
| import org.apache.cloudstack.api.response.HostResponse; | ||
| import org.apache.cloudstack.api.response.ImportVMTaskResponse; | ||
| import org.apache.cloudstack.api.response.ListResponse; | ||
| import org.apache.cloudstack.api.response.ZoneResponse; | ||
| import org.apache.cloudstack.context.CallContext; | ||
| import org.apache.cloudstack.vm.ImportVmTasksManager; | ||
|
|
||
| import javax.inject.Inject; | ||
|
|
||
| @APICommand(name = "listImportVmTasks", | ||
| description = "List running import virtual machine tasks from a unmanaged hosts into CloudStack", | ||
| responseObject = ImportVMTaskResponse.class, | ||
| responseView = ResponseObject.ResponseView.Full, | ||
| requestHasSensitiveInfo = false, | ||
| authorized = {RoleType.Admin}, | ||
| since = "4.22") | ||
| public class ListImportVMTasksCmd extends BaseListCmd { | ||
|
|
||
| @Inject | ||
| public ImportVmTasksManager importVmTasksManager; | ||
|
|
||
| @Parameter(name = ApiConstants.ZONE_ID, | ||
| type = CommandType.UUID, | ||
| entityType = ZoneResponse.class, | ||
| required = true, | ||
| description = "the zone ID") | ||
| private Long zoneId; | ||
|
|
||
| @Parameter(name = ApiConstants.ACCOUNT_ID, | ||
| type = CommandType.UUID, | ||
| entityType = AccountResponse.class, | ||
| description = "the ID of the Account") | ||
| private Long accountId; | ||
|
|
||
| @Parameter(name = ApiConstants.VCENTER, | ||
| type = CommandType.STRING, | ||
| description = "The name/ip of vCenter. Make sure it is IP address or full qualified domain name for host running vCenter server.") | ||
| private String vcenter; | ||
|
|
||
| @Parameter(name = ApiConstants.CONVERT_INSTANCE_HOST_ID, | ||
| type = CommandType.UUID, | ||
| entityType = HostResponse.class, | ||
| description = "Conversion host of the importing task") | ||
| private Long convertHostId; | ||
|
|
||
| @Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, description = "Whether to list all import tasks.") | ||
| private boolean listAll = false; | ||
|
|
||
| @Parameter(name = ApiConstants.SHOW_COMPLETED, type = CommandType.BOOLEAN, description = "Whether to list completed tasks.") | ||
| private boolean showCompleted = false; | ||
|
|
||
| public Long getZoneId() { | ||
| return zoneId; | ||
| } | ||
|
|
||
| public Long getAccountId() { | ||
| return accountId; | ||
| } | ||
|
|
||
| public String getVcenter() { | ||
| return vcenter; | ||
| } | ||
|
|
||
| public Long getConvertHostId() { | ||
| return convertHostId; | ||
| } | ||
|
|
||
| public boolean isListAll() { | ||
| return listAll; | ||
| } | ||
|
|
||
| public boolean isShowCompleted() { | ||
| return showCompleted; | ||
| } | ||
|
|
||
| @Override | ||
| public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { | ||
| ListResponse<ImportVMTaskResponse> response = importVmTasksManager.listImportVMTasks(this); | ||
| response.setResponseName(getCommandName()); | ||
| setResponseObject(response); | ||
| } | ||
|
|
||
| @Override | ||
| public long getEntityOwnerId() { | ||
| Account account = CallContext.current().getCallingAccount(); | ||
| if (account != null) { | ||
| return account.getId(); | ||
| } | ||
| return Account.ACCOUNT_ID_SYSTEM; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor - What is the difference between these params, are these tasks associated with different initiator accounts? If not then can we use listall param to list completed tasks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shwstppr - by default only running tasks will be listed. Difference should be when
showcompleted = truewill retrieve only the completed but not the running tasks, butlistall = trueshould list running and completed tasks