# Disallow locking VMs

**URL:** <https://forum.opennebula.io/t/disallow-locking-vms/12357>\
**Category:** Product Support\
**Created:** [August 26, 2024, 9:09am UTC](https://forum.opennebula.io/t/disallow-locking-vms/12357 "2024-08-26T09:09:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yenya](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/yenya/32/4624_2.png) [@Yenya](https://forum.opennebula.io/u/Yenya)\
**Post date:** [August 26, 2024, 9:09am UTC](https://forum.opennebula.io/t/disallow-locking-vms/12357/1 "2024-08-26T09:09:48Z")

</div>

In Sunstone, ordinary users can click on a “Lock” icon in the VM tab, and make the VM in question locked. Such VM cannot be live-migrated to another host, which complicates the infrastructure maintenance (I don’t want to reboot a host with running qemu processes, of course).

Can the “Lock” feature be disabled for ordinary users?

There are other features which complicate the infrastructure maintenance as well - for a cluster based on Ceph datastores, using Shutdown instead of Undeploy does not make sense, for example, as shut down VMs block a capacity on their host. The same is for Stop and Suspend. In short, I don’t want my users to do anything which would prevent the physical host maintenance.

Thanks!

---

<div class="post-metadata">

**Author:** ![pczerny](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/pczerny/32/6224_2.png) [@pczerny](https://forum.opennebula.io/u/pczerny)\
**Post date:** [August 30, 2024, 9:15pm UTC](https://forum.opennebula.io/t/disallow-locking-vms/12357/2 "2024-08-30T21:15:41Z")

</div>

Hello Yenya,  
you can’t disable the `lock` action, but you can hide buttons in [Sunstone view](https://docs.opennebula.io/6.8/management_and_operations/users_groups_management/sunstone_views.html#suns-views)  
For default configuration, look in `/etc/one/sunstone-views/mixed/user.yaml`, search for

```auto
      VM.lockU: true
      VM.unlock: true
      VM.poweroff: true
      VM.poweroff_hard: true
      VM.suspend: true

```

Change the values to `false` to hide buttons. To apply changes restart the Sunstone.

The user can still lock the VM from the command line.

---

<div class="post-metadata">

**Author:** ![Yenya](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/yenya/32/4624_2.png) [@Yenya](https://forum.opennebula.io/u/Yenya)\
**Post date:** [September 18, 2024, 1:36pm UTC](https://forum.opennebula.io/t/disallow-locking-vms/12357/3 "2024-09-18T13:36:46Z")

</div>

Hello, Pavel!

Thanks for the hint, it works for me (and sorry for the late reply).

-Yenya
