]> xenbits.xensource.com Git - libvirt.git/commitdiff
rbd: Do not append Ceph monitor port number 6789 if not provided
authorWido den Hollander <wido@widodh.nl>
Wed, 6 Jan 2016 10:36:39 +0000 (11:36 +0100)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 6 Jan 2016 13:13:50 +0000 (08:13 -0500)
If no port number was provided for a storage pool libvirt defaults to
port 6789; however, librbd/librados already default to 6789 when no port
number is provided.

In the future Ceph will switch to a new port for the Ceph monitors since
port 6789 is already assigned to a different application by IANA.

Port 6789 is assigned to SMC-HTTPS and Ceph now has port 3300 assigned as
the 'Ceph monitor' port.

In this case it is the best solution to not hardcode any port number into
libvirt and let librados handle the connection.

Only if a user specifies a different port number we pass it down to librados,
otherwise we leave it blank.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
merge

docs/formatdomain.html.in
docs/storage.html.in
src/storage/storage_backend_rbd.c
src/util/virstoragefile.c

index ce46f061d8678c332514f715bab8c02e5b0da670..889e721b9c592cd28268536726eccc1ed21ea151 100644 (file)
                 <td> rbd </td>
                 <td> monitor servers of RBD </td>
                 <td> one or more </td>
-                <td> 6789 </td>
+                <td> librados default </td>
               </tr>
               <tr>
                 <td> sheepdog </td>
index 6c8222abe8d08ea2a2527bc54334de2ed3ea4506..1f0133035628e6cd526ea3b5eefee71017029729 100644 (file)
       backend supports cephx authentication for communication with the
       Ceph cluster. Storing the cephx authentication key is done with
       the libvirt secret mechanism. The UUID in the example pool input
-      refers to the UUID of the stored secret.
+      refers to the UUID of the stored secret.<br />
+      The port attribute for a Ceph monitor does not have to be provided.
+      If not provided librados will use the default Ceph monitor port.
       <span class="since">Since 0.9.13</span>
     </p>
 
         &lt;name&gt;myrbdpool&lt;/name&gt;
         &lt;source&gt;
           &lt;name&gt;rbdpool&lt;/name&gt;
-          &lt;host name='1.2.3.4' port='6789'/&gt;
-          &lt;host name='my.ceph.monitor' port='6789'/&gt;
+          &lt;host name='1.2.3.4'/&gt;
+          &lt;host name='my.ceph.monitor'/&gt;
           &lt;host name='third.ceph.monitor' port='6789'/&gt;
           &lt;auth username='admin' type='ceph'&gt;
             &lt;secret uuid='2ec115d7-3a88-3ceb-bc12-0ac909a6fd87'/&gt;
index 8dcb9be8991f30e8358a2dff1b7efb336e1fafc3..e20a54d35d40d07d29cd623176f384453f69e724 100644 (file)
@@ -173,7 +173,7 @@ static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
     for (i = 0; i < source->nhost; i++) {
         if (source->hosts[i].name != NULL &&
             !source->hosts[i].port) {
-            virBufferAsprintf(&mon_host, "%s:6789,",
+            virBufferAsprintf(&mon_host, "%s,",
                               source->hosts[i].name);
         } else if (source->hosts[i].name != NULL &&
             source->hosts[i].port) {
index 2aa1d90d65817ca2c46aaf23250ab4cc85699195..101070f95ae8900b1f9950bdab2e786c2e274f81 100644 (file)
@@ -2245,9 +2245,6 @@ virStorageSourceRBDAddHost(virStorageSourcePtr src,
         port += skip;
         if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, port) < 0)
             goto error;
-    } else {
-        if (VIR_STRDUP(src->hosts[src->nhosts - 1].port, "6789") < 0)
-            goto error;
     }
 
     parts = virStringSplit(hostport, "\\:", 0);