[one-users] OpenNebula 3.4 with Clustered LVM

Jaime Melis jmelis at opennebula.org
Fri May 11 04:31:20 PDT 2012


Hello Yves,

regarding the first error, you need to be able to execute sudo without a
tty. You will probably need to remove the requiretty directive from the
/etc/sudoers file in the hosts. I'm taking this into account to make it
clearer in the documentation.

About the way you registered the image, it's not usually the way it's meant
to be done. You should use PATH=/path/to/Master.raw
instead of using directly the SOURCE. To obtain Master.raw, you need to
convert it from qcow2. THis is somehow important because of the SIZE that
gets calculated during registration and the naming convention the driver
assumes they have

Cheers,
Jaime

On Fri, May 11, 2012 at 1:19 PM, Vogl, Yves <vogl at adesso-mobile.de> wrote:

>  Hi Jaime,
>
>  On 11.05.2012, at 13:05, Jaime Melis wrote:
>
>  do you have in /var/log/one/429.log more information on the error?
>
>
>  Fri May 11 12:35:46 2012 [DiM][I]: New VM state is ACTIVE.
> Fri May 11 12:35:50 2012 [LCM][I]: New VM state is PROLOG.
> Fri May 11 12:35:50 2012 [VM][I]: Virtual Machine has no context
> Fri May 11 12:35:50 2012 [TM][I]: Command execution fail:
> /var/lib/one/remotes/tm/lvm/clone one01:/dev/vg01/master kvm02.ams-cloud.de:
> /var/lib/one//datastores/0/429/disk.0
> Fri May 11 12:35:50 2012 [TM][I]:
> /var/lib/one/remotes/tm/lvm/../../datastore/xpath.rb: unrecognized option
> `--stdin'
> Fri May 11 12:35:50 2012 [TM][E]: clone: Command "    set -e
> Fri May 11 12:35:50 2012 [TM][I]: mkdir -p /var/lib/one/datastores/0/429
> Fri May 11 12:35:50 2012 [TM][I]: sudo lvcreate -s -L512 -n
> /dev/vg01/master-429-0 /dev//dev/vg01/master//dev/vg01/master
> Fri May 11 12:35:50 2012 [TM][I]: ln -s
> "/dev//dev/vg01/master//dev/vg01/master-429-0"
> "/var/lib/one/datastores/0/429/disk.0"" failed: sudo: sorry, you must have
> a tty to run sudo
> Fri May 11 12:35:50 2012 [TM][E]: Error cloning
> /dev//dev/vg01/master//dev/vg01/master to
> /dev//dev/vg01/master//dev/vg01/master-429-0
> Fri May 11 12:35:50 2012 [TM][I]: ExitCode: 1
> Fri May 11 12:35:50 2012 [TM][E]: Error executing image transfer script:
> Error cloning /dev//dev/vg01/master//dev/vg01/master to
> /dev//dev/vg01/master//dev/vg01/master-429-0
> Fri May 11 12:35:51 2012 [DiM][I]: New VM state is FAILED
> Fri May 11 12:50:11 2012 [DiM][I]: New VM state is DONE.
> Fri May 11 12:50:11 2012 [TM][W]: Ignored: LOG I 429 ExitCode: 0
>
>  Fri May 11 12:50:11 2012 [TM][W]: Ignored: LOG I 429 delete: Deleting
> /var/lib/one/datastores/0/429
>
>  Fri May 11 12:50:11 2012 [TM][W]: Ignored: LOG I 429 ExitCode: 0
>
>  Fri May 11 12:50:11 2012 [TM][W]: Ignored: TRANSFER SUCCESS 429 -
>
>
>  BTW, the fact that the LV has master in it it's pretty strange. Have you
> registered it using oneimage create <image.tpl> -d <lvm_datastore_id>
>
>
>  Yes.
>
>
>  And does the image.tpl have a PATH pointing to a file that holds the
> image?
>
>
>  I've no file that holds the image. /dev/vg1/master is an already
> populated "master image" in form of a logical volume.
>
>  I created it like this:
>
>  qemu-img convert Master.qcow2 -O raw /dev/vg1/master
>
>  Thanks,
> Yves
>
>
>
>
>
>
>  On 11.05.2012, at 13:05, Jaime Melis wrote:
>
> Hello Yves,
>
>  do you have in /var/log/one/429.log more information on the error?
>
>  BTW, the fact that the LV has master in it it's pretty strange. Have you
> registered it using oneimage create <image.tpl> -d <lvm_datastore_id>
>
>  And does the image.tpl have a PATH pointing to a file that holds the
> image?
>
>  cheers,
> Jaime
>
> On Fri, May 11, 2012 at 12:47 PM, Vogl, Yves <vogl at adesso-mobile.de>wrote:
>
>> Hi Jamie,
>>
>> thanks for you answer.
>>
>> I did the steps you suggested and fail with an error - it seems that
>> there's something messed up when deploying a vm.
>> The error occures on cloning.
>>
>> Error executing image transfer script: Error cloning
>> /dev//dev/vg01/master//dev/vg01/master to
>> /dev//dev/vg01/master//dev/vg01/master-429-0
>>
>> I intended to clone /dev/vg01/master to /dev/vg01/master-429-0
>>
>>
>> I'll have a look at the drivers - but maybe I'm doing something wrong?
>>
>> Thanks,
>> Yves
>>
>>
>>
>> Thats my datastore:
>>
>> DATASTORE 105 INFORMATION
>> ID             : 105
>> NAME           : kvm02
>> USER           : oneadmin
>> GROUP          : oneadmin
>> CLUSTER        : -
>> DS_MAD         : lvm
>> TM_MAD         : lvm
>> BASE PATH      : /var/lib/one/datastores/105
>>
>> PERMISSIONS
>> OWNER          : um-
>> GROUP          : u--
>> OTHER          : ---
>>
>> DATASTORE TEMPLATE
>> DS_MAD="lvm"
>> HOST="kvm02.example.org"
>> TM_MAD="lvm"
>> VG_NAME="vg1"
>>
>>
>> That my image:
>>
>>
>> IMAGE 20 INFORMATION
>> ID             : 20
>> NAME           : Master
>> USER           : oneadmin
>> GROUP          : oneadmin
>> DATASTORE      : kvm02
>> TYPE           : OS
>> REGISTER TIME  : 05/11 12:32:10
>> PERSISTENT     : No
>> SOURCE         : /dev/vg01/master
>> SIZE           : 0
>> STATE          : used
>> RUNNING_VMS    : 1
>>
>> PERMISSIONS
>> OWNER          : um-
>> GROUP          : ---
>> OTHER          : ---
>>
>> IMAGE TEMPLATE
>> BUS="virtio"
>> DEV_PREFIX="hd"
>> DRIVER="raw"
>>
>>
>> That's my template:
>>
>> TEMPLATE 23 INFORMATION
>> ID             : 23
>> NAME           : kvm02
>> USER           : oneadmin
>> GROUP          : oneadmin
>> REGISTER TIME  : 05/11 12:32:56
>>
>> PERMISSIONS
>> OWNER          : um-
>> GROUP          : ---
>> OTHER          : ---
>>
>> TEMPLATE CONTENTS
>> CPU="100"
>> DISK=[
>>  BUS="virtio",
>>  DRIVER="raw",
>>  IMAGE="Master",
>>  IMAGE_UNAME="oneadmin" ]
>> FEATURES=[
>>  PAE="no" ]
>> MEMORY="1024"
>> NAME="kvm02"
>> NIC=[
>>  NETWORK="kvm02",
>>  NETWORK_UNAME="oneadmin" ]
>> OS=[
>>  ARCH="x86_64",
>>  BOOT="hd" ]
>> RAW=[
>>  TYPE="kvm" ]
>> TEMPLATE_ID="23"
>> VCPU="1"
>>
>>
>> That's my instantiated template_
>>
>> VIRTUAL MACHINE 429 INFORMATION
>> ID                  : 429
>> NAME                : one-429
>> USER                : oneadmin
>> GROUP               : oneadmin
>> STATE               : FAILED
>> LCM_STATE           : LCM_INIT
>> START TIME          : 05/11 12:34:53
>> END TIME            : 05/11 12:35:51
>> DEPLOY ID           : -
>>
>> VIRTUAL MACHINE MONITORING
>> NET_TX              : 0
>> USED CPU            : 0
>> USED MEMORY         : 0
>> NET_RX              : 0
>>
>> PERMISSIONS
>> OWNER               : um-
>> GROUP               : ---
>> OTHER               : ---
>>
>> VIRTUAL MACHINE TEMPLATE
>> CPU="100"
>> DISK=[
>>  BUS="virtio",
>>  CLONE="YES",
>>  DATASTORE="kvm02",
>>  DATASTORE_ID="105",
>>  DISK_ID="0",
>>  DRIVER="raw",
>>  IMAGE="Master",
>>  IMAGE_ID="20",
>>  IMAGE_UNAME="oneadmin",
>>  READONLY="NO",
>>  SAVE="NO",
>>  SOURCE="/dev/vg01/master",
>>  TARGET="hda",
>>  TM_MAD="lvm",
>>  TYPE="DISK" ]
>> ERROR=[
>>  MESSAGE="Error executing image transfer script: Error cloning
>> /dev//dev/vg01/master//dev/vg01/master to
>> /dev//dev/vg01/master//dev/vg01/master-429-0",
>>  TIMESTAMP="Fri May 11 12:35:50 2012" ]
>> FEATURES=[
>>  PAE="no" ]
>> MEMORY="1024"
>> NAME="one-429"
>> NIC=[
>>  BRIDGE="br0",
>>  IP="176.9.163.37",
>>  MAC="02:00:b0:02:a3:04",
>>  NETWORK="kvm02",
>>  NETWORK_ID="10",
>>  NETWORK_UNAME="oneadmin",
>>  VLAN="NO" ]
>> OS=[
>>  ARCH="x86_64",
>>  BOOT="hd" ]
>> RAW=[
>>  TYPE="kvm" ]
>> TEMPLATE_ID="23"
>> VCPU="1"
>> VMID="429"
>>
>> VIRTUAL MACHINE HISTORY
>>  SEQ        HOSTNAME REASON           START        TIME       PTIME
>>   0 kvm02.ams-cloud   erro  05/11 12:35:46    0d 00:00    0d 00:00
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On 10.05.2012, at 20:01, Jaime Melis wrote:
>>
>> > Hello Yves,
>> >
>> > there was a big change from OpenNebula 3.2 to 3.4, and we pulled out
>> the LVM drivers temporarily. The new LVM drivers are already in place for
>> the next OpenNebula release 3.6 [1][2][3].
>> >
>> > However, those new drivers will not work for as-is OpenNebula 3.4, you
>> will need to apply the following patch:
>> >
>> > --- a/src/tm_mad/lvm/clone
>> > +++ b/src/tm_mad/lvm/clone
>> > -VM_ID=$3
>> > +VM_DIR=$(basename `dirname $DST`)
>> >
>> > Note that I haven't tested it with OpenNebula 3.4, but they should work
>> like that. If it doesn't, please let me know and I'll be glad to help.
>> >
>> > [1] http://opennebula.org/documentation:rel3.6:lvm_ds
>> > [2]
>> https://github.com/OpenNebula/one/tree/master/src/datastore_mad/remotes/lvm
>> > [3] https://github.com/OpenNebula/one/tree/master/src/tm_mad/lvm
>> >
>> > Cheers,
>> > Jaime
>> >
>> > On Thu, May 10, 2012 at 7:06 PM, Vogl, Yves <vogl at adesso-mobile.de>
>> wrote:
>> > Hi,
>> >
>> > I've setup OpenNebula 3.4 together with 5 KVM hosts.
>> > Those 6 hosts are member of a clustered LVM.
>> >
>> > The OpenNebula host holds the „Master“ image in form of a logical
>> volume "/dev/vg1/master".
>> > Every KVM host synchronizes with this image and therefore has a local
>> copy of this image represented by its own "/dev/vg1/master" volume.
>> >
>> > Now I'd like OpenNebula to deploy a virtual machine by creating a new
>> logical volume as LVM snapshot from /dev/vg1/master - manually it'll look
>> like this on the KVM host:
>> >
>> > # lvcreate -n vm01 -L40G -s /dev/vg1/master
>> >
>> > When the virtual machine is removed, I just need a:
>> >
>> > # lvremove -f /dev/vg1/vm01
>> >
>> >
>> > I've read in the change logs of OpenNebula 3.2 that the tm_lvm driver
>> was removed and superseded by the iSCSI driver.
>> > I'm clueless… iSCSI simply is not LVM…
>> >
>> >
>> > My next step would be to create a custom transfer manage to realize the
>> steps I need.
>> > But… do I really need to do this?
>> >
>> >
>> > Help from someone who's running the same setup is greatly appreciated
>> :-)
>> >
>> >
>> > Thanks so far,
>> >
>> > Yves
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at lists.opennebula.org
>> > http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>> >
>> >
>> >
>> >
>> > --
>> > Jaime Melis
>> > Project Engineer
>> > OpenNebula - The Open Source Toolkit for Cloud Computing
>> > www.OpenNebula.org | jmelis at opennebula.org
>>
>>
>
>
>  --
> Jaime Melis
> Project Engineer
> OpenNebula - The Open Source Toolkit for Cloud Computing
> www.OpenNebula.org | jmelis at opennebula.org
>
>
>


-- 
Jaime Melis
Project Engineer
OpenNebula - The Open Source Toolkit for Cloud Computing
www.OpenNebula.org | jmelis at opennebula.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20120511/014721d5/attachment-0003.htm>


More information about the Users mailing list