-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Added disk provisioning type support for VMWare #4640
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
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0602c7d
Added disk provisioning type support for VMWare
Spaceman1984 ec5682b
Review changes
Spaceman1984 362e45c
Fixed unit test
Spaceman1984 e4b7f03
Review changes
Spaceman1984 6c14400
Added missing licenses
Spaceman1984 299c3de
Review changes
Spaceman1984 280cd67
Update StoragePoolInfo.java
Spaceman1984 426d37c
Review change - Getting disk provisioning strictness setting using th…
Spaceman1984 c96505b
Delete __init__.py
Spaceman1984 7ff9850
Merge fix
Spaceman1984 e423075
Fixed failing test
Spaceman1984 429aaaf
Added comment about parameters
Spaceman1984 f7dbb10
Added error log when update fails
Spaceman1984 382b9eb
Added exception when using API
Spaceman1984 67726ee
Ordering storage pool selection to prefer thick disk capable pools if…
Spaceman1984 bbd8516
Removed unused parameter
Spaceman1984 a511fd1
Reordering changes
Spaceman1984 3838035
Returning storage pool details after update
Spaceman1984 b59da6b
Removed multiple pool update, updated marvin test, removed duplicate …
Spaceman1984 dbc7671
Removed comment
Spaceman1984 416231f
Removed unused import
Spaceman1984 f32162a
Removed for loop
Spaceman1984 35a7311
Added missing return statements for failed checks
Spaceman1984 29de816
Class name change
Spaceman1984 8447cb8
Null pointer
Spaceman1984 2486db7
Added more info when a deployment fails
Spaceman1984 990caed
Null pointer
Spaceman1984 5dd3838
Update api/src/main/java/org/apache/cloudstack/api/BaseListCmd.java
Spaceman1984 396f89c
Small bug fix on API response and added missing bracket
Spaceman1984 72e7e8c
Removed datastore cluster code
Spaceman1984 bcb1731
Removed unused imports, added missing signature
Spaceman1984 63cbc88
Removed duplicate config key
Spaceman1984 ec8cc4d
Merge branch 'main' into disk_provision_type_vmware
Spaceman1984 9c55d28
Revert "Added more info when a deployment fails"
Spaceman1984 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
86 changes: 86 additions & 0 deletions
86
...in/java/org/apache/cloudstack/api/command/admin/storage/UpdateStorageCapabilitiesCmd.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,86 @@ | ||
| // 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.storage; | ||
|
|
||
| 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 org.apache.cloudstack.api.APICommand; | ||
| import org.apache.cloudstack.api.ApiConstants; | ||
| import org.apache.cloudstack.api.BaseCmd; | ||
| import org.apache.cloudstack.api.Parameter; | ||
| import org.apache.cloudstack.api.ServerApiException; | ||
| import org.apache.cloudstack.api.response.ListResponse; | ||
| import org.apache.cloudstack.api.response.StoragePoolResponse; | ||
| import org.apache.cloudstack.context.CallContext; | ||
| import org.apache.log4j.Logger; | ||
|
|
||
| import java.util.Locale; | ||
|
|
||
| @APICommand(name = UpdateStorageCapabilitiesCmd.APINAME, description = "Syncs capabilities of storage pools", | ||
| responseObject = StoragePoolResponse.class, | ||
| requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, since = "4.16.0") | ||
| public class UpdateStorageCapabilitiesCmd extends BaseCmd { | ||
| public static final String APINAME = "updateStorageCapabilities"; | ||
| private static final Logger LOG = Logger.getLogger(UpdateStorageCapabilitiesCmd.class.getName()); | ||
|
|
||
| ///////////////////////////////////////////////////// | ||
| //////////////// API parameters ///////////////////// | ||
| ///////////////////////////////////////////////////// | ||
|
|
||
| @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = StoragePoolResponse.class, required = true, description = "Storage pool id") | ||
| private Long poolId; | ||
|
|
||
| ///////////////////////////////////////////////////// | ||
| /////////////////// Accessors /////////////////////// | ||
| ///////////////////////////////////////////////////// | ||
|
|
||
| public Long getPoolId() { | ||
| return poolId; | ||
| } | ||
|
|
||
| public void setPoolId(Long poolId) { | ||
| this.poolId = poolId; | ||
| } | ||
|
|
||
| ///////////////////////////////////////////////////// | ||
| /////////////// API Implementation/////////////////// | ||
| ///////////////////////////////////////////////////// | ||
|
|
||
|
|
||
| @Override | ||
| public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { | ||
| _storageService.updateStorageCapabilities(poolId, true); | ||
| ListStoragePoolsCmd listStoragePoolCmd = new ListStoragePoolsCmd(); | ||
| listStoragePoolCmd.setId(poolId); | ||
| ListResponse<StoragePoolResponse> listResponse = _queryService.searchForStoragePools(listStoragePoolCmd); | ||
| listResponse.setResponseName(getCommandName()); | ||
| this.setResponseObject(listResponse); | ||
| } | ||
|
|
||
| @Override | ||
| public String getCommandName() { | ||
| return APINAME.toLowerCase(Locale.ROOT) + "response" ; | ||
| } | ||
|
|
||
| @Override | ||
| public long getEntityOwnerId() { | ||
| return CallContext.current().getCallingAccountId(); | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
core/src/main/java/com/cloud/agent/api/GetStoragePoolCapabilitiesAnswer.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,47 @@ | ||
| // 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 com.cloud.agent.api; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
|
|
||
| public class GetStoragePoolCapabilitiesAnswer extends Answer { | ||
|
|
||
| private Map<String, String> poolDetails; | ||
|
|
||
| public GetStoragePoolCapabilitiesAnswer(GetStoragePoolCapabilitiesCommand cmd) { | ||
| super(cmd); | ||
| poolDetails = new HashMap<>(); | ||
| } | ||
|
|
||
| public void setResult(boolean result){ | ||
| this.result = result; | ||
| } | ||
|
|
||
| public void setDetails(String details){ | ||
| this.details = details; | ||
| } | ||
|
|
||
| public Map<String, String> getPoolDetails() { | ||
| return poolDetails; | ||
| } | ||
|
|
||
| public void setPoolDetails(Map<String, String> poolDetails) { | ||
| this.poolDetails = poolDetails; | ||
| } | ||
|
|
||
| } |
37 changes: 37 additions & 0 deletions
37
core/src/main/java/com/cloud/agent/api/GetStoragePoolCapabilitiesCommand.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,37 @@ | ||
| // 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 com.cloud.agent.api; | ||
|
|
||
| import com.cloud.agent.api.to.StorageFilerTO; | ||
|
|
||
| public class GetStoragePoolCapabilitiesCommand extends Command { | ||
|
|
||
| public StorageFilerTO getPool() { | ||
| return pool; | ||
| } | ||
|
|
||
| public void setPool(StorageFilerTO pool) { | ||
| this.pool = pool; | ||
| } | ||
|
|
||
| private StorageFilerTO pool; | ||
|
|
||
| @Override | ||
| public boolean executeInSequence() { | ||
| return false; | ||
| } | ||
| } |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.