-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Initial primary storage pool plugin skeleton #11785
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
Open
rajiv-jain-netapp
wants to merge
1
commit into
apache:main
Choose a base branch
from
NetApp:feature-CSTACKEX-24
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!-- | ||
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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>cloud-plugin-storage-volume-ontap</artifactId> | ||
<name>Apache CloudStack Plugin - Storage Volume ONTAP Provider</name> | ||
<parent> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloudstack-plugins</artifactId> | ||
<version>4.22.0.0-SNAPSHOT</version> | ||
<relativePath>../../../pom.xml</relativePath> | ||
</parent> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-plugin-storage-volume-default</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.json</groupId> | ||
<artifactId>json</artifactId> | ||
<version>20230227</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.cloudstack</groupId> | ||
<artifactId>cloud-engine-storage-volume</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>true</skipTests> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>integration-test</phase> | ||
<goals> | ||
<goal>test</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
190 changes: 190 additions & 0 deletions
190
...ontap/src/main/java/org/apache/cloudstack/storage/driver/OntapPrimaryDatastoreDriver.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,190 @@ | ||
package org.apache.cloudstack.storage.driver; | ||
|
||
|
||
import com.cloud.agent.api.to.DataStoreTO; | ||
import com.cloud.agent.api.to.DataTO; | ||
import com.cloud.host.Host; | ||
import com.cloud.storage.Storage; | ||
import com.cloud.storage.StoragePool; | ||
import com.cloud.storage.Volume; | ||
import com.cloud.utils.Pair; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; | ||
import org.apache.cloudstack.framework.async.AsyncCompletionCallback; | ||
import org.apache.cloudstack.storage.command.CommandResult; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
@Component | ||
public class OntapPrimaryDatastoreDriver implements PrimaryDataStoreDriver { | ||
|
||
private static final Logger s_logger = (Logger)LogManager.getLogger(OntapPrimaryDatastoreDriver.class); | ||
@Override | ||
public Map<String, String> getCapabilities() { | ||
s_logger.trace("OntapPrimaryDatastoreDriver: getCapabilities: Called"); | ||
Map<String, String> mapCapabilities = new HashMap<>(); | ||
|
||
mapCapabilities.put(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString(), Boolean.TRUE.toString()); | ||
mapCapabilities.put(DataStoreCapabilities.CAN_CREATE_VOLUME_FROM_SNAPSHOT.toString(), Boolean.TRUE.toString()); | ||
|
||
return mapCapabilities; | ||
} | ||
|
||
@Override | ||
public DataTO getTO(DataObject data) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public DataStoreTO getStoreTO(DataStore store) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void createAsync(DataStore store, DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) { | ||
|
||
s_logger.trace("OntapPrimaryDatastoreDriver: createAsync: Store: "+store+", data: "+data); | ||
} | ||
|
||
@Override | ||
public void deleteAsync(DataStore store, DataObject data, AsyncCompletionCallback<CommandResult> callback) { | ||
|
||
} | ||
|
||
@Override | ||
public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) { | ||
|
||
} | ||
|
||
@Override | ||
public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean canCopy(DataObject srcData, DataObject destData) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) { | ||
|
||
} | ||
|
||
@Override | ||
public ChapInfo getChapInfo(DataObject dataObject) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) { | ||
|
||
} | ||
|
||
@Override | ||
public long getDataObjectSizeIncludingHypervisorSnapshotReserve(DataObject dataObject, StoragePool storagePool) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getBytesRequiredForTemplate(TemplateInfo templateInfo, StoragePool storagePool) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getUsedBytes(StoragePool storagePool) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public long getUsedIops(StoragePool storagePool) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback) { | ||
|
||
} | ||
|
||
@Override | ||
public void revertSnapshot(SnapshotInfo snapshotOnImageStore, SnapshotInfo snapshotOnPrimaryStore, AsyncCompletionCallback<CommandResult> callback) { | ||
|
||
} | ||
|
||
@Override | ||
public void handleQualityOfServiceForVolumeMigration(VolumeInfo volumeInfo, QualityOfServiceState qualityOfServiceState) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean canProvideStorageStats() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public Pair<Long, Long> getStorageStats(StoragePool storagePool) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean canProvideVolumeStats() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean canHostAccessStoragePool(Host host, StoragePool pool) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isVmInfoNeeded() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void provideVmInfo(long vmId, long volumeId) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isVmTagsNeeded(String tagKey) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void provideVmTags(long vmId, long volumeId, String tagValue) { | ||
|
||
} | ||
|
||
@Override | ||
public boolean isStorageSupportHA(Storage.StoragePoolType type) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void detachVolumeFromAllStorageNodes(Volume volume) { | ||
|
||
} | ||
} |
91 changes: 91 additions & 0 deletions
91
...src/main/java/org/apache/cloudstack/storage/lifecycle/OntapPrimaryDatastoreLifecycle.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,91 @@ | ||
package org.apache.cloudstack.storage.lifecycle; | ||
|
||
|
||
import com.cloud.agent.api.StoragePoolInfo; | ||
import com.cloud.hypervisor.Hypervisor; | ||
import com.cloud.storage.StoragePool; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.HostScope; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle; | ||
import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import java.util.Map; | ||
|
||
public class OntapPrimaryDatastoreLifecycle implements PrimaryDataStoreLifeCycle { | ||
|
||
private static final Logger s_logger = (Logger)LogManager.getLogger(OntapPrimaryDatastoreLifecycle.class); | ||
|
||
/** | ||
* Creates primary storage on NetApp storage | ||
* @param dsInfos | ||
* @return | ||
*/ | ||
@Override | ||
public DataStore initialize(Map<String, Object> dsInfos) { | ||
|
||
return null; | ||
|
||
} | ||
|
||
@Override | ||
public boolean attachCluster(DataStore store, ClusterScope scope) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.HypervisorType hypervisorType) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean maintain(DataStore store) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean cancelMaintain(DataStore store) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean deleteDataStore(DataStore store) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean migrateToObjectStore(DataStore store) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void updateStoragePool(StoragePool storagePool, Map<String, String> details) { | ||
|
||
} | ||
|
||
@Override | ||
public void enableStoragePool(DataStore store) { | ||
|
||
} | ||
|
||
@Override | ||
public void disableStoragePool(DataStore store) { | ||
|
||
} | ||
|
||
@Override | ||
public void changeStoragePoolScopeToZone(DataStore store, ClusterScope clusterScope, Hypervisor.HypervisorType hypervisorType) { | ||
|
||
} | ||
|
||
@Override | ||
public void changeStoragePoolScopeToCluster(DataStore store, ClusterScope clusterScope, Hypervisor.HypervisorType hypervisorType) { | ||
|
||
} | ||
} |
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.
All of the new files need to have the Apache license header