<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Massimo,</p>
    <p>Thanks for providing more information. As you can see from
      David's blog and the script
      (<a class="moz-txt-link-freetext" href="https://github.com/dmsimard/migrate-glance-backend">https://github.com/dmsimard/migrate-glance-backend</a>). The most
      tricky part is how to keep current image id, otherwise, all the
      existing instances will fail to rebuild. The way I'm suggesting
      can help keep the image id and don't have to create another image.
      The steps are as follow:</p>
    <p>1. Download and re-upload</p>
    <p>    1.1 Iterate tenants and images, download images, convert
      images from qcow to raw</p>
    <p>    1.2 upload images to RBD by following the same way like this
<a class="moz-txt-link-freetext" href="https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/rbd.py#L426">https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/rbd.py#L426</a></p>
    <p>2. Create new location for each image based on the location get
      from #1.2. For this step, it would be nice to enable  <font
        color="#003300"><i>show_multiple_locations=True</i></font> Note:
      Glance team would suggest to disable this after your migration.<i>
      </i>However, if you want to use CoW, you may still need to keep it
      :(<i><br>
      </i></p>
    <p>3. Delete old locations based on GlusterFS</p>
    <p>4. All done<br>
    </p>
    <p><br>
    </p>
    <p><b>NOTE</b>:</p>
    <p>1. For step #2 and #3, you could follow this blog about how
<a class="moz-txt-link-freetext" href="https://www.sebastien-han.fr/blog/2015/05/13/openstack-glance-use-multiple-location-for-an-image/">https://www.sebastien-han.fr/blog/2015/05/13/openstack-glance-use-multiple-location-for-an-image/</a><br>
    </p>
    <p>2. Step 1 and 2 can be done before your downtime window.</p>
    <p>3. Technically, you can keep the two locations without deleting
      the old location or at least getting a more smoother during
      migration by using location strategy. For this case, you can set:</p>
    <p><font color="#003300"><i>     stores=rbd,file</i></font></p>
    <p><font color="#003300"><i>     </i><i>location_strategy=store_type</i><i><br>
        </i></font></p>
    <p><font color="#003300"><i>     </i><i>store_type_preference=rbd,file</i></font></p>
    <p><i>     </i>That means if there are 2 locations, Glance will try
      to use the RBD location first, then filesystem location. See more
      info
<a class="moz-txt-link-freetext" href="https://github.com/openstack/glance/blob/master/etc/glance-api.conf#L4388">https://github.com/openstack/glance/blob/master/etc/glance-api.conf#L4388</a><br>
    </p>
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 29/03/17 02:02, Massimo Sgaravatto
      wrote:<br>
    </div>
    <blockquote
cite="mid:CALaZjRHUD=xiuuphZCh0jk1EqCGPGwdYCmJUHD14LhkJhvbSCg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>First  of all thanks for your help</div>
        <div><br>
        </div>
        <div>This is a private cloud which is right now using gluster as
          backend.</div>
        <div>Most of the images are private (i.e. usable only within the
          project), uploaded by the end-users.  </div>
        <div>Most of these images were saved in qcow2 format ... </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>The ceph cluster is still being benchmarked. I am testing
          the integration between ceph and openstack (and studying the
          migration) on a small openstack testbed.</div>
        <div><br>
        </div>
        <div> Having the glance service running during the migration is
          not strictly needed, i.e. we can plan a scheduled downtime of
          the service </div>
        <div><br>
        </div>
        <div>Thanks again, Massimo</div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2017-03-28 5:24 GMT+02:00 Fei Long Wang
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:feilong@catalyst.net.nz" target="_blank">feilong@catalyst.net.nz</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <p>Hi Massimo,</p>
              <p>Though I don't have experience on the migration, but as
                the glance RBD driver maintainer and image service
                maintainer of our public cloud (Catalyst Cloud based in
                NZ), I'm happy to provide some information. Before I
                talk more, would you mind sharing some information of
                your environment?</p>
              <p>1. Are you using CoW of Ceph?</p>
              <p>2. Are you using multi locations?  <br>
              </p>
              <pre>show_multiple_locations=True</pre>
              <p>3. Are you expecting to migrate all the images in a
                maintenance time window or you want to keep the glance
                service running for end user during the migration?</p>
              <p>4. Is it a public cloud?<br>
              </p>
              <div>
                <div class="h5">
                  <p><br>
                  </p>
                  <div class="m_2459035156914114560moz-cite-prefix">On
                    25/03/17 04:55, Massimo Sgaravatto wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div dir="ltr">
                      <div>Hi</div>
                      <div><br>
                      </div>
                      <div>In our Mitaka cloud we are currently using
                        Gluster as storage backend for Glance and
                        Cinder.</div>
                      <div>We are now starting the migration to ceph:
                        the idea is then to dismiss gluster when we have
                        done.</div>
                      <div><br>
                      </div>
                      <div>I have a question concerning Glance. </div>
                      <div><br>
                      </div>
                      <div>I have understood (or at least I hope so) how
                        to add ceph as store backend for Glance so that
                        new images will use ceph while the previously
                        created ones on the file backend will be still
                        usable.</div>
                      <div><br>
                      </div>
                      <div>My question is how I can migrate the images
                        from the file backend to ceph when I decide to
                        dismiss the gluster based storage.</div>
                      <div><br>
                      </div>
                      <div>The only documentation I found is this one:</div>
                      <div><br>
                      </div>
                      <a moz-do-not-send="true"
href="https://dmsimard.com/2015/07/18/migrating-glance-images-to-a-different-backend/"
                        target="_blank">https://dmsimard.com/2015/07/<wbr>18/migrating-glance-images-to-<wbr>a-different-backend/</a><br>
                      <div><br>
                      </div>
                      <div><br>
                      </div>
                      <div>Could you please confirm that there aren't
                        other better (simpler) approaches for such image
                        migration ?</div>
                      <div><br>
                      </div>
                      <div>Thanks, Massimo</div>
                    </div>
                    <br>
                    <fieldset
                      class="m_2459035156914114560mimeAttachmentHeader"></fieldset>
                    <br>
                  </div>
                </div>
                <span class="">
                  <pre>______________________________<wbr>_________________
OpenStack-operators mailing list
<a moz-do-not-send="true" class="m_2459035156914114560moz-txt-link-abbreviated" href="mailto:OpenStack-operators@lists.openstack.org" target="_blank">OpenStack-operators@lists.<wbr>openstack.org</a>
<a moz-do-not-send="true" class="m_2459035156914114560moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-operators</a>
</pre>
    </span></blockquote><span class="HOEnZb"><font color="#888888">
    

    <pre class="m_2459035156914114560moz-signature" cols="72">-- 
Cheers & Best regards,
Feilong Wang (王飞龙)
------------------------------<wbr>------------------------------<wbr>--------------
Senior Cloud Software Engineer
Tel: <a moz-do-not-send="true" href="tel:+64%204-803%202246" value="+6448032246" target="_blank">+64-48032246</a>
Email: <a moz-do-not-send="true" class="m_2459035156914114560moz-txt-link-abbreviated" href="mailto:flwang@catalyst.net.nz" target="_blank">flwang@catalyst.net.nz</a>
Catalyst IT Limited
Level 6, Catalyst House, 150 Willis Street, Wellington
------------------------------<wbr>------------------------------<wbr>-------------- </pre>
  </font></span></div>


______________________________<wbr>_________________

OpenStack-operators mailing list

<a moz-do-not-send="true" href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.<wbr>openstack.org</a>

<a moz-do-not-send="true" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-operators</a>


</blockquote></div>
</div>



</blockquote>
<pre class="moz-signature" cols="72">-- 
Cheers & Best regards,
Feilong Wang (王飞龙)
--------------------------------------------------------------------------
Senior Cloud Software Engineer
Tel: +64-48032246
Email: <a class="moz-txt-link-abbreviated" href="mailto:flwang@catalyst.net.nz">flwang@catalyst.net.nz</a>
Catalyst IT Limited
Level 6, Catalyst House, 150 Willis Street, Wellington
-------------------------------------------------------------------------- </pre></body></html>