Bug #4062
transfer manager action is not run on context disk
Status: | Closed | Start date: | 10/16/2015 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 0% | |
Category: | Core & System | |||
Target version: | - | |||
Resolution: | worksforme | Pull request: | ||
Affected Versions: | OpenNebula 4.12, OpenNebula 4.14 |
Description
When doing Resume from Stop or other actions transfer manager action is not run on context disk.
This is important if system datastore is of kind that requires some actions to do on it before it would be available to hypervisor to run.
For e.g. I have shared_lvm driver as system datastore and when doing Resume from Stop I see
MV shared_lvm frontend:/home/datastores/106/8523/disk.0 node:/home/datastores/106/8523/disk.0 8523 105 MV shared_lvm frontend:/home/datastores/106/8523 node:/home/datastores/106/8523 8523 106
there is missing
MV shared_lvm frontend:/home/datastores/106/8523/disk.1 node:/home/datastores/106/8523/disk.1 8523 105
In shared_lvm disk.N is pointing to /dev/vg--one/lv-XXX and requires lvchange -ay to activate.
As a work around we can do that at directory level in driver, but it is complication by comparisition with obvious transfer manager action.
History
#1 Updated by Ruben S. Montero over 5 years ago
- Status changed from Pending to Closed
- Resolution set to worksforme
Hi Rolandas,
This command:
```MV shared_lvm frontend:/home/datastores/106/8523 node:/home/datastores/106/8523```
moves the VM directory and it should also move the context disk within. The system ds generates the context and it should be able to handle it in the above staement. I think that shared_lvm drivers should be updated accorindly. I am not 100% sure but I believe that this was always the behavior expected from a system ds...
As this is related to shared_lvm, I am closing it as worksforme. We can reopen it if needed.
#2 Updated by Rolandas Naujikas over 5 years ago
I agree that it works and workaround is easy for system datastores with simple file system.
But for more complex scenarious (shared_lvm is my own driver implementation based on some older work) it is very complicated.
I have in shared_lvm/mv code like
if [ `is_disk $DST_PATH` -eq 0 ]; then exit 0 fi
which detects that case and it should really call shared_lvm/mv for the context disk only, because everything else is already in place.
But how to implement this additional call ?
#3 Updated by Rolandas Naujikas over 5 years ago
OK, I solved my problem with a code in shared_lvm/mv
... if [ `is_disk $DST_PATH` -eq 0 ]; then DRIVER_PATH=$(dirname $0) XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin" DISK_ID=$(onevm show -x $VMID | $XPATH /VM/TEMPLATE/CONTEXT/DISK_ID) if [ "$DISK_ID" ]; then SRC_PATH=${SRC_PATH}/disk.${DISK_ID} DST_PATH=${DST_PATH}/disk.${DISK_ID} else exit 0 fi fi ...