|
78 | 78 | import com.cloud.storage.Storage; |
79 | 79 | import com.cloud.storage.Storage.StoragePoolType; |
80 | 80 | import com.cloud.storage.StorageLayer; |
| 81 | +import com.cloud.utils.RbdUtils; |
81 | 82 | import com.cloud.utils.exception.CloudRuntimeException; |
82 | 83 | import com.cloud.utils.script.Script; |
83 | 84 | import com.cloud.utils.storage.TemplateDownloaderUtil; |
@@ -1435,7 +1436,7 @@ private KVMPhysicalDisk createDiskFromTemplateOnRBD(KVMPhysicalDisk template, |
1435 | 1436 | logger.debug("Trying to perform a RBD clone (layering) since we are operating in the same storage pool"); |
1436 | 1437 |
|
1437 | 1438 | Rados r = new Rados(srcPool.getAuthUserName()); |
1438 | | - r.confSet("mon_host", srcPool.getSourceHost() + ":" + srcPool.getSourcePort()); |
| 1439 | + r.confSet("mon_host", RbdUtils.getRbdMonitors(srcPool.getSourceHost(), srcPool.getSourcePort())); |
1439 | 1440 | r.confSet("key", srcPool.getAuthSecret()); |
1440 | 1441 | r.confSet("client_mount_timeout", "30"); |
1441 | 1442 | if (dataPool != null) { |
@@ -1508,14 +1509,14 @@ private KVMPhysicalDisk createDiskFromTemplateOnRBD(KVMPhysicalDisk template, |
1508 | 1509 | logger.debug("Both the source and destination are RBD, but not the same Ceph cluster. Performing a copy"); |
1509 | 1510 |
|
1510 | 1511 | Rados rSrc = new Rados(srcPool.getAuthUserName()); |
1511 | | - rSrc.confSet("mon_host", srcPool.getSourceHost() + ":" + srcPool.getSourcePort()); |
| 1512 | + rSrc.confSet("mon_host", RbdUtils.getRbdMonitors(srcPool.getSourceHost(), srcPool.getSourcePort())); |
1512 | 1513 | rSrc.confSet("key", srcPool.getAuthSecret()); |
1513 | 1514 | rSrc.confSet("client_mount_timeout", "30"); |
1514 | 1515 | rSrc.connect(); |
1515 | 1516 | logger.debug("Successfully connected to source Ceph cluster at " + rSrc.confGet("mon_host")); |
1516 | 1517 |
|
1517 | 1518 | Rados rDest = new Rados(destPool.getAuthUserName()); |
1518 | | - rDest.confSet("mon_host", destPool.getSourceHost() + ":" + destPool.getSourcePort()); |
| 1519 | + rDest.confSet("mon_host", RbdUtils.getRbdMonitors(destPool.getSourceHost(), destPool.getSourcePort())); |
1519 | 1520 | rDest.confSet("key", destPool.getAuthSecret()); |
1520 | 1521 | rDest.confSet("client_mount_timeout", "30"); |
1521 | 1522 | if (dataPool != null) { |
@@ -1580,7 +1581,7 @@ private KVMPhysicalDisk createEncryptedRootCoWClone(KVMPhysicalDisk template, KV |
1580 | 1581 | RbdImage templateImage = null; |
1581 | 1582 | try { |
1582 | 1583 | radosConnection = new Rados(destPool.getAuthUserName()); |
1583 | | - radosConnection.confSet("mon_host", destPool.getSourceHost() + ":" + destPool.getSourcePort()); |
| 1584 | + radosConnection.confSet("mon_host", RbdUtils.getRbdMonitors(destPool.getSourceHost(), destPool.getSourcePort())); |
1584 | 1585 | radosConnection.confSet("key", destPool.getAuthSecret()); |
1585 | 1586 | radosConnection.confSet("client_mount_timeout", "30"); |
1586 | 1587 | radosConnection.connect(); |
@@ -1641,7 +1642,7 @@ private KVMPhysicalDisk createEncryptedRootFullCopy(KVMStoragePool srcPool, KVMP |
1641 | 1642 | IoCTX ioContext = null; |
1642 | 1643 | try { |
1643 | 1644 | radosConnection = new Rados(destPool.getAuthUserName()); |
1644 | | - radosConnection.confSet("mon_host", destPool.getSourceHost() + ":" + destPool.getSourcePort()); |
| 1645 | + radosConnection.confSet("mon_host", RbdUtils.getRbdMonitors(destPool.getSourceHost(), destPool.getSourcePort())); |
1645 | 1646 | radosConnection.confSet("key", destPool.getAuthSecret()); |
1646 | 1647 | radosConnection.confSet("client_mount_timeout", "30"); |
1647 | 1648 | radosConnection.connect(); |
@@ -1820,7 +1821,7 @@ to support snapshots(backuped) as qcow2 files. */ |
1820 | 1821 |
|
1821 | 1822 | /* We have to stat the RBD image to see how big it became afterwards */ |
1822 | 1823 | Rados r = new Rados(destPool.getAuthUserName()); |
1823 | | - r.confSet("mon_host", destPool.getSourceHost() + ":" + destPool.getSourcePort()); |
| 1824 | + r.confSet("mon_host", RbdUtils.getRbdMonitors(destPool.getSourceHost(), destPool.getSourcePort())); |
1824 | 1825 | r.confSet("key", destPool.getAuthSecret()); |
1825 | 1826 | r.confSet("client_mount_timeout", "30"); |
1826 | 1827 | r.connect(); |
|
0 commit comments