[one-users] Save As and Detach option

Roberto Rosende Dopazo rrosende at cesga.es
Tue Nov 27 03:41:45 PST 2012


Hi,

El 27/11/12 11:50, Javier Fontan escribió:
> Hi,
>
> I'm struggling to understand the situation you are describing. Correct
> me if I am wrong.
>
> You mention dom0. Are you using Xen? If that is true disregard what I
> said about changing dynamic_ownership parameter in libvirt as Xen
> drivers do not use libvirt for hypervisor communication.
It's kvm image and dynamic_ownership was wrong because I misunderstood 
and put it to 1, now is 0 and owner and group is not changed.
But option save as still doesn't work, I tried it directly from frontend 
shell instead SunStone and I got that:


[grid at cloud ~]$ onevm show 138
VIRTUAL MACHINE 138 INFORMATION
ID                  : 138
NAME                : one-138
USER                : emi
GROUP               : oneadmin
STATE               : ACTIVE
LCM_STATE           : RUNNING
RESCHED             : No
HOST                : nubacesga-01-4
START TIME          : 11/27 11:34:32
END TIME            : -
DEPLOY ID           : one-138

VIRTUAL MACHINE MONITORING
USED MEMORY         : 0K
NET_RX              : 0K
USED CPU            : 0
NET_TX              : 0K

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

VIRTUAL MACHINE TEMPLATE
CPU="1"
DISK=[
   BUS="virtio",
   CLONE="YES",
   CLUSTER_ID="100",
   DATASTORE="GRID EMC",
   DATASTORE_ID="100",
   DEV_PREFIX="hd",
   DISK_ID="0",
   DRIVER="qcow2",
   IMAGE="GRID SL6_emi_cream_orig",
   IMAGE_ID="11",
   READONLY="NO",
   SAVE="NO",
SOURCE="/var/lib/one/datastores/100/3dfef6d01e7e624f13ef13698ed04710",
   TARGET="hda",
   TM_MAD="shared",
   TYPE="FILE" ]
DISK=[
   DEV_PREFIX="hd",
   DISK_ID="1",
   SIZE="1024",
   TARGET="hdb",
   TYPE="swap" ]
GRAPHICS=[
   KEYMAP="es",
   LISTEN="0.0.0.0",
   PORT="6038",
   TYPE="vnc" ]
MEMORY="2512"
NAME="one-138"
NIC=[
   BRIDGE="virbrPUBLIC",
   CLUSTER_ID="100",
   IP="193.144.35.36",
   MAC="02:00:c1:90:23:24",
   MODEL="e1000",
   NETWORK="red-193.144.35",
   NETWORK_ID="0",
   VLAN="NO" ]
OS=[
   ROOT="hda1" ]
PRODUCT="EMI-test"
REQUIREMENTS="CLUSTER_ID = 100"
TEMPLATE_ID="6"
VCPU="1"
VMID="138"

VIRTUAL MACHINE HISTORY
  SEQ HOST            REASON           START            TIME PROLOG_TIME
    0 nubacesga-01-4  none    11/27 11:34:56    0d 00h01m09s    0d 00h00m22s




[grid at cloud ~]$ onevm saveas 138 0 changes01
Image ID: 31



[grid at cloud ~]$ oneimage list
   ID USER       GROUP      NAME DATASTORE     SIZE TYPE PER STAT RVMS
[...]
   31 grid       oneadmin   changes01 GRID EMC      2.2G OS    No lock    0


[grid at cloud ~]$ oneimage show 31
IMAGE 31 INFORMATION
ID             : 31
NAME           : changes01
USER           : grid
GROUP          : oneadmin
DATASTORE      : GRID EMC
TYPE           : OS
REGISTER TIME  : 11/27 11:36:26
PERSISTENT     : No
SOURCE         : 
/var/lib/one/datastores/100/08cee146d8bff43c6c61794f1ba947d3
FSTYPE         : save_as
SIZE           : 2.2G
STATE          : lock
RUNNING_VMS    : 0

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

IMAGE TEMPLATE
DEV_PREFIX="hd"
SAVED_DISK_ID="0"
SAVED_IMAGE_ID="11"
SAVED_VM_ID="138"
SAVE_AS="YES"



 From onevm help I understood that now it's supposed I have the file :

saveas <vmid> <diskid> <img_name>
         Sets the specified VM disk to be saved in a new Image. The 
Image is
         created immediately, but the contents are saved only if the VM is
         shut down gracefully (i.e., using 'onevm shutdown' and not
         'onevm delete')


But it does not exist:
[grid at cloud ~]$ file 
/var/lib/one/datastores/100/08cee146d8bff43c6c61794f1ba947d3
/var/lib/one/datastores/100/08cee146d8bff43c6c61794f1ba947d3: cannot 
open `/var/lib/one/datastores/100/08cee146d8bff43c6c61794f1ba947d3' (No 
such file or directory)

After a shutdown file still does not exist but image is marked as READY

[grid at cloud ~]$ oneimage list
   ID USER       GROUP      NAME DATASTORE     SIZE TYPE PER STAT RVMS
    [...]
   31 grid       oneadmin   changes01 GRID EMC      2.2G OS    No rdy     0


And file doesn't exists anyway, from oned.log
492501-Tue Nov 27 11:36:26 2012 [ReM][D]: Req:5808 UID:0 AclInfo invoked
492502-Tue Nov 27 11:36:26 2012 [ReM][D]: Req:5808 UID:0 AclInfo result 
SUCCESS, "<ACL_POOL><ACL><ID>0..."
492503-Tue Nov 27 11:36:26 2012 [ReM][D]: Req:4608 UID:2 
VirtualMachineSaveDisk invoked, 138, 0, "changes01", ""
492504-Tue Nov 27 11:36:26 2012 [ImM][I]: Creating disk at  of 2216Mb 
(type: save_as)
492505-Tue Nov 27 11:36:26 2012 [ReM][D]: Req:4608 UID:2 
VirtualMachineSaveDisk result SUCCESS, 31
492506-Tue Nov 27 11:36:26 2012 [ImG][D]: Message received: LOG I 31 
ExitCode: 0
492507-
492508-Tue Nov 27 11:36:26 2012 [ImM][I]: ExitCode: 0
492509:Tue Nov 27 11:36:26 2012 [ImG][D]: Message received: MKFS SUCCESS 
31 /var/lib/one/datastores/100/08cee146d8bff43c6c61794f1ba947d3
492510-


Cheers,
  Roberto



> First line I see in the in the log file seems seriously broken:
>
> 426622-Mon Nov 26 14:06:42 2012 [ImM][I]: Creating disk at  of 2216Mb
> (type: save_as)
>
> It's not saying where it is creating the image (source in OpenNebula
> parlance) and give an strange type. Could you please send us the VM
> and Image templates from onevm and oneimage show? Maybe I am missing
> something and other developers could help me here.
>
> I also see this line that says the image was created:
>
> 426627:Mon Nov 26 14:06:42 2012 [ImG][D]: Message received: MKFS
> SUCCESS 25 /var/lib/one/datastores/100/a3e076f377a855dc76f44ac373c9b0ca
>
> But you are telling me that the image does not exist. Are you checking
> the hypervisor node or the frontend?
>
> More comments inline
>
>
> On Mon, Nov 26, 2012 at 2:33 PM, Roberto Rosende Dopazo
> <rrosende at cesga.es> wrote:
>> [...]
>> After delete machine image state is showed as READY in Sunstone.
>> In dom0 deployment dir and file are still present and disk files disk.0 and
>> disk.1 have their user and group changed to root.root and image file doesn't
>> exist
>> A new file appears
>> # file /var/lib/one/datastores/0/123/checkpoint
>> /var/lib/one/datastores/0/123/checkpoint: data
> This is really strange. After EPILOG (the state that comes after
> successful shutdown, delete or cancel) the VM directory in the system
> datastore is deleted, so those files should not be there. Also, then
> only way OpeNebula tells Xen to create checkpoint is on SAVE, STOP or
> MIGRATE. Are you sure that you have deleted the VM? It looks to me
> that the image was suspended or stopped. Bear in mind that save_as is
> not done in that state.
>
>> Also with root.root but 666 file permission and in this case directory and
>> files of this machine are never deleted from running datastore
> The non deletion of images is consistent my the SAVE/STOP theory.
>
> Cheers
>
> --
> Javier Fontán Muiños
> Project Engineer
> OpenNebula - The Open Source Toolkit for Data Center Virtualization
> www.OpenNebula.org | jfontan at opennebula.org | @OpenNebula




More information about the Users mailing list