Bug #2920
Can not create new empty "DATABLOCK" image on lvm volume
Status: | Closed | Start date: | 05/15/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | Ruben S. Montero | % Done: | 0% | |
Category: | Drivers - Storage | |||
Target version: | Release 4.6.1 | |||
Resolution: | fixed | Pull request: | ||
Affected Versions: | OpenNebula 4.6 |
Description
Hello.
I created the datastore using:
cat > /tmp/ds.conf << EOF
NAME = data
DS_MAD = lvm
TM_MAD = lvm
VG_NAME = VolGroup01
DISK_TYPE = block
HOST = localhost
BRIDGE_LIST = localhost
EOF
onedatastore create /tmp/ds.conf
Then I tried to create empty DATABLOCK image inside this datastore:
cat > /tmp/win7_disk_template.conf << EOF
NAME = "Windows Disk"
TYPE = DATABLOCK
PERSISTENT = yes
DESCRIPTION = "Windows Disk"
DEV_PREFIX = vd
SIZE = 10240
EOF
oneimage create /tmp/win7_disk_template.conf --datastore 100
I got the following errors in the logs (/var/log/one/oned.log)
==> /var/log/one/oned.log <==
Thu May 15 16:30:09 2014 [ImM][I]: Command execution fail: /var/lib/one/remotes/datastore/lvm/mkfs PERTX0RSSVZFUl9BQ1RJT05fREFUQT48SU1BR0U+PElEPjg8L0lEPjxVSUQ+MjwvVUlEPjxHSUQ+MDwvR0lEPjxVTkFNRT5hZG1pbjwvVU5BTUU+PEdOQU1FPm9uZWFkbWluPC9HTkFNRT48TkFNRT5kc2Fkc2ZhZGZhZGZzPC9OQU1FPjxQRVJNSVNTSU9OUz48T1dORVJfVT4xPC9PV05FUl9VPjxPV05FUl9NPjE8L09XTkVSX00+PE9XTkVSX0E+MDwvT1dORVJfQT48R1JPVVBfVT4wPC9HUk9VUF9VPjxHUk9VUF9NPjA8L0dST1VQX00+PEdST1VQX0E+MDwvR1JPVVBfQT48T1RIRVJfVT4wPC9PVEhFUl9VPjxPVEhFUl9NPjA8L09USEVSX00+PE9USEVSX0E+MDwvT1RIRVJfQT48L1BFUk1JU1NJT05TPjxUWVBFPjI8L1RZUEU+PERJU0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Q+PEJBU0VfUEFUSD4vdmFyL2xpYi9vbmUvL2RhdGFzdG9yZXMvMTA1PC9CQVNFX1BBVEg+PFRZUEU+MDwvVFlQRT48RElTS19UWVBFPjI8L0RJU0tfVFlQRT48Q0xVU1RFUl9JRD4tMTwvQ0xVU1RFUl9JRD48Q0xVU1RFUj48L0NMVVNURVI+PFRPVEFMX01CPjEwMzY4MzwvVE9UQUxfTUI+PEZSRUVfTUI+MTAzNTQ4PC9GUkVFX01CPjxVU0VEX01CPjEzNDwvVVNFRF9NQj48SU1BR0VTPjwvSU1BR0VTPjxURU1QTEFURT48QkFTRV9QQVRIPjwhW0NEQVRBWy92YXIvbGliL29uZS8vZGF0YXN0b3Jlcy9dXT48L0JBU0VfUEFUSD48QlJJREdFX0xJU1Q+PCFbQ0RBVEFbbG9jYWxob3N0XV0+PC9CUklER0VfTElTVD48Q0xPTkVfVEFSR0VUPjwhW0NEQVRBW1NFTEZdXT48L0NMT05FX1RBUkdFVD48RElTS19UWVBFPjwhW0NEQVRBW0JMT0NLXV0+PC9ESVNLX1RZUEU+PERTX01BRD48IVtDREFUQVtsdm1dXT48L0RTX01BRD48SE9TVD48IVtDREFUQVtsb2NhbGhvc3RdXT48L0hPU1Q+PExOX1RBUkdFVD48IVtDREFUQVtOT05FXV0+PC9MTl9UQVJHRVQ+PFRNX01BRD48IVtDREFUQVtsdm1dXT48L1RNX01BRD48VkdfTkFNRT48IVtDREFUQVtWb2xHcm91cDAxXV0+PC9WR19OQU1FPjwvVEVNUExBVEU+PC9EQVRBU1RPUkU+PC9EU19EUklWRVJfQUNUSU9OX0RBVEE+ 8
Thu May 15 16:30:09 2014 [ImM][E]: mkfs: Command " set -e
Thu May 15 16:30:09 2014 [ImM][I]: sudo lvcreate -L1000M VolGroup01 -n lv-one-8
Thu May 15 16:30:09 2014 [ImM][I]: sudo " failed: Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
Thu May 15 16:30:09 2014 [ImM][I]: usage: sudo [-D level] -h | -K | -k | -V
Thu May 15 16:30:09 2014 [ImM][I]: usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user
Thu May 15 16:30:09 2014 [ImM][I]: name|#uid]
Thu May 15 16:30:09 2014 [ImM][I]: usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user
Thu May 15 16:30:09 2014 [ImM][I]: name] [-u user name|#uid] [-g groupname|#gid] [command]
Thu May 15 16:30:09 2014 [ImM][I]: usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g
Thu May 15 16:30:09 2014 [ImM][I]: groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]
Thu May 15 16:30:09 2014 [ImM][I]: [VAR=value] [-i|-s] [<command>]
Thu May 15 16:30:09 2014 [ImM][I]: usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g
Thu May 15 16:30:09 2014 [ImM][I]: groupname|#gid] [-p prompt] [-u user name|#uid] file ...
Thu May 15 16:30:09 2014 [ImM][E]: Error registering localhost:/dev/VolGroup01/lv-one-8
Thu May 15 16:30:09 2014 [ImM][I]: ExitCode: 1
Thu May 15 16:30:09 2014 [ImM][E]: Error creating datablock: Error registering localhost:/dev/VolGroup01/lv-one-8
Thu May 15 16:30:09 2014 [InM][D]: Monitoring datastore data (105)
Thu May 15 16:30:10 2014 [ImM][D]: Datastore data (105) successfully monitored.
Probably the problem is in this file /var/lib/one/remotes/datastore/lvm/mkfs in the line: $SUDO $(mkfs_command "$DEV" "$FSTYPE")
...
REGISTER_CMD=$(cat <<EOF
$SUDO $LVCREATE -L${SIZE}M ${VG_NAME} -n ${LV_NAME}
$SUDO $(mkfs_command "$DEV" "$FSTYPE")
EOF
...
In case of $FSTYPE = "raw", the mkfs_command function returns empty string "" and then the script executes just "sudo" without any parameters - which is causing the error.
Everything is working fine when I comment the line:
# $SUDO $(mkfs_command "$DEV" "$FSTYPE")
Regards
PetrR
Associated revisions
bug #2920: Fix raw datablocks in LVM
bug #2920: Fix raw datablocks in LVM
(cherry picked from commit ad69ab83c7e9d30b40b685bbe74950f6c9ac6343)
History
#1 Updated by Ruben S. Montero about 7 years ago
- Status changed from Pending to Closed
- Assignee set to Ruben S. Montero
- Resolution set to fixed
You are right. Fixed in the repo. It'd be great if you can give it a try.
THANKS!
#2 Updated by Anonymous about 7 years ago
The revision f5c01e61 fixed the issue. I tested it and now it's working fine.
Thank you
PetrR
#3 Updated by Ruben S. Montero about 7 years ago
GREAT! thank you!
Petr Ruzicka wrote:
The revision f5c01e61 fixed the issue. I tested it and now it's working fine.
Thank you
PetrR