[SOLVED]Error copy Image from path in Opennebula server

Hi! I try upload image from path in Opennebula server but have error.
Image is in qcow2 format.

Wed Sep 21 15:42:54 2016 [Z0][ReM][D]: Req:2400 UID:0 ImageAllocate invoked , "NAME="Nagios "...", 1
Wed Sep 21 15:42:54 2016 [Z0][ImM][I]: Copying /tmp/nagios to repository for image 30
Wed Sep 21 15:42:54 2016 [Z0][ReM][D]: Req:2400 UID:0 ImageAllocate result SUCCESS, 30
Wed Sep 21 15:42:54 2016 [Z0][ReM][D]: Req:8864 UID:0 ImageInfo invoked , 30
Wed Sep 21 15:42:54 2016 [Z0][ReM][D]: Req:8864 UID:0 ImageInfo result SUCCESS, "<IMAGE><ID>30</ID><U..."
Wed Sep 21 15:42:54 2016 [Z0][ReM][D]: Req:5056 UID:0 ImagePoolInfo invoked , -2, 0, -2000, -1
Wed Sep 21 15:42:54 2016 [Z0][ReM][D]: Req:5056 UID:0 ImagePoolInfo result SUCCESS, "<IMAGE_POOL><IMAGE><..."
Wed Sep 21 15:42:54 2016 [Z0][ImM][I]: Command execution fail: /var/lib/one/remotes/datastore/fs/cp PERTX0RSSVZFUl9BQ1RJT05fREFUQT48SU1BR0U+PElEPjMwPC9JRD48VUlEPjA8L1VJRD48R0lEPjA8L0dJRD48VU5BTUU+b25lYWRtaW
48L1VOQU1FPjxHTkFNRT5vbmVhZG1pbjwvR05BTUU+PE5BTUU+TmFnaW9zPC9OQU1FPjxQRVJNSVNTSU9OUz48T1dORVJfVT4xPC9PV05FUl9VPjxPV05FUl9NPjE8L09XTkVSX00+PE9XTkVSX0E+MDwvT1dORVJfQT48R1JPVVBfVT4wPC9HUk9VUF9VPjxHUk9VUF9NPjA8
L0dST1VQX00+PEdST1VQX0E+MDwvR1JPVVBfQT48T1RIRVJfVT4wPC9PVEhFUl9VPjxPVEhFUl9NPjA8L09USEVSX00+PE9USEVSX0E+MDwvT1RIRVJfQT48L1BFUk1JU1NJT05TPjxUWVBFPjA8L1RZUEU+PERJU0tfVFlQRT4wP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30
Wed Sep 21 15:42:54 2016 [Z0][ImM][E]: cp: Not allowed to copy images from /var/lib/one/ /etc/one/ /var/lib/one/ /
Wed Sep 21 15:42:54 2016 [Z0][ImM][E]: Not allowed to copy image file /tmp/nagios
Wed Sep 21 15:42:54 2016 [Z0][ImM][I]: ExitCode: 255

You need to set SAFE_DIRS in your template:
http://docs.opennebula.org/5.0/operation/host_cluster_management/datastore_guide.html#datastore-definition

Thanks! I need to read the documentation carefully.

It’s a lot of info :slight_smile: