Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Note: This project is not currently being maintained.

# cockpit-gluster
A [cockpit](https://github.com/cockpit-project/cockpit) plugin that provides a status view and volume actions for a gluster cluster with [glusterd2](https://github.com/gluster/glusterd2)(GD2) based bricks.

Expand Down
60 changes: 32 additions & 28 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@


cluster_count = 1
node_disk_count = 2 #Changing this won't do anything because creating disks in a loop doesn't seem to work.
node_data_disk_count = 2
driveletters = ('a'..'z').to_a
disk_size = 20 #GB
cpus = 2
memory = 2048

node_count = cluster_count * 3
total_disks = node_count * node_disk_count
total_disks = node_count * node_data_disk_count
total_disk_usage = total_disks * disk_size
enable_glusterd2_rest_auth = false

Vagrant.configure(2) do |config|
puts "Creating #{cluster_count} clusters."
puts "Creating #{node_count} nodes."
puts "Creating #{node_disk_count} disks(#{disk_size}G) each."
puts "Creating #{node_data_disk_count} data disks (#{disk_size}G) each."
puts "Using #{total_disk_usage} GB!."

(1..node_count).reverse_each do |num|
Expand All @@ -23,35 +26,33 @@ Vagrant.configure(2) do |config|

node.vm.box = "centos/7"
node.vm.synced_folder ".", "/vagrant", disabled: true
node.vm.network "private_network", ip: vm_ip
node.vm.network "private_network",
:ip => vm_ip,
:libvirt__driver_queues => "#{cpus}"
node.vm.post_up_message = "VM private ip: #{vm_ip}"
node.vm.hostname = "gd2-node-#{num}"

node.vm.provider "libvirt" do |lvt|
lvt.memory = 1024
lvt.nested = true
lvt.cpu_mode = "host-model"
lvt.memory = "#{memory}"
lvt.cpus = "#{cpus}"
lvt.nested = false
lvt.cpu_mode = "host-passthrough"
lvt.volume_cache = "writeback"
lvt.graphics_type = "none"
lvt.video_type = "vga"
lvt.video_vram = 1024
# lvt.usb_controller :model => "none" # (requires vagrant-libvirt 0.44 which is not in Fedora yet)
lvt.random :model => 'random'
lvt.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio'
#disk_config
lvt.storage :file, :size => "#{disk_size}G"
lvt.storage :file, :size => "#{disk_size}G"
disks = []
(2..(node_data_disk_count+1)).each do |d|
lvt.storage :file, :device => "vd#{driveletters[d]}", :size => "#{disk_size}G"
disks.push "/dev/vd#{driveletters[d]}"
end

end


#broken
# node.vm.provider "virtualbox" do |vb|
# vb.memory = 1024
# vb.customize ['storagectl', :id, '--name', 'SATA Controller', '--add', 'sata', '--portcount', node_disk_count]
# (1..node_disk_count).each do |disk_num|
# disk_path = "./virtualbox_disks/node-#{num}-disk-#{disk_num}.vdi"
# if not File.exists?(disk_path)
# vb.customize ['createhd', '--filename', disk_path, '--variant', 'Standard', '--size', node_disk_count * 1024]
# end
# vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', disk_num, '--device', 0, '--type', 'hdd', '--medium', disk_path]
# end
# end


if num == 1
node.vm.synced_folder "./dist", "/root/.local/share/cockpit/gluster-management", type: "rsync", create: true, rsync__args: ["--verbose", "--archive", "--delete", "-z"]
node.vm.synced_folder "./ansible/", "/etc/ansible//", type: "rsync", create: true, rsync__args: ["--verbose","--archive"]
Expand All @@ -62,8 +63,9 @@ Vagrant.configure(2) do |config|
node.vm.provision "shell", inline: <<-SHELL
set -u

yum update -y
yum install -y util-linux # for chfn

yum update -y --disableplugin=subscription-manager --downloaddir=/dev/shm
yum install -y --disableplugin=subscription-manager --downloaddir=/dev/shm util-linux

echo foobar | passwd --stdin root
getent passwd admin >/dev/null || useradd -c Administrator -G wheel admin
Expand All @@ -73,7 +75,7 @@ Vagrant.configure(2) do |config|



yum install -y \
yum install -y --disableplugin=subscription-manager --downloaddir=/dev/shm \
storaged \
storaged-lvm2 \
yum-utils \
Expand All @@ -85,7 +87,7 @@ Vagrant.configure(2) do |config|
curl -o /etc/yum.repos.d/gd2-master.repo http://artifacts.ci.centos.org/gluster/gd2-nightly/gd2-master.repo
curl -o /etc/yum.repos.d/sac-gluster-ansible-epel-7.repo https://copr.fedorainfracloud.org/coprs/sac/gluster-ansible/repo/epel-7/sac-gluster-ansible-epel-7.repo
curl -o /etc/yum.repos.d/glusterfs-nightly-master.repo http://artifacts.ci.centos.org/gluster/nightly/master.repo
yum install -y \
yum install -y --disableplugin=subscription-manager --downloaddir=/dev/shm \
glusterd2 \
gluster-ansible python-gluster-mgmt-client \
glusterfs-server glusterfs-fuse glusterfs-api
Expand All @@ -105,6 +107,8 @@ Vagrant.configure(2) do |config|
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
fi

rm -rf /dev/shm/yumdb

if [[ #{num} -eq 1 ]]
then
for i in {10..#{node_count+10}}
Expand Down
Binary file added screenshots/ExpandClusterMultipleAddHosts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/GlusterManagementUpdates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions screenshots/cockpit-gluster-update-plans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Cockpit Gluster Update!

Hey! We are adding a few features to cockpit-gluster.
Adding a few mockups along with it for review and comments.
The mockups are rather rough and just depict the solution a little roughly.
The CSS Styling will be inline with patternfly as before

* Adding more options and actions to Gluster Management Page
Adding an option to start/stop volumes, setting gluster volume options.

![Gluster Management Dashboard Image](GlusterManagementUpdates.png?raw=true "Gluster Management Dashboard")

* Adding multi-host support. Until now you could expand only 3 hosts at a time through the expand cluster wizard. Planning to change it to a multi-host support.
Now there will be only a single field as default in the first step, and a Add Host button which will add more hosts as needed

![Expand Cluster Multiple Add Host](ExpandClusterMultipleAddHosts.png?raw=true "Expand Cluster Multiple Add Host")

* Volume Creation is optional
All fields are inactive when the Add Volumes checkbox is unchecked

![Expand Cluster Optional Volume Creation Unchecked](ExpandClusterOptionalVolumeCreationUnchecked.png?raw=true "Expand Cluster Optional Volume Creation Unchecked")

* When the volume is checked, the fields are activated and multiple volumes can be added similar to the multiple hosts.

![Expand Cluster Optional Volume Creation Checked](ExpandClusterOptionalVolumeCreationChecked.png?raw=true "Expand Cluster Optional Volume Creation Checked")

* EC and Replica volume support.
Since there are multiple hosts and volume will not be created on all hosts like before. Providing options to select the hosts on which the replica volume need to be created through a multiple select checkbox. In case of EC Volumes, Taking inputs as Redundancy Count and Disperse Data Count and also selecting the hosts on which the bricks for the volumes will be formed

![Expand Cluster Multiple Host Selection and Disperse Volumes](ExpandClusterMultipleHostSelectionandDisperseVolumes.png?raw=true "Expand Cluster Multiple Host Selection and Disperse Volumes")

Now taking information from volumes tab we will automatically list bricks on each host according to the volume configurations mentioned in the volumes tab. The user won’t be able to add/delete bricks on the bricks tab. In case there are any changes that need to be made after reviewing the bricks tab, the user will have to make the changes under the volumes tab again.