[racktables-users] Re: Mass Tag servers

  • From: Jonathan Poole <jpoole@xxxxxxxxxxxxx>
  • To: "Tyler J. Wagner" <tyler@xxxxxxxxxxx>
  • Date: Fri, 31 Aug 2012 10:24:19 -0400

Beauty, worked like a charm.

Thanks Tyler!


On 8/31/12 10:21 AM, "Tyler J. Wagner" <tyler@xxxxxxxxxxx> wrote:

>I'd do that, but instead of copying the table, I'd just run a mysqldump
>beforehand. If any issues, immediately restore. If no issues, run a second
>mysqldump and diff them to make sure there are no issues.
>
>Regards,
>Tyler
>
>On 2012-08-31 15:08, Jonathan Poole wrote:
>> Well, 
>> 
>> Let me run this by you and see if you can spot any potential issuesŠ
>> 
>> Looking at TagStorage and Tagtree, lets just for instance say I want to
>> set these 450 plus objects with a tagid of 2.
>> 
>> First I would need to select all objects that have a common name
>> like('%foo-bar%').
>> Second, to be cautious, I would then copy TagStorage to TagStorage2
>>(make
>> a backup the table, or entire database since it's quite small
>>currently).
>> 
>> Then do a mass insert into TagStorage VALUES ('object',123,2) along with
>> the current values in this table.
>> 
>> Let me know, 
>> 
>> Appreciate the input as well.
>> 
>> Regards, 
>> Jonathan D. Poole
>> 
>> 
>> 
>> 
>> On 8/31/12 9:54 AM, "Tyler J. Wagner" <tyler@xxxxxxxxxxx> wrote:
>> 
>>> On 2012-08-31 14:21, Jonathan Poole wrote:
>>>> I have about 450 servers I want to tag.  These servers have a similar
>>>> naming convention of foo-bar001 to foo-bar450.  Is there a way to mass
>>>> tag
>>>> all of these machines without tagging any other machines at the same
>>>> time?
>>>
>>> As far as I am aware, no.
>>>
>>> When asked "how do I perform a mass change in Racktables", I usually
>>> answer
>>> "use MySQL statements". phpmyadmin is your friend.
>>>
>>> Regards,
>>> Tyler
>>>
>>> -- 
>>> "Copyright is a bargain, not property. We agreed not to copy because
>>> they agreed it would only be for a short period of time. They have
>>>broken
>>> their end of the bargain; we are now breaking ours."
>>>   -- Russell Nelson
>> 
>> 
>
>-- 
>"There were 183 of us freshmen, and a bowling ball hanging from the
>three-story ceiling to just above the floor. [Richard] Feynman walked
>in and, without a word, grabbed the ball and backed against the wall
>with the ball touching his nose. He let go, and the ball swung slowly
>60 feet across the room and back -- stopping naturally just short of
>crushing his face. Then he took the ball again, stepped forward, and said:
>'I wanted to show you that I believe in what I'm going to teach you over
>the next two years.'"
>   -- Michael Scott, first CEO of Apple Computer



Other related posts: