<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">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><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><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><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_"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><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><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"><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>______________________________<wbr>_________________<br>
Mailing list: <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack</a><br>
Post to     : <a href="mailto:openstack@lists.openstack.org">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/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack</a><br>
<br></blockquote><div><br></div><div>regards,</div><div>Matt </div></div><br></div></div>