Bug #2430

SAVE_AS and LOCKED state

Added by Cesare Rossi over 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:11/05/2013
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Core & System
Target version:-
Resolution:worksforme Pull request:
Affected Versions:OpenNebula 3.8

Description

Hi,

I tried to do a SAVE_AS of a disk of a VM. The saved disk remains in LOCKED state until the VM is RUNNING. It is the normal behaviour. If, in the Image Datastore, I delete the disk in LOCKED state, all the subsequent operations of creating and cloning are blocked, i.e. all the new images remain in LOCKED state. Is it a bug ?

Thanks
Cesare R.

History

#1 Updated by Ruben S. Montero over 7 years ago

  • Category set to Core & System

We cannot reproduce this in 4.2, I strongly recommend you to upgrade. 4 series is the current release maintained by the community. I am leaving this issue for 3.8, in case we plan in the future any maintenance release for 3 series, so we try to reproduce this.

If you need to fix this please upgrade.

#2 Updated by Cesare Rossi over 7 years ago

Hi,

I upgraded to 4.2. The problem is unchanged. Even I can do correctly SAVE_AS operations (the snapshot is created and after a while become READY), every cloning operation leaves images in LOCKED state. In oned.log I can read:

Cloning image /var/lib/one/datastores/1/<image_filename> to repository as image <image_id>

Any idea?

Thanks
Cesare

#3 Updated by Ruben S. Montero over 7 years ago

We cannot still reproduce this, can you check that the copy actually finished (e.g. diff from original SOURCE path to the destination PATH)

#4 Updated by Ruben S. Montero over 7 years ago

  • Status changed from Pending to Closed
  • Resolution set to worksforme

This is probably becasue save_as images, are locked till the VM is shutdown (for deferred operations). closing this one

#5 Updated by Edouard Bourguignon over 6 years ago

same here in 4.10.

How to reproduce:
deploy a vm, when the vm is running go to its storage section in sunstone.
click on snapshot, choose deferred. pick a name.
Go in the images section, you can seen the snapshot image in LOCKED state.
Go back to the VM, shut it down. May be the snapshot is now in progress. But the snapshot image stay forever in LOCKED state.

Then if you delete the VM, the snapshot image is now in ERROR state.

is it normal?

#6 Updated by Edouard Bourguignon over 6 years ago

Moreover, if I enable this snapshot image it goes from ERROR to READY state. But in fact, the image file in the datastore has been removed:

IMAGE 8 INFORMATION                                                             
ID             : 8                   
NAME           : CentOS 7 up-to-date 
USER           : oneadmin            
GROUP          : users               
DATASTORE      : default             
TYPE           : OS                  
REGISTER TIME  : 11/15 08:51:26      
PERSISTENT     : No                  
SOURCE         : /var/lib/one//datastores/1/8c3f9d9b3b4a486ba67ccacee440f4c4
FSTYPE         : save_as             
SIZE           : 10G                 
STATE          : used                
RUNNING_VMS    : 1                   

PERMISSIONS                                                                     
OWNER          : um-                 
GROUP          : u--                 
OTHER          : ---                 

IMAGE TEMPLATE                                                                  
DEV_PREFIX="sd" 
DRIVER="qcow2" 
SAVED_DISK_ID="0" 
SAVED_IMAGE_ID="0" 
SAVED_VM_ID="18" 
SAVE_AS="YES" 

VIRTUAL MACHINES

    ID USER     GROUP    NAME            STAT UCPU    UMEM HOST             TIME
    22 oneadmin oneadmin CentOS 7-22     fail    0      0K              0d 00h00
[oneadmin@node01 ~]$ ls /var/lib/one//datastores/1/
c63d266c945dc07bb7c6e26fadd8c3de  dbc431b91303d5412b9ef1b9fb4892e7

#7 Updated by Ruben S. Montero over 6 years ago

Edouard Bourguignon wrote:

same here in 4.10.

How to reproduce:
deploy a vm, when the vm is running go to its storage section in sunstone.
click on snapshot, choose deferred. pick a name.
Go in the images section, you can seen the snapshot image in LOCKED state.
Go back to the VM, shut it down. May be the snapshot is now in progress. But the snapshot image stay forever in LOCKED state.

Then if you delete the VM, the snapshot image is now in ERROR state.

is it normal?

All the TM actions pending for a VM are cancelled if the VM is deleted so the image is moved to ERROR as it probably won't contain useful data if any.

The "it can stay forever" part concerns me, You could easily verify the snapshot is in progress. Take a look to the vm directory /var/lib/one/vms/<vm_id> there should be a transfer.0.epilog with the operation to be excuted...

#8 Updated by Ruben S. Montero over 6 years ago

Edouard Bourguignon wrote:

Moreover, if I enable this snapshot image it goes from ERROR to READY state. But in fact, the image file in the datastore has been removed:

[...]

[...]

The enable operation is to by-pass the error state if it has been checked that there is no error. This is consistent with the above comment. However we probably should require ADMIN right to do this as a regular user may or may not have access to the datastore to verify the image status.

#9 Updated by Nuno Taborda over 6 years ago

Edouard Bourguignon wrote:

same here in 4.10.

How to reproduce:
deploy a vm, when the vm is running go to its storage section in sunstone.
click on snapshot, choose deferred. pick a name.
Go in the images section, you can seen the snapshot image in LOCKED state.
Go back to the VM, shut it down. May be the snapshot is now in progress. But the snapshot image stay forever in LOCKED state.

Then if you delete the VM, the snapshot image is now in ERROR state.

is it normal?

Can also reproduce this exact same problem. OpenNebula 4.10.1. Is there a way to work around it and export a VM disk in the meantime?

#10 Updated by Ruben S. Montero over 6 years ago

As in the previous comments, this is kind of the expected behavior to be sure that the snapshot has been copied to the repository. If the VM is deleted while the snapshot is being copied the IMAGE is going to be moved to ERROR, as OpenNebula doesn't know if the IMAGE was actually copied or not (no notification was received).

If you are sure the image has been copied and it is OK, then simply go and issue oneimage enable.

Also available in: Atom PDF