You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ya...@apache.org on 2013/07/22 07:37:20 UTC
[11/50] [abbrv] git commit: updated refs/heads/pvlan to ce299da
rbd: Allow RBD disks to be attached to a Instance
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5646f5e9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5646f5e9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5646f5e9
Branch: refs/heads/pvlan
Commit: 5646f5e9772380cc91a8ccb9894c8ed05ffc891f
Parents: b3e9b2a
Author: Wido den Hollander <wi...@widodh.nl>
Authored: Fri May 17 17:03:21 2013 +0200
Committer: Wido den Hollander <wi...@widodh.nl>
Committed: Fri May 17 17:34:05 2013 +0200
----------------------------------------------------------------------
.../hypervisor/kvm/resource/LibvirtComputingResource.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5646f5e9/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index c3140d3..b31fb5d 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -3581,6 +3581,7 @@ ServerResource {
List<DiskDef> disks = null;
Domain dm = null;
DiskDef diskdef = null;
+ KVMStoragePool attachingPool = attachingDisk.getPool();
try {
if (!attach) {
dm = conn.domainLookupByUUID(UUID.nameUUIDFromBytes(vmName
@@ -3605,7 +3606,12 @@ ServerResource {
}
} else {
diskdef = new DiskDef();
- if (attachingDisk.getFormat() == PhysicalDiskFormat.QCOW2) {
+ if (attachingPool.getType() == StoragePoolType.RBD) {
+ diskdef.defNetworkBasedDisk(attachingDisk.getPath(),
+ attachingPool.getSourceHost(), attachingPool.getSourcePort(),
+ attachingPool.getAuthUserName(), attachingPool.getUuid(), devId,
+ DiskDef.diskBus.VIRTIO, diskProtocol.RBD);
+ } else if (attachingDisk.getFormat() == PhysicalDiskFormat.QCOW2) {
diskdef.defFileBasedDisk(attachingDisk.getPath(), devId,
DiskDef.diskBus.VIRTIO, DiskDef.diskFmtType.QCOW2);
} else if (attachingDisk.getFormat() == PhysicalDiskFormat.RAW) {