Start a Conversation

Unsolved

This post is more than 5 years old

16147

November 8th, 2017 05:00

Clearing up old VMs in avamar

My client has alot of virtual machines which are backed up daily..... We are using avamar 7.4

In Administration we see alot of VMs which are GREY....and the note says "VM is no longer addressable through vCenter"

From the CLI, how do we identify these VM clients and either retire or delete them???

thanks!

2K Posts

March 22nd, 2021 08:00

Modifying accounts with avmgr -- especially VM accounts -- is not a safe operation. I strongly recommend against using avmgr to make any changes to a system in a scripted way.

I would not recommend using mccli for new projects. The MC REST API is a better option in almost every way.

17 Posts

March 30th, 2021 05:00

For some obscure reason not discovered by the support yet, since we upgraded to 19.1 RESTAPI doesn't work in our environment. We use vcloud to communicate the old way to the vcenters.

But good news, proxycp.jar has been replaced (not officially but it will come) by goav

2K Posts

March 30th, 2021 08:00

Just to clarify, there are two REST APIs.

There is a legacy "Concerto" REST API that was designed for things like pooling Avamar systems together. This API is deprecated.

The MC REST API is the API that underpins the HTML5 "AUI" interface. I'm not sure if you're using the legacy Java GUI or AUI but if you're using AUI, the MC REST API has to be working. This is the API I recommend using for new projects.

17 Posts

March 30th, 2021 08:00

Oh sorry I forgot the link to GoAv : ftp://avamar_ftp:anonymous@ftp.avamar.com/software/scripts/goav

1 Rookie

 • 

20.4K Posts

May 3rd, 2021 20:00

Unfortunately, there is no API call right now to list VMs that are no longer in vCenter.  I talked to support who checked with engineering on that.  So I just submitted an RFE to add that attribute somewhere in client properties. 

17 Posts

August 19th, 2021 05:00

I changed my script to get rid of the .jar software that are not compatible anymore with Avamar 19.3+.
Actually to get a list of servers to get rid of, our sysadmin team rename the vm with "nepasrallumer" which translates to "donotpoweron". They keep the VM like that 3 weeks before deleting it, which is a very convenient way for me until they give us another tool to detect vms deleted from the vcenters.

Please note you have to replace dollar with $ since this forum doesn't accept the dollar1 with the $.

 

###get vcenters list without any duplicate
echo "Creating vcenters list..."
mccli domain show --recursive=true | grep '/VMware/' | awk '{print $2}' | awk '!a[$0]++' > retire.clients.vcenters.list
###create a list of deleted vm to retire
echo "Creating a list of deleted vms from vmware disks to retire..."
###list "nepasrallumer" vms
for i in $(cat retire.clients.vcenters.list); do mccli client show --domain=$i | awk '{print $2 "/" dollar1}' | grep nepasrallumer >retire.clients.list;done
###retire "nepasrallumer" vms
echo retire nepasrallumer...
for i in $(cat retire.clients.list); do mccli client retire --name=$i --force=yes; done
###list clients with no contact since 30 days
echo clients without checkin in the las 30 days
psql -p 5555 -U admin mcdb -c "SELECT full_domain_name, checkin_ts FROM v_clients where (checkin_ts < (SELECT current_date - INTERVAL '30 DAY') AND checkin_ts > '1970-01-01') ORDER BY full_domain_name;" | grep '/clients' | awk '{print dollar1}'>retire.clients.retired.list
###retire clients with no contact since 30 days
echo retire clients with no contact since 30 days
for i in $(cat retire.clients.retired.list); do mccli client retire $i; done
###delete retired clients with no backups attached
echo delete retired clients with no backups attached
for client in `mccli client show --domain=/MC_RETIRED --xml | grep "Client\>" | sed 's///' | sed 's/<\/Client>//'`;do if [ ! `mccli backup show --domain=/MC_RETIRED --name="$client" | grep "^[0-9][0-9][0-9][0-9]-" | wc -l` -gt "0" ];then mccli client delete --domain=/MC_RETIRED --name="$client";fi;done

 

 



1 Message

September 24th, 2021 05:00

How to build a script to bulk retire clients
For Container Clients:
1. Within Avamar administrator/ Policy gui, choose the clients tab and expand the vcenter of choice and select Container Clients to display all the clients in the right pane.
2. Highlight all clients that no longer register in VMware (greyed out) and select Edit so that you can modify ‘Backup disabled’ field to Yes. You will have to also select apply change in the left column and select OK.
3. Refresh the screen and sort the list by the Backups Disabled column. Quickly verify that no “Blue” clients are in the list of "greyed out" clients which are now disabled. Highlight all clients that are greyed out with Backups Disabled = Yes and use ctrl+c to copy the selection into notepad.

WHEN YOU COPY THIS WAY IT WILL INCLUDE THE UNIQUE CLIENT SID
4. Open note in excel using the import wizard.
5. Cut and paste the column containing the path into a new column, left of the client/SID name column (Cut column D and paste left of column A)
6. Add a new 'A' column and copy and paste the following "mccli client retire --name="
7. Remove all columns to the right of the client/SID column.
8. Copy and paste the following into newly emptied column to the right of the client/SID column: "--expiration= --retire-child-vms --force=TRUE"
The date should reflect a future date based upon your specific retention and follow the format yyyy-mm-dd
9. Save file and open in notepad for final editing.
10. Remove all extraneous spaces and tabs with the find/replace tool so that it looks like the example below.

I've been unable to execute this as a script, but just copy and paste into the CLI and let it churn. 

mccli client retire --name=/esocpowvcs.washdc.state.sbu/ContainerClients/BIMCWASDAZAP03_65woX04zNKqdIdVQes8aDg --expiration=2021-10-06 --retire-child-vms --force=TRUE

No Events found!

Top