# Select which VM should be HA

**URL:** <https://forum.opennebula.io/t/select-which-vm-should-be-ha/3864>\
**Category:** Product Support\
**Created:** [February 23, 2017, 8:40am UTC](https://forum.opennebula.io/t/select-which-vm-should-be-ha/3864 "2017-02-23T08:40:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emot](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@emot](https://forum.opennebula.io/u/emot)\
**Post date:** [February 23, 2017, 8:40am UTC](https://forum.opennebula.io/t/select-which-vm-should-be-ha/3864/1 "2017-02-23T08:40:27Z")

</div>

Hi,

Is there a way to select which VM should be HA and migrated to another host in case of a host failure?

We don’t need ALL the vm to be HA, just some.

Thanks!  
em

---

<div class="post-metadata">

**Author:** ![jmelis](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/jmelis/32/24_2.png) [@jmelis](https://forum.opennebula.io/u/jmelis)\
**Post date:** [February 23, 2017, 3:02pm UTC](https://forum.opennebula.io/t/select-which-vm-should-be-ha/3864/2 "2017-02-23T15:02:42Z")

</div>

Yes, this is handled by a hook: [https://github.com/OpenNebula/one/blob/master/share/hooks/host\_error.rb](https://github.com/OpenNebula/one/blob/master/share/hooks/host_error.rb)

You can edit it to fit your needs. For instance to accomplish what you say you could add something like

```
if !vm["TEMPLATE/DO_MIGRATE"] == "YES"
  next
end

```

around line 252.
