Skip to main content
Solved

Restore VM with original affinity rule

  • Jun 12, 2025 10:48 AM UTC
  • 5 comments
  • 84 views

Marcel.K
Forum|alt.badge.img+13

Hello,

we have VMs on VMware platform.

During VM restore they are removed from affinity rule from cluster level like host rule “should run” or “separate VM”. So in case A side is down is switched into side B and like proxy servers they cannot be 2 on the same esx host, so there is rule separate.

As far as i know, only vSphere tags are restore.

Is there any option how to restore these rules as well?

thank you

Best answer by CMF

Hi ​@Marcel.K ,

as far as i know there is no way of automating this within veeam. What could be tried to run a script afterwards against the vCenter to group VMs, maybe by vsphere tagg, into the DRS rules they need to get in.

If you have the script you can run it for example every evening as a sheduled task. Then max on Day 2 after restoring everything should be back to normal. 

 

Regards

Chalid

I found an article that describes the way to do it via powercli. Maybe its worth a try.

https://rudimartinsen.com/2017/09/08/automating-drs-groups-with-powercli/ 

View original

5 comments

CMF
Forum|alt.badge.img+8
  • Veeam Legend
  • Jun 12, 2025 10:57 AM UTC

Hi ​@Marcel.K ,

as far as i know there is no way of automating this within veeam. What could be tried to run a script afterwards against the vCenter to group VMs, maybe by vsphere tagg, into the DRS rules they need to get in.

If you have the script you can run it for example every evening as a sheduled task. Then max on Day 2 after restoring everything should be back to normal. 

 

Regards

Chalid


Tommy O'Shea
Forum|alt.badge.img+5
  • Veeam Legend
  • Jun 12, 2025 11:03 AM UTC

Wow, that's a good catch. I think that kind of rule should definitely be kept and optionally restored. This would be good as a feature request. 


Dynamic
Forum|alt.badge.img+16
  • Veeam Vanguard
  • Jun 12, 2025 11:05 AM UTC

Good point.. as every VM is recognized in Veeam by its MoRef ID and when you create a VM from a restore, this VM would receive a new MoRef ID - your Rule will not automatically find this VM.

I like the idea from Chalid. 👍

Another option could be a manual edit of the MoRef within the vCenter Database. But this would end up in an overkill - and also in other problems if the original VM is still in place (even with another name). Also this is not a supported way to go...

 

 
 

 

 


Chris.Childerhose
Forum|alt.badge.img+23

If I were to guess the MorefID somehow changes so the rule does not recognize the "same" VM and you need to edit your rules.  Automation is not possible for this when restoring.


CMF
Forum|alt.badge.img+8
  • Veeam Legend
  • Answer
  • Jun 12, 2025 11:12 AM UTC

Hi ​@Marcel.K ,

as far as i know there is no way of automating this within veeam. What could be tried to run a script afterwards against the vCenter to group VMs, maybe by vsphere tagg, into the DRS rules they need to get in.

If you have the script you can run it for example every evening as a sheduled task. Then max on Day 2 after restoring everything should be back to normal. 

 

Regards

Chalid

I found an article that describes the way to do it via powercli. Maybe its worth a try.

https://rudimartinsen.com/2017/09/08/automating-drs-groups-with-powercli/