<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We've done something similar insofar as we've installed gluster with replica X on our controllers to share out the glace images volume between nodes.  Saves you having to rsync between nodes and supports proper HA. </div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Thomas Goirand <zigo@debian.org><br>
<b>Sent:</b> 06 January 2022 12:44<br>
<b>To:</b> º«¹âÓî <hanguangyu2@gmail.com>; openstack-discuss <openstack-discuss@lists.openstack.org><br>
<b>Cc:</b> hanguangyu@uniontech.com <hanguangyu@uniontech.com>; wangleic@uniontech.com <wangleic@uniontech.com><br>
<b>Subject:</b> Re: [glance] Does glance not support using local filesystem storage in a cluster</font>
<div> </div>
</div>
<div>CAUTION: This email originates from outside THG<br>
<br>
On 1/6/22 03:33, º«¹âÓî wrote:<br>
> Deal all,<br>
> <br>
> Sorry that maybe I ask a stupid question. But I'm really confused with<br>
> it and didn't find discuss in glance<br>
> document(<a href="https://docs.openstack.org/glance/latest">https://docs.openstack.org/glance/latest/</a>).<br>
> <br>
> I have a OpenStack Victoria cluster with three all-in-one node in<br>
> centos8. I implemented it with reference to<br>
> <a href="https://docs.openstack.org/ha-guide">
https://docs.openstack.org/ha-guide/</a>. So this cluster use Pacemaker,<br>
> HAproxy and Galera. "To implement high availability, run an instance<br>
> of the database on each controller node and use Galera Cluster to<br>
> provide replication between them."<br>
> <br>
> I found that I will encounter an error If I configure Glance backend<br>
> to use local storage driver to store image files on the local disk. If<br>
> I upload a image, this image only will be storaged in one node. But<br>
> the database only storage the file path of image such as<br>
> "/v2/images/aa3cbee0-717f-4699-8cca-61243302d693/file", don't have the<br>
> host information. The database data is same in three node.<br>
> <br>
> If I upload a image in node1, image only is storaged in node1. The<br>
> database of three node stores the local filesystem path of image. And<br>
> If The create Instance task is assigned to node2, It will find image<br>
> in node2, but image can't be found in node2. So we get the "Image has<br>
> no associated data" error.<br>
> <br>
> So I want to ask:<br>
> 1. Wheter glance does not support using local filesystem storage in a cluster?<br>
> 2. If 1 was right, why do we do this design instead of storing<br>
> information about the host on which images is located, as nova does<br>
> with instance.<br>
> <br>
> I would appreciate any kind of guidance or help.<br>
> <br>
> Thank you,<br>
> Han Guangyu<br>
> <br>
<br>
Hi ¹âÓî,<br>
<br>
It is possible to setup Glance with a local storage in a HA way.<br>
<br>
The way to do this, is simply to get your HAproxy to use one node, <br>
always, and the other as backups. Then have a cron job that does the <br>
rsync from the first node to the other 2. A simple command as Glance <br>
user like this is enough (to be run as Glance user, and having the ssh <br>
host keys thingy fixed (we sign host keys, so we don't have this problem)):<br>
<br>
rsync -e ssh -avz --delete /var/lib/glance/images/ \<br>
<dest-host>:/var/lib/glance/images/ >/dev/null 2>&1<br>
<br>
We have some internal logic to iterate through all the backup nodes and <br>
replace dest-host accordingly...<br>
<br>
This way, if the first node fails, yes, you do have a problem because <br>
there wont be the primary node that is up, so saving new Glance image <br>
will be a problem as it wont be replicated to other nodes. But existing <br>
image will be there already, so it ok until you repair the first node.<br>
<br>
I hope this helps,<br>
Cheers,<br>
<br>
Thomas Goirand (zigo)<br>
</div>
<div></div>
<p><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">Danny Webb</span>
<br>
<span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:black">Senior Linux Systems Administrator</span><br>
<span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:#019EEB"><a href="http://www.thehutgroup.com/" target="_blank"><span style="color:#575a5d;
text-decoration:none;text-underline:none">The Hut Group</span></a></span>
<br>
<br>
<span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:black">Tel: </span>
<br>
<span style="font-size:8.5pt;font-family:"Arial","sans-serif";color:black">Email:
<a href="mailto:Danny.Webb@thehutgroup.com">Danny.Webb@thehutgroup.com</a></span></p>
<p style="margin-bottom:12.0pt"><br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">For the purposes of this email, the "company" means The Hut Group Limited, a company registered in England and Wales (company number 6539496) whose registered office is at Fifth Floor,
 Voyager House, Chicago Avenue, Manchester Airport, M90 3DQ and/or any of its respective subsidiaries.</span>
<br>
<br>
<b><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">Confidentiality Notice</span></b>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">This e-mail is confidential and intended for the use of the named recipient only. If you are not the intended recipient please notify us by telephone immediately on +44(0)1606 811888
 or return it to us by e-mail. Please then delete it from your system and note that any use, dissemination, forwarding, printing or copying is strictly prohibited. Any views or opinions are solely those of the author and do not necessarily represent those of
 the company.</span> <br>
<br>
<b><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">Encryptions and Viruses</span></b>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">Please note that this e-mail and any attachments have not been encrypted. They may therefore be liable to be compromised. Please also note that it is your responsibility to scan this
 e-mail and any attachments for viruses. We do not, to the extent permitted by law, accept any liability (whether in contract, negligence or otherwise) for any virus infection and/or external compromise of security and/or confidentiality in relation to transmissions
 sent by e-mail.</span> <br>
<br>
<b><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">Monitoring</span></b>
<br>
<span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#666666">Activity and use of the company's systems is monitored to secure its effective use and operation and for other lawful business purposes. Communications using these systems will also
 be monitored and may be recorded to secure effective use and operation and for other lawful business purposes.</span>
</p>
<span style="font-size:4pt;color:#FFFFFF">hgvyjuv</span>
<div></div>
</body>
</html>