5 Replies Latest reply on May 5, 2018 10:51 AM by yikching

    one command to free up space in /storage/seat

    trogne Novice

      I was trying to free up space in '/storage/seat on my vcsa 6.5

       

      This is not applicable for 6.5 :

      vCenter Server Appliance 6.0 services fail due to 100% usage of /storage/seat disk (2119809) | VMware KB

       

      I don't have "vpx_event" and "vpx_event_arg" table.

      Instead I have "vpx_event_1" to "vpx_event_92", and "vpx_event_arg_1" to "vpx_event_arg_92".

       

      So I ran "truncate table vpx_event_1 cascade;" for each "event" tables (184 tables!).

       

      /storage/seat/ was back to 1%.

       

      But there's also this command :

      sudo -u postgres /opt/vmware/vpostgres/9.4/bin/vacuumdb -a -e -v -f -U postgres > /tmp/vacuumdb.log

       

      (as suggested at the bottom of this article : http://www.settlersoman.com/how-to-reclaim-space-on-storageseat-in-vcenter-appliance-5-5-or-6-x/ )

       

      But I don't have a "postgres" user. Is that ok ?

       

      So I tried that :

      sudo -u root /opt/vmware/vpostgres/9.4/bin/vacuumdb -a -e -v -f -U postgres > /tmp/vacuumdb.log

       

      And entered the password returned by this command :

      cat /etc/vmware-vpx/embedded_db.cfg | grep

       

      But I don't see anything changed. Normal ?

       

      When I tried running it before the "truncate" , there was no change to "storage/seat" either.

       

       

       

      Thanks

        • 1. Re: one command to free up space in /storage/seat
          srodenburg Hot Shot
          vExpert

          I have the exact situation. KB Article 2119809  says it applies to VCSA 6.5 but it does not.

           

          Running the vacuum command just shits itself. It hangs after a couple of hours and remains frozen until I break it off. The result is "nothing happened". I have been succesfull with the truncate command but one really needs to go through all 184 tables.

          • 2. Re: one command to free up space in /storage/seat
            Chris_K Lurker
            VMware Employees

            Note that this should be addressed using one of the scripts attached to the following KB

             

            KB/2110031 - Selective deletion of tasks, events, and historical performance data in vSphere 5.x and 6.x

            • 3. Re: one command to free up space in /storage/seat
              dzak64 Novice

              I have the same issue. Tried using the script listed in the KB2110031 article. I saw no change in the /storage/set directory.

               

              /opt/vmware/vpostgres/current/bin/psql -U postgres -v TaskMaxAgeInDays=30 -v EventMaxAgeInDays=30 -v StatMaxAgeInDays=30 -d VCDB -t -q -f /tmp/2110031_Postgres_task_event_stat.sql

               

              Any other suggestions?

              • 4. Re: one command to free up space in /storage/seat
                marsherian Novice

                I ran into the same issue, I ended up manually resizing the volume:

                 

                PCLI:

                Get-VM vc-01 | get-HardDisk  |? Filename -like "*vc-02_7.vmdk"  | Set-HardDisk -CapacityGB 50

                 

                ssh root@vc-01

                service-control --stop --all

                umount /storage/seat/

                #Test physical volume resize

                pvresize --setphysicalvolumesize 50G -v -t /dev/sdh

                #resize the volume

                pvresize --setphysicalvolumesize 50G -v  /dev/sdh

                #resize the logical volume, probably left more room than needed.

                lvresize -L 48G -r -v  /dev/seat_vg/seat

                mount  /dev/seat_vg/seat

                df -h

                service-control --start --all

                • 5. Re: one command to free up space in /storage/seat
                  yikching Lurker

                  Apparently, the table structure in 6.5 is different from earlier versions.

                  Here is my psql used to loop thru the vpx_event_[numeric] tables and clear them out.

                   

                  DO

                  $$

                  DECLARE

                      rec   record;

                  BEGIN

                     FOR rec IN

                        SELECT *

                        FROM   pg_tables

                        WHERE tablename ~ '^vpx_event_[0-9].*'

                        ORDER  BY tablename

                     LOOP

                        EXECUTE 'TRUNCATE TABLE '

                          || quote_ident(rec.schemaname) || '.'

                          || quote_ident(rec.tablename) || ' CASCADE';

                     END LOOP;

                  END$$;

                   

                   

                  -The CASCADE command above should clear vpx_event_arg_[numeric] also, but sometimes it doesn't and following have to be used also.

                   

                  DO

                  $$

                  DECLARE

                      rec   record;

                  BEGIN

                     FOR rec IN

                        SELECT *

                        FROM   pg_tables

                        WHERE tablename ~ '^vpx_event_arg_[0-9].*'

                        ORDER  BY tablename

                     LOOP

                        EXECUTE 'TRUNCATE TABLE '

                          || quote_ident(rec.schemaname) || '.'

                          || quote_ident(rec.tablename) || ' CASCADE';

                     END LOOP;

                  END$$;

                   

                   

                  -For vaccumdb, here is the command I used after running the above.

                  /opt/vmware/vpostgres/current/bin/vacuumdb -a -e -v -f -U postgres > /tmp/vacuumdb.log