# Unexpected UID/GID Ownership Changes on OpenNebula Datastores by Hosts

**URL:** <https://forum.opennebula.io/t/unexpected-uid-gid-ownership-changes-on-opennebula-datastores-by-hosts/13980>\
**Category:** Bug Reporting\
**Created:** [July 11, 2025, 8:05am UTC](https://forum.opennebula.io/t/unexpected-uid-gid-ownership-changes-on-opennebula-datastores-by-hosts/13980 "2025-07-11T08:05:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rguntaka](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@rguntaka](https://forum.opennebula.io/u/rguntaka)\
**Post date:** [July 11, 2025, 8:05am UTC](https://forum.opennebula.io/t/unexpected-uid-gid-ownership-changes-on-opennebula-datastores-by-hosts/13980/1 "2025-07-11T08:05:48Z")

</div>

In our OpenNebula environment, we’ve noticed that some directories under `/var/lib/one/datastores/` are unexpectedly owned by UID and GID `1001`, instead of `oneadmin` (which has UID and GID `9869`). This appears to happen after interaction with some OpenNebula hosts—possibly during datastore mounting or file operations.

- **How could the ownership (UID/GID) of these directories be getting changed by the hosts?**
- **What is the best way to prevent this from happening again, ideally without causing major disruption to the current setup?**

Example output:

```auto
root@svl-opennebula1:~# ls -l /var/lib/one/datastores/
...
drwxr-xr-x 10 1001 1001 16384 Jul 10 05:33 1
...
drwxr-xr-x 3 1001 1001 4096 May 29 18:30 2

```

Expected ownership:

```auto
root@svl-opennebula1:~# id -u oneadmin
9869
root@svl-opennebula1:~# id -g oneadmin
9869

```

How can we resolve this ownership mismatch and prevent further issues, ideally without significant downtime?

---

<div class="post-metadata">

**Author:** ![brunorro](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/brunorro/32/7590_2.png) [@brunorro](https://forum.opennebula.io/u/brunorro)\
**Post date:** [July 11, 2025, 10:53am UTC](https://forum.opennebula.io/t/unexpected-uid-gid-ownership-changes-on-opennebula-datastores-by-hosts/13980/2 "2025-07-11T10:53:55Z")

</div>

In my experience, this happens because before the installation of the `opennebula-node` package a user oneadmin already exists and it has been created as a regular user, hence having a UID/GID \>= 1000

As soon as the `/var/lib/one` is writable and owned by the user oneadmin everything should be running OK. The best way to ensure that this does not happen is keeping track of the existing users before the installation of the nodes on them.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/1/14d66f1130b9cd292905f575da9b68a9f574dd03.png) [@system](https://forum.opennebula.io/u/system)\
**Post date:** [August 10, 2025, 10:54am UTC](https://forum.opennebula.io/t/unexpected-uid-gid-ownership-changes-on-opennebula-datastores-by-hosts/13980/3 "2025-08-10T10:54:33Z")

</div>

Closed on August 10, 2025, 10:54am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
