|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * "License"); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, |
| 13 | + * software distributed under the License is distributed on an |
| 14 | + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | + * KIND, either express or implied. See the License for the |
| 16 | + * specific language governing permissions and limitations |
| 17 | + * under the License. |
| 18 | + */ |
| 19 | +package org.apache.cloudstack.storage.driver; |
| 20 | + |
| 21 | +import com.cloud.agent.api.to.DataStoreTO; |
| 22 | +import com.cloud.agent.api.to.DataTO; |
| 23 | +import com.cloud.host.Host; |
| 24 | +import com.cloud.storage.Storage; |
| 25 | +import com.cloud.storage.StoragePool; |
| 26 | +import com.cloud.storage.Volume; |
| 27 | +import com.cloud.utils.Pair; |
| 28 | +import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; |
| 29 | +import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; |
| 30 | +import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; |
| 31 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; |
| 32 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; |
| 33 | +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreCapabilities; |
| 34 | +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; |
| 35 | +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; |
| 36 | +import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo; |
| 37 | +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; |
| 38 | +import org.apache.cloudstack.framework.async.AsyncCompletionCallback; |
| 39 | +import org.apache.cloudstack.storage.command.CommandResult; |
| 40 | +import org.apache.logging.log4j.LogManager; |
| 41 | +import org.apache.logging.log4j.Logger; |
| 42 | + |
| 43 | +import java.util.HashMap; |
| 44 | +import java.util.Map; |
| 45 | + |
| 46 | +public class OntapPrimaryDatastoreDriver implements PrimaryDataStoreDriver { |
| 47 | + |
| 48 | + private static final Logger s_logger = LogManager.getLogger(OntapPrimaryDatastoreDriver.class); |
| 49 | + |
| 50 | + @Override |
| 51 | + public Map<String, String> getCapabilities() { |
| 52 | + s_logger.trace("OntapPrimaryDatastoreDriver: getCapabilities: Called"); |
| 53 | + Map<String, String> mapCapabilities = new HashMap<>(); |
| 54 | + mapCapabilities.put(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString(), Boolean.FALSE.toString()); |
| 55 | + mapCapabilities.put(DataStoreCapabilities.CAN_CREATE_VOLUME_FROM_SNAPSHOT.toString(), Boolean.FALSE.toString()); |
| 56 | + |
| 57 | + return mapCapabilities; |
| 58 | + } |
| 59 | + |
| 60 | + @Override |
| 61 | + public DataTO getTO(DataObject data) { |
| 62 | + return null; |
| 63 | + } |
| 64 | + |
| 65 | + @Override |
| 66 | + public DataStoreTO getStoreTO(DataStore store) { return null; } |
| 67 | + |
| 68 | + @Override |
| 69 | + public void createAsync(DataStore dataStore, DataObject dataObject, AsyncCompletionCallback<CreateCmdResult> callback) {} |
| 70 | + |
| 71 | + @Override |
| 72 | + public void deleteAsync(DataStore store, DataObject data, AsyncCompletionCallback<CommandResult> callback) {} |
| 73 | + |
| 74 | + @Override |
| 75 | + public void copyAsync(DataObject srcData, DataObject destData, AsyncCompletionCallback<CopyCommandResult> callback) {} |
| 76 | + |
| 77 | + @Override |
| 78 | + public void copyAsync(DataObject srcData, DataObject destData, Host destHost, AsyncCompletionCallback<CopyCommandResult> callback) {} |
| 79 | + |
| 80 | + @Override |
| 81 | + public boolean canCopy(DataObject srcData, DataObject destData) { |
| 82 | + return false; |
| 83 | + } |
| 84 | + |
| 85 | + @Override |
| 86 | + public void resize(DataObject data, AsyncCompletionCallback<CreateCmdResult> callback) {} |
| 87 | + |
| 88 | + @Override |
| 89 | + public ChapInfo getChapInfo(DataObject dataObject) { |
| 90 | + return null; |
| 91 | + } |
| 92 | + |
| 93 | + @Override |
| 94 | + public boolean grantAccess(DataObject dataObject, Host host, DataStore dataStore) { |
| 95 | + return false; |
| 96 | + } |
| 97 | + |
| 98 | + @Override |
| 99 | + public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {} |
| 100 | + |
| 101 | + @Override |
| 102 | + public long getDataObjectSizeIncludingHypervisorSnapshotReserve(DataObject dataObject, StoragePool storagePool) { |
| 103 | + return 0; |
| 104 | + } |
| 105 | + |
| 106 | + @Override |
| 107 | + public long getBytesRequiredForTemplate(TemplateInfo templateInfo, StoragePool storagePool) { |
| 108 | + return 0; |
| 109 | + } |
| 110 | + |
| 111 | + @Override |
| 112 | + public long getUsedBytes(StoragePool storagePool) { |
| 113 | + return 0; |
| 114 | + } |
| 115 | + |
| 116 | + @Override |
| 117 | + public long getUsedIops(StoragePool storagePool) { |
| 118 | + return 0; |
| 119 | + } |
| 120 | + |
| 121 | + @Override |
| 122 | + public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback) {} |
| 123 | + |
| 124 | + @Override |
| 125 | + public void revertSnapshot(SnapshotInfo snapshotOnImageStore, SnapshotInfo snapshotOnPrimaryStore, AsyncCompletionCallback<CommandResult> callback) {} |
| 126 | + |
| 127 | + @Override |
| 128 | + public void handleQualityOfServiceForVolumeMigration(VolumeInfo volumeInfo, QualityOfServiceState qualityOfServiceState) {} |
| 129 | + |
| 130 | + @Override |
| 131 | + public boolean canProvideStorageStats() { |
| 132 | + return false; |
| 133 | + } |
| 134 | + |
| 135 | + @Override |
| 136 | + public Pair<Long, Long> getStorageStats(StoragePool storagePool) { |
| 137 | + return null; |
| 138 | + } |
| 139 | + |
| 140 | + @Override |
| 141 | + public boolean canProvideVolumeStats() { |
| 142 | + return true; |
| 143 | + } |
| 144 | + |
| 145 | + @Override |
| 146 | + public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId) { |
| 147 | + return null; |
| 148 | + } |
| 149 | + |
| 150 | + @Override |
| 151 | + public boolean canHostAccessStoragePool(Host host, StoragePool pool) { |
| 152 | + return true; |
| 153 | + } |
| 154 | + |
| 155 | + @Override |
| 156 | + public boolean isVmInfoNeeded() { |
| 157 | + return true; |
| 158 | + } |
| 159 | + |
| 160 | + @Override |
| 161 | + public void provideVmInfo(long vmId, long volumeId) {} |
| 162 | + |
| 163 | + @Override |
| 164 | + public boolean isVmTagsNeeded(String tagKey) { |
| 165 | + return true; |
| 166 | + } |
| 167 | + |
| 168 | + @Override |
| 169 | + public void provideVmTags(long vmId, long volumeId, String tagValue) {} |
| 170 | + |
| 171 | + @Override |
| 172 | + public boolean isStorageSupportHA(Storage.StoragePoolType type) { |
| 173 | + return true; |
| 174 | + } |
| 175 | + |
| 176 | + @Override |
| 177 | + public void detachVolumeFromAllStorageNodes(Volume volume) {} |
| 178 | +} |
0 commit comments