Home / Veeam / How to use Veeam with custom VM attributes

How to use Veeam with custom VM attributes

Introduction

Today i’m writing about a Veeam feature which i haven’t seen a lot out in the field. In my opinion, you can use this feature to easily sort and evaluate the backup state of virtual machines backed up with Veeam Backup & Replication.

During the creation of a Veeam Backup Job, you are able to edit the notification settings. There is also a checkbox stating “Set successful backup details to this VM attribute”. If you select the checkbox, Veeam will write information about successfully performed backup and backup results to a VM attribute. You can either use an existing attribute like “Notes” or define a new attribute suited for your needs.

custom_attributes

In my case i only selected the “Set successful backup details to this VM attribute”. In this scenario, Veeam will create a new custom attribute called “VEEAM BACKUP” which will get filled with successful reports of a VM backup. If you also select “Append to the existing attributes’s value” Veeam will keep the values which have been added to that attribute. If you do not select this option, Veeam will overwrite the existing attribute value.

Testing Scenario

Since i’d like to show you some scenarios, i have set up a Veeam backup job with two virtual machines on which we are testing the custom attributes.

backup_job_vms

I’ve set up the notification settings for this backup job with the custom attribute as shown in this image

Advanced_Settings


In my scenario, Veeam will do the following

  • Create a custom attribute called “VEEAM BACKUP”
  • Fill the value of this attribute with information regarding a successful backup
  • Veeam will overwrite the value, each time a successful backup has been made

After a successful run of my newly created backup job, i can review the attribute within the VMware vSphere Client. The look and feel of a custom attribute in the vSphere Web Client is not the best, but quite good for a quick lookup if the VM has been backed up.

Without checking any events or consulting the Backup Administrator, you are quickly able to see if the VM has been backed up.

But to unleash the full power of this feature, we are going deeper into the PowerCLI!

The PowerCLI way

First of all, start a PowerCLI and connect to your vCenter Server. We are now going trough some basics

You can now see if Veeam created the new “VEEAM BACKUP” custom attribute with the following command.

get_custom_attribute

If you want to see the annotation of this custom attribute regarding our freshly backed up VM, consider the following command.

To tidy up some unneeded parameters, go for the following command. This one will give you only the name of the virtual machine and the value of your custom attribute.

get_annotation_details

If you replace the virtual machine names with a wildcard, you will get all virtual machines with this Custom Attribute and its value. This command would be useful to check, if all virtual machines have a value and therefore have been backed up.

get_annotation_of_all_vms

But this command would not be useful in big environments. Therefore you should use something which gives you all virtual machines which have not any value in the custom attribute. Due to an empty value, you can be sure, that there was no backup for this virtual machine. In this case, you can use the following command.

get_annotation_of_all_vms_with_missing_value

In my scenario, there are two virtual machines, which have not been backed up.

Conclusion

When Assuming, that you have set up all Veeam backup jobs to write a value to a custom attribute, you can easily get the state of all virtual machines via PowerCLI.

This does not replace any monitoring or reporting solution such as Veeam ONE, but indeed it is very straight forward to get what you need. I just wanted to show you a quick way on how to manage the backup state of your virtual machines.

For example, you could export my commands above into a .csv file. After doing so, you could schedule the command for collecting the “backup state” of your virtual machines.

I hope i could maybe give you some arguments why you could be thinking about using this feature 🙂

Thanks for reading and have a nice day !


Check Also

splunk_veeam

Monitoring Veeam Backup & Replication with Splunk – Part 3 Getting Veeam Data into Splunk

This final part of the series now covers on how to set up the universal …

Leave a Reply

Your email address will not be published. Required fields are marked *