Highlighted

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!

Reply
11 Replies
Highlighted

Re: Clearing up old VMs in avamar

CLI command "mccli vmchache show --name=" will list if a VM client is deleted from vCenter or not.

CLI command "mccli client delete --name=" or "mccli client retire -name=" are the commands to remove them.

There is probably a solution to automate what your trying to do with custom bash scripting.

Reply
Highlighted

Re: Clearing up old VMs in avamar

thanks for the information but I'm assuming that there isnt a command to show VMs that arent addressable to vcenter?

If the client deletes alot of VM's then it seems we can only delete them manually.

Reply
Highlighted
7 Thorium

Re: Clearing up old VMs in avamar

Mike,

I used these utilities to automate retirement of deleted VMs:

  • List deleted VMs

java -jar proxycp.jar --listdeletedvms --vc myvcenter.company.com  >>retire.clients.list

  • Retire VMs using the file from previous command

java -jar av2ool.jar client retire --filename retire.clients.list



Reply
Highlighted

Re: Clearing up old VMs in avamar

many thanks. Useful info!

Reply
Highlighted
1 Copper

Re: Clearing up old VMs in avamar

dynamox,

Where can I download av2ool.jar file from? Or is there any other better ways to retire VM clients automatically once they are deleted from the vCenter. 

Reply
Highlighted
7 Thorium

Re: Clearing up old VMs in avamar

Here you go

 

ftp://avamar_ftp:anonymous@ftp.avamar.com/software/scripts/av2ool.jar

Reply
Highlighted
1 Copper

Re: Clearing up old VMs in avamar

Hi,

I have done such a script.

Here we go :

### remove old lists
echo "Deleting old parameters files..."
rm retire.clients.list
rm retired.clients.list
rm delete.clients.list
rm Active.txt
###get vcenters list without any duplicate
echo "Creating vcenters list..."
mccli domain show --recursive=true | grep '/VMware/' | awk '{print $2}' | sed 's/\/VMware\///g' | awk '!a[$0]++' > vcenters.list
###create a list of deleted vm to retire cré une liste des vm effacees a retirer
echo "Creating a list of deleted vms from vmware disks to retire..."
echo "Connecting to Avamar vcenter cache..."
for i in $(cat vcenters.list); do java -jar proxycp.jar --listdeletedvms --vc $i | grep $i >>retire.clients.list; done
###proxycp ouptut garbage remove
cat retire.clients.list | grep VMware > retire.clients.clean.list
###list final items to retire and ask for confirmation
printf "\n\n\n"
echo "Here are the clients not on the vcenter disks anymore."
cat retire.clients.clean.list
echo "Do you wish to retire these clients ? If the list is empty, press 2."
select yn in "Yes" "No"; do
    case $yn in
        Yes ) java -jar av2ool.jar client retire --filename retire.clients.clean.list; break;;
        No ) echo "Ok no client retired";;
    esac
done
### list of vm retired without any data
echo "Creating a list of retired vm's with no data..."
mccli client show --domain=/MC_RETIRED | grep MC_RETIRED | awk '{print $1}' >>retired.clients.list
### get retired vm's backup list
for i in $(cat retired.clients.list)
do
        mccli backup show --domain=/MC_RETIRED --name=$i | grep Active >Active.txt
        if grep -q Active Active.txt
        then
                echo $i "has still data"
        else
                echo $i >>delete.clients.list
        fi
done
### remove retired vm's with no backups anymore
printf "\n\n\n"
echo "Here are the retired vms without any data left on Avamar server."
cat delete.clients.list
echo "Do you wish to delete these retired clients with no backup data ? If list is empty press 2."
select yn in "Yes" "No"; do
    case $yn in
        Yes ) for i in $(cat delete.clients.list);do mccli client delete --name=$i --domain=MC_RETIRED;done; break;;
        No ) echo "Ok no client deleted";;
    esac
done

 

Reply
Highlighted
1 Copper

Re: Clearing up old VMs in avamar

Hi,

 

Thanks for those information.

I work on something similar. I have already a script that delete retired client.

But I work on case of deleted client in VMware. On VMware, I have a use case that seems delete an existing VM. I didn't test because it's a production one.

Like a cloud, users have a selfcare on our VMware environment. And someome delete a VM and recreate a new with the same name. We do that sometimes to upgrade or redeploy and appliance.

In this case, a users recreate a VM with the same name. So avamar have two entries in mccli client show.

admin@avamar:~/>: mccli client show --domain=/vcenter/PROD/ --recursive=true --verbose=true > VMPROD.txt
admin@avamar:~/>: grep server1 VMPROD.txt
server1/vcenter/PROD Virtual Machine N/A Yes N/A No overtime allowed No High No Default Retention No N/A N/A N/A N/A N/A 2019-12-06 11:25:42 CET N/A 2020-01-06 01:32:43 CET N/A Yes Yes No
server1 /vcenter/PROD Virtual Machine N/A Yes N/A No overtime allowed No High No Default Retention No N/A N/A N/A N/A N/A 2019-07-17 00:00:00 CEST N/A 2019-12-05 22:29:11 CET N/A Yes Yes No
admin@avamar:~/>: mccli vmcache sync --domain=/vcenter/ --name=vcenter --recursive=true --showresult=true > DeletedVM.txt
admin@avamar:~/>: grep server1 DeletedVM.txt
server1 VMachine 50210d83-0028-653e-52d8-d4f1a336d00c N/A <unset> N/A N/A <unset> <unset> Yes N/A N/A N/A 0
server1 VMachine 502133e9-83ec-2b25-a5f3-62efabd876dd vmx-11 10.0.10.200 /DCname esx51 <unset> /DCname/vm/server1 No POWERED_ON group-v3 Resources 2

And when I specify the client name, I have only the active one.

admin@avamar:~/>: mccli client show --name=/vcenter/PROD/server1
0,23000,CLI command completed successfully.
Attribute                Value
------------------------ -----------------------------------------------------
Client Name              server1
Fully Qualified Name     /vcenter/PROD/server1_KpejAiBuPgmggd0UlxMAwQ
Client Type              Virtual Machine
Operating System         other3xLinux64Guest
Paging                   No
CID                      1546a70f192a7842351bd9430bf20d322bf921d6
CID Assigned             2019-12-06 11:25:42 CET
Disabled                 No
Agent Last Started       2020-01-06 01:32:43 CET
Override Group Retention No
Retention Policy         Default Retention
Overtime Option          No overtime allowed
Restore Only             No
Avamar encryption method High
Override Encryption      No
Allow CIS                Yes
Allow CIS file selection Yes
Override CIS retention   No
Browse Timeout           10 seconds
Contact Name             N/A
Contact Phone            N/A
Contact Email            N/A
Contact Location         N/A
Contact Notes            N/A
Member of Group          /vcenter/PROD/VM_PROD
Member of Group          /vcenter/Default Virtual Machine Group
Plugin                   Linux VMware Image(1016)
Initial Install Date     2019-12-06 11:25:42 CET
Last Version Registered  2019-12-06 11:25:42 CET
Last Successful Backup   N/A

 

Any idea?

 

Regards,

Reply
1 Copper

Re: Clearing up old VMs in avamar

Yes I have the same. They redeploy some vm frequently. But for Avamar the vm gets a new cid therefore is seen as a new client. You can still recover data from the old client, but the old one should be retired. 

Reply