<div dir="ltr">You welcome, and thank you for bringing it to our attention. Thanks to you, the next release will have the set_weight usage corrected:<div><br></div><div>  <a href="https://bugs.launchpad.net/swift/+bug/1660214">https://bugs.launchpad.net/swift/+bug/1660214</a></div><div><br></div><div>Regards,</div><div>Matt</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 30, 2017 at 7:25 PM, Alexandr Porunov <span dir="ltr"><<a href="mailto:alexandr.porunov@gmail.com" target="_blank">alexandr.porunov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello Matt,</div><div><br></div><div>Thank you very much for your help! It's awesome. Now everything works!</div><div><br></div><div>Best regards,</div><div>Alexandr</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 30, 2017 at 12:48 AM, Matthew Oliver <span dir="ltr"><<a href="mailto:matt@oliver.net.au" target="_blank">matt@oliver.net.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Alexandr,<div><br></div><div>Thanks for the email. I can help you in this instance, and I'll push up a patch to correct the usage documentation for the long version of the set_weight command.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span>On Sun, Jan 29, 2017 at 8:33 AM, Alexandr Porunov <span dir="ltr"><<a href="mailto:alexandr.porunov@gmail.com" target="_blank">alexandr.porunov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,<br></div><div><br></div><div>I can't change a weight of the device.</div><div>Here is a list of my devices:</div><div><br></div><div>Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta</div><div>             0       1     1           host1  6000           host1              6000        d1 1000.00       1024    0.00 bla bla1 bla2</div><div>             1       1     1           host1  6000           host1              6000        d2 1000.00       1024    0.00 bla bla1 bla2</div><div>             2       1     1           host1  6000           host1              6000        d3 1000.00       1024    0.00 bla bla1 bla2</div><div><br></div><div>Here is what I tried to change a weight:</div><div>swift-ring-builder object.builder set_weight --region 1 --zone 1 --ip host1 --port 6000 --replication-ip host1 --replication-port 6000 --device d1 --meta "bla bla1 bla2" --weight 1000</div></div></blockquote><div><br></div></span><div>There is a problem with the command as you've sent it. But I agree it isn't obvious from the usage error. Using the long form (--region, --device, etc) is just defining search criteria for what you want to change. Not specifying what you want to change.</div><div><br></div><div>So in your case above your looking for a device that already has a weight of 1000, and your not specifying what the change it to. To fix your command, you'd need to:</div><div><br></div><div>  swift-ring-builder object.builder set_weight --region 1 --zone 1 --ip host1 --port 6000 --replication-ip host1 --replication-port 6000 --device d1 --meta "bla bla1 bla2" --weight 1024 1000</div><div><br></div><div>NOTE: I am sending in the 1000 as the last option. Obviously as these are search terms you don't actually have to send them all in, only the ones that identify the devices or device you want to change.</div><span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>swift-ring-builder object.builder set_weight r1z1-host1:6000Rhost1:6000 d1_"bla bla1 bla2" 2000</div></div></blockquote><div><br></div></span><div>The short version above is failing, as you forgot to add the '/' seperator between the port and the device, given your example it should have been:</div><div><br></div><div>    swift-ring-builder object.builder set_weight r1z1-host1:6000Rhost1:6000/d1_<wbr>"bla bla1 bla2" 2000</div><div><br></div><div>NOTE: the '/' before the d1.</div><div><br></div><div>What your putting in there is just a search for devices to change. You don't have to put the full string in. I guess if you have a tool that will use the full definition then fine. I find when wanting to update just 1 host it's easier to do so via the device id:</div><div><br></div><div>  swift-ring-builder set_weight d1 2000</div><span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>In both cases it doesn't work and shows the next information:</div><div><br></div><div>swift-ring-builder <builder_file> set_weight <search-value> <weight>                                                                 </div><div>    [<search-value> <weight] ...                                                                                                     </div><div>    [--yes]                                                                                                                          </div><div>                                                                                                                                     </div><div>or                                                                                                                                   </div><div>                                                                                                                                     </div><div>swift-ring-builder <builder_file> set_weight                                                                                         </div><div>    --region <region> --zone <zone> --ip <ip or hostname> --port <port>                                                              </div><div>    --replication-ip <r_ip or r_hostname> --replication-port <r_port>                                                                </div><div>    --device <device_name> --meta <meta> --weight <weight>                                                                           </div><div>    [--yes]                                                                                                                          </div><div></div></div></blockquote><div><br></div></span><div>This usage isn't been very useful here, as it's missing the actual adding the weight. I'll raise a bug and patch to address this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span><div dir="ltr"><div>                                                                                                                                     </div><div>    Where <r_ip>, <r_hostname> and <r_port> are replication ip, hostname                                                             </div><div>    and port.                                                                                                                        </div><div>    Any of the options are optional in both cases.                                                                                   </div><div>                                                                                                                                     </div><div>    Resets the devices' weights. No partitions will be reassigned to or from                                                         </div><div>    the device until after running 'rebalance'. This is so you can make                                                              </div><div>    multiple device changes and rebalance them all just once.                                                                        </div><div>                                                                                                                                     </div><div>    Option --yes assume a yes response to all questions.</div><div><br></div><div><br></div><div>Please, correct me if it is my fault.</div><div><br></div><div>Best regards,</div><div>Alexandr</div></div>
<br></span>______________________________<wbr>_________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a><br>
Unsubscribe : <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi<wbr>-bin/mailman/listinfo/openstac<wbr>k</a><br>
<br></blockquote><div><br></div><div>regards,</div><div>Matt </div></div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>