Ajout des licences adéquates
This commit is contained in:
parent
811d2b0dd4
commit
203c8e0163
|
@ -1,4 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to commit blocks of vm disks
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
count=$1
|
count=$1
|
||||||
VMs=$(sudo virsh list --state-running --name | sort -R)
|
VMs=$(sudo virsh list --state-running --name | sort -R)
|
||||||
|
|
|
@ -1,4 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to execute a single command to multiple machines
|
||||||
|
# via ssh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
command=$1
|
command=$1
|
||||||
VMs=$(sudo virsh list --state-running --name)
|
VMs=$(sudo virsh list --state-running --name)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to execute scripts on virtual machines via ssh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
script=$1
|
script=$1
|
||||||
VMs=$(sudo virsh list --state-running --name | grep chalec)
|
VMs=$(sudo virsh list --state-running --name | grep chalec)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to migrate multiple virtual machine to another host via ssh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
count=$1
|
count=$1
|
||||||
VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R)
|
VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to migrate multiple virtual machines to another host via ssh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
count=$1
|
count=$1
|
||||||
VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R)
|
VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to migrate a single virtual machine to another host via ssh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
vm=$1
|
vm=$1
|
||||||
|
|
||||||
if [ -z "$(cat /proc/drbd | grep Connected)" ]
|
if [ -z "$(cat /proc/drbd | grep Connected)" ]
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to migrate a signel machine to another host via ssh p2p
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
vm=$1
|
vm=$1
|
||||||
|
|
||||||
echo MIGRATING $vm ...
|
echo MIGRATING $vm ...
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to migrate a single virtual machine to another host via ssh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
vm=$1
|
vm=$1
|
||||||
|
|
||||||
if [ -z "$(cat /proc/drbd | grep Connected)" ]
|
if [ -z "$(cat /proc/drbd | grep Connected)" ]
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to migrate a single virtual machine to another host via ssh p2p
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
vm=$1
|
vm=$1
|
||||||
|
|
||||||
echo MIGRATING $vm ...
|
echo MIGRATING $vm ...
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Old script to restore a backup to a virtual machine disk (PLAN A)
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
vm=$1
|
vm=$1
|
||||||
date=$2
|
date=$2
|
||||||
disk=$3
|
disk=$3
|
||||||
|
|
16
restore.sh
16
restore.sh
|
@ -1,4 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to restore a virtual machine disk with Borg (plan B)
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Exit on error
|
# Exit on error
|
||||||
set -e
|
set -e
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to solve split brain situations by copying things smartly
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
count=$1
|
count=$1
|
||||||
VMs=$(sudo virsh list --state-running --name)
|
VMs=$(sudo virsh list --state-running --name)
|
||||||
|
|
||||||
|
|
17
start_all.sh
17
start_all.sh
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to start every virtual machine on a given host
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
VMs=$(sudo virsh list --all --name)
|
VMs=$(sudo virsh list --all --name)
|
||||||
|
|
||||||
for vm in $VMs
|
for vm in $VMs
|
||||||
|
|
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Miscelaneous script related to supervision
|
||||||
|
#
|
||||||
|
# Copyright (C) 2023 Adrien 'neox' Bourmault <neox@a-lec.org>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
ssh $1 < script_superv.sh
|
ssh $1 < script_superv.sh
|
||||||
|
|
||||||
sudo sed -i "s/NAME=.*/NAME=$1/g" superv_script_isengard.sh
|
sudo sed -i "s/NAME=.*/NAME=$1/g" superv_script_isengard.sh
|
||||||
|
|
Loading…
Reference in New Issue