Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
<artifactId>cloud-plugin-storage-volume-linstor</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-volume-storpool</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-server</artifactId>
Expand Down Expand Up @@ -755,6 +760,12 @@
<artifactId>bcpkix-jdk15on</artifactId>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-storage-volume-storpool</artifactId>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.bouncycastle</groupId>
Expand Down Expand Up @@ -799,6 +810,7 @@
<exclude>org.bouncycastle:bcpkix-jdk15on</exclude>
<exclude>org.bouncycastle:bctls-jdk15on</exclude>
<exclude>mysql:mysql-connector-java</exclude>
<exclude>org.apache.cloudstack:cloud-plugin-storage-volume-storpool</exclude>
</excludes>
</artifactSet>
<transformers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.cloudstack.storage.command;

import com.cloud.agent.api.Answer;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.to.DataTO;

public class CopyCmdAnswer extends Answer {
Expand All @@ -37,4 +38,8 @@ public DataTO getNewData() {
public CopyCmdAnswer(String errMsg) {
super(null, false, errMsg);
}

public CopyCmdAnswer(Command cmd, Exception e) {
super(cmd, e);
}
}
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ override_dh_auto_install:
mkdir $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D plugins/hypervisors/kvm/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/
install -D plugins/storage/volume/storpool/target/cloud-plugin-storage-volume-storpool-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-agent/lib/

install -d -m0755 debian/$(PACKAGE)-agent/lib/systemd/system
install -m0644 packaging/systemd/$(PACKAGE)-agent.service debian/$(PACKAGE)-agent/lib/systemd/system/$(PACKAGE)-agent.service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,33 @@ enum QualityOfServiceState { MIGRATION, NO_MIGRATION }
* returns true if the host can access the storage pool
*/
boolean canHostAccessStoragePool(Host host, StoragePool pool);

/**
* Used by storage pools which want to keep VMs' information
* @return true if additional VM info is needed (intended for storage pools).
*/
boolean isVmInfoNeeded();

/**
* Provides additional info for a VM (intended for storage pools).
* E.g. the storage pool may want to keep/delete information if the volume is attached/detached to any VM.
* @param vmId The ID of the virtual machine
* @param volumeId the ID of the volume
*/
void provideVmInfo(long vmId, long volumeId);

/**
* Returns true if the storage have to know about the VM's tags (intended for storage pools).
* @param tagKey The name of the tag
* @return true if the storage have to know about the VM's tags
*/
boolean isVmTagsNeeded(String tagKey);

/**
* Provide VM's tags to storage (intended for storage pools).
* @param vmId The ID of the virtual machine
* @param volumeId The ID of the volume
* @param tagValue The value of the VM's tag
*/
void provideVmTags(long vmId, long volumeId, String tagValue);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public interface StorageStrategyFactory {
/**
* Used only for KVM hypervisors when allocating a VM snapshot
* @param vmId the ID of the virtual machine
* @param rootPoolId volume pool ID
* @param snapshotMemory for VM snapshots with memory
* @return VMSnapshotStrategy
*/
VMSnapshotStrategy getVmSnapshotStrategy(Long vmId, Long rootPoolId, boolean snapshotMemory);

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface VMSnapshotStrategy {
StrategyPriority canHandle(VMSnapshot vmSnapshot);

/**
* Used only for KVM hypervisors when allocating a VM snapshot
* Verifies if the strategy can handle the VM snapshot. This method is used only for KVM hypervisors when allocating a VM snapshot.
* @param vmId the ID of the virtual machine
* @param snapshotMemory for VM snapshots with memory
* @return StrategyPriority
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
import com.cloud.storage.DiskOfferingVO;
import com.cloud.storage.GuestOSHypervisorVO;
import com.cloud.storage.GuestOSVO;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.Storage.ImageFormat;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.DiskOfferingDao;
import com.cloud.storage.dao.GuestOSDao;
import com.cloud.storage.dao.GuestOSHypervisorDao;
Expand Down
1 change: 1 addition & 0 deletions packaging/centos7/cloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ install -D agent/target/transformed/cloudstack-agent-profile.sh ${RPM_BUILD_ROOT
install -D agent/target/transformed/cloudstack-agent.logrotate ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}-agent
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-%{_maventag}.jar ${RPM_BUILD_ROOT}%{_datadir}/%name-agent/lib/cloud-plugin-hypervisor-kvm-%{_maventag}.jar
cp plugins/hypervisors/kvm/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib
cp plugins/storage/volume/storpool/target/*.jar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be avoided if the storpool plugin module is added as a dependency of the KVM hypervisor module

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nvazquez, yes, this is a solution, but the main reason the StorPool driver is not added as dependency is to be easy to maintain it. That's why all of it classes are kept in it's module

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slavkap
it is ok for me to add this jar to cloudstack-agent package.
but for management server, we need to get a consensus.


# Usage server
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage
Expand Down
1 change: 1 addition & 0 deletions packaging/centos8/cloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ install -D agent/target/transformed/cloudstack-agent-profile.sh ${RPM_BUILD_ROOT
install -D agent/target/transformed/cloudstack-agent.logrotate ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}-agent
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-%{_maventag}.jar ${RPM_BUILD_ROOT}%{_datadir}/%name-agent/lib/cloud-plugin-hypervisor-kvm-%{_maventag}.jar
cp plugins/hypervisors/kvm/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib
cp plugins/storage/volume/storpool/target/*.jar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib

# Usage server
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage
Expand Down
1 change: 1 addition & 0 deletions packaging/suse15/cloud.spec
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ install -D agent/target/transformed/cloudstack-agent-profile.sh ${RPM_BUILD_ROOT
install -D agent/target/transformed/cloudstack-agent.logrotate ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}-agent
install -D plugins/hypervisors/kvm/target/cloud-plugin-hypervisor-kvm-%{_maventag}.jar ${RPM_BUILD_ROOT}%{_datadir}/%name-agent/lib/cloud-plugin-hypervisor-kvm-%{_maventag}.jar
cp plugins/hypervisors/kvm/target/dependencies/* ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib
cp plugins/storage/volume/storpool/target/*.jar ${RPM_BUILD_ROOT}%{_datadir}/%{name}-agent/lib

# Usage server
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/usage
Expand Down
4 changes: 3 additions & 1 deletion plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
<module>storage/volume/solidfire</module>
<module>storage/volume/scaleio</module>
<module>storage/volume/linstor</module>
<module>storage/volume/storpool</module>


<module>storage-allocators/random</module>

Expand Down Expand Up @@ -211,4 +213,4 @@
</modules>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -1860,4 +1860,22 @@ public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId)
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
return true;
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -491,4 +491,22 @@ public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId)
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
return true;
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -765,4 +765,22 @@ public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId)
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
return true;
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,22 @@ public Pair<Long, Long> getStorageStats(StoragePool storagePool) {
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
return true;
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,22 @@ public Pair<Long, Long> getStorageStats(StoragePool storagePool) {
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
return true;
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -947,4 +947,22 @@ private void alertHostSdcDisconnection(Host host) {
String msg = "SDC not connected on the host: " + host.getId() + ", reconnect the SDC to MDM";
alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST, host.getDataCenterId(), host.getPodId(), "SDC disconnected on host: " + host.getUuid(), msg);
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1619,4 +1619,22 @@ public Pair<Long, Long> getVolumeStats(StoragePool storagePool, String volumeId)
public boolean canHostAccessStoragePool(Host host, StoragePool pool) {
return true;
}

@Override
public boolean isVmInfoNeeded() {
return false;
}

@Override
public void provideVmInfo(long vmId, long volumeId) {
}

@Override
public boolean isVmTagsNeeded(String tagKey) {
return false;
}

@Override
public void provideVmTags(long vmId, long volumeId, String tagValue) {
}
}
Loading