| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | | |
Regular socket communications are fallen back to when
no systemd socket is present.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows the main loop to get an exception in its wait loop
when a signal arrives, rather than block forever. Before this,
topping the daemon required sending a KILL signal or sending one last
command, so that the loop could check the "received a signal" flag.
|
| | |
| | |
| | |
| | |
| | | |
Save the error exit for unknown exits. This makes
systemd happier, since it stops us with a signal.
|
| | |
| | |
| | |
| | |
| | | |
There's no need to return a zero-length string.
Before being fixed, this caused a hang when shutting down.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
Add Documentation entries, cleaned up socket activation entries.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can no longer have python automatically convert
binary to/from string data, so be explicit about it.
Also, the TargetCLI __del__ method was testing for a
non-existant attribute, so close our socket if open.
|
|/ /
| |
| |
| |
| |
| | |
The indentation was wrong, causing the daemon to only
process the last block of outout, which would only
show up with a lot of output.
|
| | |
|
|\ \
| | |
| | | |
[targetcli] restoreconfig: add ability to restore/reload single target or storage_object
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem:
-------
Right now, if any target or storage_object is failed to load as part of
target service bringup or manual restoreconfig, may be because of an issue from
the backend, then there is no way to reload that single storage_object or target,
we need to reload/restart all the targets/storage_objects present in the node
just to load one single target/storage_object, this interrupts on going
I/O (via this path) for all the volumes hosted within the node.
Solution:
--------
Add a capability to reload single target or storage_object without touching other
targets or storage_objects hosted in the node.
usage:
$ targetcli
targetcli shell version 2.1.fb49
Copyright 2011-2013 by Datera, Inc and others
For help on commands, type 'help'.
/> help
[...]
AVAILABLE COMMANDS
The following commands are available in the current path:
[...]
- restoreconfig [savefile] [clear_existing] [target] [storage_object]
[...]
Ex 1. reload single storage_object
$ targetcli restoreconfig /etc/target/saveconfig.json clear_existing \
storage_object=blockx
Ex 2. reload single target
$ targetcli restoreconfig /etc/target/saveconfig.json clear_existing \
target=iqn.2016-12.org.gluster-block:xxx
Ex 3. reload a given target and storage_object
$ targetcli restoreconfig /etc/target/saveconfig.json clear_existing \
target=iqn.2016-12.org.gluster-block:xxx storage_object=blockx
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\ \ \
| |/ /
|/| | |
iscsi discovery_auth enable is a number not a string
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The discovery_auth attribute group in the /iscsi node
has several attributes, and all area treated like strings,
even though "enable" is a number in sysfs, accepting either
zero or one. It would break backwards compatability to
convert this attribute to be a boolean, so at least
treat it like a proper number instead of a string.
This avoids stack dumps like the following when trying
to set this attribute to 'true' or 'false':
> /iscsi> set discovery_auth enable=false
> Traceback (most recent call last):
> File "/usr/bin/targetcli", line 122, in <module>
> main()
> File "/usr/bin/targetcli", line 112, in main
> shell.run_interactive()
> File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 905, in run_interactive
> self._cli_loop()
> File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 734, in _cli_loop
> self.run_cmdline(cmdline)
> File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 848, in run_cmdline
> self._execute_command(path, command, pparams, kparams)
> File "/usr/lib/python3.6/site-packages/configshell_fb/shell.py", line 823, in _execute_command
> result = target.execute_command(command, pparams, kparams)
> File "/usr/lib/python3.6/site-packages/configshell_fb/node.py", line 1406, in execute_command
> return method(*pparams, **kparams)
> File "/usr/lib/python3.6/site-packages/configshell_fb/node.py", line 522, in ui_command_set
> group_setter(param, value)
> File "/usr/lib/python3.6/site-packages/targetcli/ui_target.py", line 134, in ui_setgroup_discovery_auth
> self.rtsnode.discovery_enable_auth = value
> File "/usr/lib/python3.6/site-packages/rtslib_fb/fabric.py", line 243, in _set_discovery_enable_auth
> if int(enable):
> ValueError: invalid literal for int() with base 10: 'false'
Now the output will be:
> Not setting enable! Syntax error, 'false' is not a NUMBER.
|
|\ \
| |/
|/| |
Fix a syntax error in some except clauses
|
|/
|
|
|
|
|
| |
"except Exception, e" triggers a syntax error on Python 3.7. The
correct syntax is "except Exception as e".
This patch fixes issue #142.
|
|\
| |
| | |
targetcli: serialize multiple requests
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
-------
targetcli/rtslib cannot handle parallel requests at the moment.
Read more about this at http://bit.ly/targetcli-parallel-requests-issue
$ for i in {1..10}; do \
targetcli /backstores/fileio create ${i} /tmp/file${i} 10M& done
Created fileio 1 with size 10485760
This _Backstore already exists in configFS
This _Backstore already exists in configFS
This _Backstore already exists in configFS
This _Backstore already exists in configFS
This _Backstore already exists in configFS
Created fileio 6 with size 10485760
Created fileio 2 with size 10485760
This _Backstore already exists in configFS
Created fileio 8 with size 10485760
Created fileio 9 with size 10485760
bails-out most of the time with above errors and sometimes even crashes.
Solution:
--------
Serialize/defend the parallel requests by simply taking a wait lock at
targetcli level, so that only one request can be processed by targetcli at
any given point in time.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\
| |
| | |
targetclid: add daemonize component for targetcli
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
$ targetcli set global
GLOBAL CONFIG GROUP
[...]
auto_use_daemon=bool
If true, commands will be sent to targetclid.
[...]
$ targetcli set global auto_use_daemon=True
Parameter auto_use_daemon is now 'true'.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Problem:
-------
Overall creation time of a block using targetcli is raising linearly as the
block count increase.
This is because of the recurring issue involving refresh(reload) at
multiple objects/places, as the LIO's configfs is deeply nested.
Earlier discussion of the problem statement with stats and graphs about delays:
http://bit.ly/targetcli-create-delay
Solution:
--------
Introduce a daemon component for targetcli[d] which will retain state of
Configshell object in memory, so that any new requests can directly use it,
instead of loading the storageObjects/targetObjects again.
Details about "how to use it ?":
-------------------------------
$ systemctl start targetclid
$ systemctl status targetclid
● targetclid.service - Targetcli daemon
Loaded: loaded (/usr/lib/systemd/system/targetclid.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2019-04-10 12:19:51 IST; 2h 17min ago
Main PID: 3950 (targetclid)
Tasks: 3 (limit: 4915)
CGroup: /system.slice/targetclid.service
└─3950 /usr/bin/python /usr/bin/targetclid
Apr 10 12:19:51 localhost.localdomain systemd[1]: Started Targetcli daemon.
$ targetcli help
Usage: /usr/bin/targetcli [--version|--help|CMD|--tcp]
--version Print version
--help Print this information
CMD Run targetcli shell command and exit
<nothing> Enter configuration shell
--tcp CMD Pass targetcli command to targetclid
--tcp <nothing> Enter multi-line command mode for targetclid
See man page for more information.
One line command usage:
----------------------
$ targetcli --tcp CMD
Eg:
$ targetcli --tcp pwd
/
Multiple line commands usage:
----------------------------
$ targetcli --tcp
CMD1
CMD2
.
.
CMDN
exit
Eg:
$ targetcli --tcp
^Tab
/ backstores/ iscsi/ loopback/ vhost/ xen-pvscsi/ cd
clearconfig exit get help ls pwd refresh
restoreconfig saveconfig set status
pwd
get global logfile
get global auto_save_on_exit
/ saveconfig
exit
output follows:
/
logfile=/var/log/gluster-block/gluster-block-configshell.log
auto_save_on_exit=false
Configuration saved to /etc/target/saveconfig.json
Stats with and without changes:
------------------------------
Running simple 'pwd' command after creating 1000 blocks on a node:
Without this change:
$ time targetcli pwd
/
real 0m8.963s
user 0m7.775s
sys 0m1.103s
with daemonize changes:
$ time targetcli --tcp "pwd"
/
real 0m0.126s
user 0m0.099s
sys 0m0.024s
Thanks to Maurizio for hangingout with me for all the discussions involved.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\ \
| |/
|/| |
Do not remove the first digit when auto-completing the TPG tag
|
|/
|
|
|
|
|
|
|
|
| |
Instead of removing the first three characters of the "tpg" prefix to
get matches for the TPG tag number, the code removes four characters,
thus erasing the first digit of the TPG tag number.
This patches fixes issue #134.
Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
|
|\
| |
| | |
Remove the extra semicolon in _save_backups
|
|/
|
|
| |
Signed-off-by: tang.wenji <tang.wenji@zte.com.cn>
|
|\
| |
| | |
Add emulate_pr backstore attribute
|
| |
| |
| |
| |
| |
| |
| |
| | |
Added to the kernel via b49d6f7885306ee636d5c1af52170f3069ccf5f7, the
emulate_pr attribute can be used to disable support for SCSI-2
(RESERVE/RELEASE) and Persistent Reservations.
Signed-off-by: David Disseldorp <ddiss@suse.de>
|
|\ \
| | |
| | | |
targetcli-fb: Fix raise exception error in _save_backups
|
|/ /
| |
| |
| | |
Signed-off-by: Leo Zhang <nguzcf@gmail.com>
|
|\ \
| | |
| | | |
saveconfig: compress the backup config files
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have noticed saveconfig.json with 100 storage objects and 100 targets
(each holding a single tpg and a portal) consumes disk space around ~500K.
Which is very expensive, and backing-up such 100 saveconfig.json files will
take ~50M of disk space under /etc/target/backup/
And at scale like 1000 storage objects and targets, this will become worst.
Hence this patch attempts to compress(gzip) and store saveconfig.json while
backing-up.
Saved space example:
[root@localhost ~]# targetcli ls | grep -e "user:glfs" -e "iscsi"
| o- user:glfs ......................... [Storage Objects: 100]
o- iscsi ............................... [Targets: 100]
[root@localhost ~]# du -sh /etc/target/saveconfig.json
448K /etc/target/saveconfig.json
[root@localhost ~]# du -sh /etc/target/backup/saveconfig-20181128-18\:20\:43-json.gz
12K /etc/target/backup/saveconfig-20181128-18:20:43-json.gz
Reducing disk usage per backup file from 448K to 12K is very efficient right.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
|
|\ \
| | |
| | | |
targetcli-fb: Add support for media change
|
| | |
| | |
| | |
| | |
| | | |
Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Mike Christie mchristi@redhat.com
|
|\ \ \
| | | |
| | | | |
fix the parameter of define_config_group_param
|
|/ / /
| | |
| | |
| | | |
Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
|
|\ \ \
| | | |
| | | | |
saveconfig: handle backups with block-level delete
|
|/ / /
| | |
| | |
| | | |
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\ \ \
| |/ /
|/| | |
[targetcli] saveconfig: way for block-level save with delete command
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
currently, we can use block-level save feature for create command and
reconfig of different attributes, but there is no way to use block-level
feature for delete command.
This patch introduces 'save' flag (False on default), which can trigger
saveconfig internally as part of delete command.
$ targetcli /backstores/user:glfs delete test save=True
Deleted storage object test.
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\ \
| | |
| | | |
create: add a way to set control string
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
this patch enable users to supply control option, a string containing comma
separated control=value kind tuples, that are passed to the kernel control file.
Example:
$ targetcli /backstores/user:glfs create blockX1 1073741824 \
test@192.168.124.227/block-store/e59309bb-d591-4121-a891-e98ff3416446 \
control="max_data_area_mb=32,hw_max_sectors=256"
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\ \
| |/
|/| |
fix amount of backup files in backup dir
|
|/
|
|
| |
Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
|
|\
| |
| | |
targetcli: support saveconfig per block name
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ targetcli /backstores/user:glfs/block1 help
[...]
AVAILABLE COMMANDS
[...]
- saveconfig [savefile]
- set [group] [parameter=value...]
- status
- version
$ targetcli /backstores/user:glfs/block1 saveconfig
Storage Object 'user:block1' config saved to /etc/target/saveconfig.json
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
|
|\
| |
| | |
Allow to customize a home directory
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In some cases, it looks reasonable to have a separate preference file.
For example, we have a set of scripts to configure iscsi targets, and we
want to have a separate preference file for these scripts.
Signed-off-by: Andrei Vagin <avagin@openvz.org>
|
|\ \
| |/
|/| |
Fix default max_backup_files in ui_command_saveconfig
|