Re: [one-users] Ceph snapshot

2015-01-16 Thread Ruben S. Montero
Excellent, thanks for the update...

On Fri Jan 16 2015 at 3:10:21 PM Fabian Zimmermann 
wrote:

> Hi,
>
> answering myself:
>
> Am 16.01.15 um 13:59 schrieb Fabian Zimmermann:
> > Hi,
> >
> > Am 22.10.14 um 10:42 schrieb Ruben S. Montero:
> >> They should be supported for RBD 2 images, you may want to take a look
> to
> >> the actual cloning process in tm/ceph/clone
> > looks like /var/lib/one/remotes/tm/ceph/cpds is used in case of a hot
> > hdd-snapshot.
> yes, because ceph would block the deletion of the source-image until the
> new image is flatten and all snapshots are removed.
> > Should one use this script to create a hot snapshot?
> >
> > If yes, is it a good idea to reuse the
> >
> > if RBD_FORMAT=2
> > then
> >clone
> > else
> >   copy
> >
> > system of tm/ceph/clone in tm/ceph/cpds or may this lead to other
> problems?
> Already asked at ceph-mailinglist if "rbd cp" is doing an internal
> snapshot to protect consistency of data. If not a "snap, protect,
> flatten, unprotect, rm" would be done with the following patch:
>
> --
> --- cpds.orig2015-01-16 14:09:10.116016425 +0100
> +++ cpds2015-01-16 15:00:26.666220420 +0100
> @@ -1,5 +1,7 @@
>  #!/bin/bash
>
> +echo $* > /tmp/$$
> +
>  #
> --
> #
>  # Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G
> Labs#
>  #
> #
> @@ -80,8 +82,27 @@
>  RBD="$RBD --id ${CEPH_USER}"
>  fi
>
> +RBD_SNAP="cpds-${VM_ID}-${DISK_ID}-$( date +%s )"
> +
> +CP_CMD=$(
> +cat < +set -e
> +
> +RBD_FORMAT=\$($RBD info $RBD_DST | sed -n 's/.*format: // p')
> +if [ "\$RBD_FORMAT" = "2" ]; then
> +$RBD snap create "$RBD_DST@$RBD_SNAP"
> +$RBD snap protect "$RBD_DST@$RBD_SNAP"
> +$RBD clone "$RBD_DST@$RBD_SNAP" $DST
> +$RBD flatten $DST
> +$RBD snap unprotect "$RBD_DST@$RBD_SNAP"
> +$RBD snap rm "$RBD_DST@$RBD_SNAP"
> +else
> +$RBD copy $RBD_DST $DST
> +fi
> +EOF
> +)
>
> -ssh_exec_and_log "$SRC_HOST" "$RBD copy $RBD_DST $DST" \
> +ssh_exec_and_log "$SRC_HOST" "$CP_CMD" \
>   "Error cloning $RBD_DST to $DST in $SRC_HOST"
>
>  exit 0
> --
>
> I will create a feature-request if "rbd cp" isn't using an internal
> snapshot.
>
> Fabian
>
>
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Ceph snapshot

2015-01-16 Thread Fabian Zimmermann
Hi,

answering myself:

Am 16.01.15 um 13:59 schrieb Fabian Zimmermann:
> Hi,
>
> Am 22.10.14 um 10:42 schrieb Ruben S. Montero:
>> They should be supported for RBD 2 images, you may want to take a look to
>> the actual cloning process in tm/ceph/clone
> looks like /var/lib/one/remotes/tm/ceph/cpds is used in case of a hot
> hdd-snapshot.
yes, because ceph would block the deletion of the source-image until the
new image is flatten and all snapshots are removed.
> Should one use this script to create a hot snapshot?
>
> If yes, is it a good idea to reuse the
>
> if RBD_FORMAT=2
> then
>clone
> else
>   copy
>
> system of tm/ceph/clone in tm/ceph/cpds or may this lead to other problems?
Already asked at ceph-mailinglist if "rbd cp" is doing an internal
snapshot to protect consistency of data. If not a "snap, protect,
flatten, unprotect, rm" would be done with the following patch:

--
--- cpds.orig2015-01-16 14:09:10.116016425 +0100
+++ cpds2015-01-16 15:00:26.666220420 +0100
@@ -1,5 +1,7 @@
 #!/bin/bash

+echo $* > /tmp/$$
+
 #
-- #
 # Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G
Labs#
 #   
#
@@ -80,8 +82,27 @@
 RBD="$RBD --id ${CEPH_USER}"
 fi

+RBD_SNAP="cpds-${VM_ID}-${DISK_ID}-$( date +%s )"
+
+CP_CMD=$(
+cat 

Re: [one-users] Ceph snapshot

2015-01-16 Thread Fabian Zimmermann
Hi,

Am 22.10.14 um 10:42 schrieb Ruben S. Montero:
> They should be supported for RBD 2 images, you may want to take a look to
> the actual cloning process in tm/ceph/clone
looks like /var/lib/one/remotes/tm/ceph/cpds is used in case of a hot
hdd-snapshot.

Here my datastore-template
--
DATASTORE 100 INFORMATION
ID : 100
NAME   : ceph-one
USER   : oneadmin
GROUP  : oneadmin
CLUSTER: -
TYPE   : IMAGE
DS_MAD : ceph
TM_MAD : ceph
BASE PATH  : /var/lib/one//datastores/100
DISK_TYPE  : RBD

DATASTORE CAPACITY
TOTAL: : 9.8T
FREE:  : 9.7T
USED:  : 118.8G
LIMIT: : -

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

DATASTORE TEMPLATE
BASE_PATH="/var/lib/one//datastores/"
BRIDGE_LIST="virt17 virt18"
CEPH_HOST="10.0.29.0 10.0.29.1 10.0.29.2"
CEPH_SECRET="x-x-x-x-x"
CEPH_USER="libvirt"
CLONE_TARGET="SELF"
DISK_TYPE="RBD"
DS_MAD="ceph"
LN_TARGET="NONE"
POOL_NAME="one"
RBD_FORMAT="2"
TM_MAD="ceph"
TYPE="IMAGE_DS"
--

Should one use this script to create a hot snapshot?

If yes, is it a good idea to reuse the

if RBD_FORMAT=2
then
   clone
else
  copy

system of tm/ceph/clone in tm/ceph/cpds or may this lead to other problems?

Thanks,

Fabian
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Ceph snapshot

2014-10-22 Thread Ruben S. Montero
They should be supported for RBD 2 images, you may want to take a look to
the actual cloning process in tm/ceph/clone

Cheers

Ruben

On Wed, Oct 22, 2014 at 10:32 AM, Johan Kooijman 
wrote:

> Hi all,
>
> I'm running ONE 4.8 on a Ceph datastore. All works fine, but when I create
> a snapshot of a VM, it looks like it does a fat snapshot, instead of using
> Ceph's copy-on-write snapshots. Is there some way I can configure ONE to
> use the CoW?
>
> --
> Met vriendelijke groeten / With kind regards,
> Johan Kooijman
>
> ___
> Users mailing list
> Users@lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>


-- 
Ruben S. Montero, PhD
Project co-Lead and Chief Architect
OpenNebula - Flexible Enterprise Cloud Made Simple
www.OpenNebula.org | rsmont...@opennebula.org | @OpenNebula
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


[one-users] Ceph snapshot

2014-10-22 Thread Johan Kooijman
Hi all,

I'm running ONE 4.8 on a Ceph datastore. All works fine, but when I create
a snapshot of a VM, it looks like it does a fat snapshot, instead of using
Ceph's copy-on-write snapshots. Is there some way I can configure ONE to
use the CoW?

-- 
Met vriendelijke groeten / With kind regards,
Johan Kooijman
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org