You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Execution fails - because there aren't enough bricks (2) to provision the volume... I got curious and found the following after debugging:
In the append_host_name() method of the volume module, you use zip to combine the hosts and the bricks into something you can execute later with _run_command(). This is where the main problem is, as this little example explains:
As you can see - since the number of brick paths is lower than the number of hosts (which is usually the case) the zip method does not work!
The only workaround I have found is to include the hosts directly to the module in the bricks variable. When the module detects that we already have hosts in there, it skips all these tasks...
For reference purposes, my debug output from the module is:
DEBUG:root:[_validated_params] Checking option: action
DEBUG:root:[_validated_params] Checking option: volume
DEBUG:root:[get_host_names] Result hosts list is: ['192.168.44.100', '192.168.44.101']
DEBUG:root:[_validated_params] Checking option: replica_count
DEBUG:root:[get_volume_configs] Option is: replica 2
DEBUG:root:[_validated_params] Checking option: bricks
DEBUG:root:[append_host_name] Start hosts list is: ['192.168.44.100', '192.168.44.101']
DEBUG:root:[append_host_name] Start brick list is: ["['/rhgs/bricks/brick1/rep01', '/rhgs/bricks/brick1/rep01']"]
DEBUG:root:[append_host_name] Result brick list is: ["192.168.44.100:'/rhgs/bricks/brick1/rep01'", "192.168.44.100:'/rhgs/bricks/brick1/rep01'"]
DEBUG:root:[get_brick_list_of_all_hosts] Returned brick list is: 192.168.44.100:'/rhgs/bricks/brick1/rep01' 192.168.44.100:'/rhgs/bricks/brick1/rep01'
DEBUG:root:[append_host_name] Start hosts list is: ['192.168.44.100', '192.168.44.101']
DEBUG:root:[append_host_name] Start brick list is: ["['/rhgs/bricks/brick1/rep01', '/rhgs/bricks/brick1/rep01']"]
DEBUG:root:[append_host_name] Result brick list is: ["192.168.44.100:'/rhgs/bricks/brick1/rep01'", "192.168.44.100:'/rhgs/bricks/brick1/rep01'"]
DEBUG:root:[_run_command] Command Executed: /sbin/gluster volume create rep01 replica 2 192.168.44.100:'/rhgs/bricks/brick1/rep01' 192.168.44.100:'/rhgs/bricks/brick1/rep01' --mode=script
The text was updated successfully, but these errors were encountered:
When trying to create a volume with:
Execution fails - because there aren't enough bricks (2) to provision the volume... I got curious and found the following after debugging:
In the
append_host_name()
method of the volume module, you usezip
to combine the hosts and the bricks into something you can execute later with_run_command()
. This is where the main problem is, as this little example explains:As you can see - since the number of brick paths is lower than the number of hosts (which is usually the case) the zip method does not work!
The only workaround I have found is to include the hosts directly to the module in the
bricks
variable. When the module detects that we already have hosts in there, it skips all these tasks...For reference purposes, my debug output from the module is:
The text was updated successfully, but these errors were encountered: