« Debian/Xenserver » : différence entre les versions

De TartareFR
Aller à la navigation Aller à la recherche
 
(4 versions intermédiaires par le même utilisateur non affichées)
Ligne 86 : Ligne 86 :
apt-key adv --recv-keys --keyserver pool.sks-keyservers.net 1285491434D8786F  
apt-key adv --recv-keys --keyserver pool.sks-keyservers.net 1285491434D8786F  
aptitude update
aptitude update
aptitude install srvadmin-all
aptitude install srvadmin-all snmpd
</syntaxhighlight>
 
Activation d'OMSA SNMP<ref>tuto prevenant de http://blog.brachium-system.net/archives/70-Debian-Dell-OMSA-SNMP.html</ref>
 
* Activation de SNMP dans OMSA<syntaxhighlight lang="bash">/etc/init.d/dataeng enablesnmp</syntaxhighlight>
* Restart du Data Engine System d'OMSA<syntaxhighlight lang="bash">/etc/init.d/dataeng restart</syntaxhighlight>
* Edition du fichier <path>/etc/default/snmpd</path> pour virer <code>-I -smux</code>
* Edition du fichier /etc/snmp/snmpd.conf
<pre>
com2sec local          localhost                      public
com2sec local          127.0.0.1                      public
com2sec local          192.168.0.0/24                  public
group MyRWGroup        v1                              local
group MyRWGroup        v2c                            local
group MyRWGroup        usm                            local
view all                                        included  .1      80
access MyRWGroup ""      any      noauth    exact  all    all    none
syslocation B2PWeb
syscontact srs@b2pweb.com
sysName virt2.b2pweb.com
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro
 
# Allow Systems Management Data Engine SNMP to connect to snmpd using SMUX
smuxpeer .1.3.6.1.4.1.674.10892.1
</pre>
 
test
<syntaxhighlight lang="bash">
snmpwalk -v2c -c public localhost 1.3.6.1.4.1.674.10893
</syntaxhighlight>
</syntaxhighlight>


Ligne 151 : Ligne 181 :


=== Réseau ===
=== Réseau ===
cat << EOF > /etc/network/interfaces
 
Modification du fichier <path>/etc/network/interfaces</path> pour bridger automatiquement notre interface réseau eth0
<pre>
# This file describes the network interfaces available on your system
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# and how to activate them. For more information, see interfaces(5).
Ligne 162 : Ligne 194 :
iface br0 inet dhcp
iface br0 inet dhcp
   bridge_ports eth0
   bridge_ports eth0
EOF
</pre>


reboot
=== Libvirt et virt-manager ===
<syntaxhighlight lang="bash">
aptitude install libvirt-bin virt-manager
</syntaxhighlight>
On modifie le fichier <path>/etc/libvirt/libvirtd.conf</path>
<pre>
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
listen_addr = "0.0.0.0"
unix_sock_group = "libvirt"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"
auth_tcp = "none"
host_uuid = "a850a42b-2aff-484a-81ea-e2c7aee9b9a4"
</pre>


aptitude install libvirt-bin virt-manager
=== CGroup ===


<syntaxhighlight lang="bash">
mkdir /dev/cgroup
</syntaxhighlight>
Ajout de la ligne suivante au fichier <path>/etc/fstab</path>
<pre>
cgroup              /dev/cgroup    cgroup  defaults        0      0
</pre>


== Post installation ==


dpkg-reconfigure dash
* On reconfigure le shell par défaut. En effet il s'agit de <app>dash</app> sur Debian. On répond que, non, on ne veut pas de cet interpreteur par défaut car on aime <app>bash</app><syntaxhighlight lang="bash">dpkg-reconfigure dash</syntaxhighlight>
* On configure le répertoire NFS pour les sauvegardes<syntaxhighlight lang="bash">mkdir /mnt/backup</syntaxhighlight>Ajout de la ligne suivante au fichier <path>/etc/fstab</path><pre>192.168.0.89:/opt/vbox/vbox2    /mnt/backup    nfs    defaults,noatime,rw,hard        0 0</pre>
* On va modifier le path de stockage des images, afin de mettre le chemin Xen<syntaxhighlight lang="bash">virsh pool-edit default</syntaxhighlight>Et on remplace <path>/var/lib/libvirt/images</path> par <path>/var/lib/xen/images</path>
* On génère une paire de clés SSH<syntaxhighlight lang="bash">ssh-keygen -t rsa</syntaxhighlight>
On peut maintenant rebooter le serveur
<syntaxhighlight lang="bash">
reboot
</syntaxhighlight>


echo 'cgroup              /dev/cgroup    cgroup  defaults        0      0' >> /etc/fstab
== Références ==
echo '192.168.0.89:/opt/vbox/vbox2    /mnt/backup    nfs    defaults,noatime,rw,hard        0 0' >> /etc/fstab
<references/>
mkdir /mnt/backup
mkdir /dev/cgroup
mount -a

Dernière version du 13 décembre 2013 à 07:16

Installation minimale

Télécharger le driver BNX2 Debian pour les cartes réseaux et le stocker sur une clé USB qui sera insérée au démarrage de l'installation.

Depuis un DVD d'installation:

  • installation minimale
  • paquet openssh-server

Modification du fichier <path>/etc/apt/sources.list</path> (ou copie depuis virt2 ou virt3)

deb http://ftp.fr.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ wheezy main contrib non-free

deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

# wheezy-updates, previously known as 'volatile'
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
deb http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
deb-src http://ftp.debian.org/debian/ wheezy-updates main contrib non-free
  • On met le système à jour
    aptitude update && aptitude upgrade
    
  • On installe les logiciels indispensables
    aptitude install vim ntp
    
Warning.png
Network Manager
network-manager doit absolument être désactivé
echo "manual" > /etc/init/network-manager.override

Installation du serveur de virtualisation

Xen

On installe Xen

aptitude install xen-hypervisor-amd64 xen-linux-system-amd64 xen-utils xen-tools bridge-utils xfsprogs

On modifie le fichier de configuration de Xen: <path>/etc/xen/xend-config.sxp</path>

(logfile /var/log/xen/xend.log)
(loglevel DEBUG)
(xend-http-server yes)
(xend-unix-server yes)
(xend-tcp-xmlrpc-server yes)
(xend-unix-xmlrpc-server yes)
(xend-relocation-server yes)
(xend-relocation-ssl-server no)
(xend-udev-event-server no)
(xend-unix-path /var/lib/xend/xend-socket)
(xend-tcp-xmlrpc-server-address '0.0.0.0')
(xend-tcp-xmlrpc-server-port 8006)
(xend-port            8000)
(xend-relocation-port 8002)
(xend-address '')
(xend-relocation-address '')
(xend-relocation-hosts-allow '^localhost$ ^.*\\.b2pweb\\.com$')
(network-script network-dummy)
(vif-script vif-bridge)
(dom0-min-mem 1024)
(enable-dom0-ballooning no)
(total_available_memory 0)
(dom0-cpus 1)
(vnc-listen '0.0.0.0')
(vncpasswd '')
(keymap 'fr')

Ajout au fichier <path>/etc/default/grub</path>

GRUB_CMDLINE_XEN="dom0_mem=1024M dom0_max_vcpus=1 dom0_vcpus_pin" 
GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=1024M dom0_max_vcpus=1 dom0_vcpus_pin"

Pour être sûr que xen soit le premier de la liste (donc celui qui démarre par défaut)

cd /etc/grub.d/
ln -s 20_linux_xen 09_linux_xen
update-grub

Open Manage

echo 'deb http://linux.dell.com/repo/community/debian wheezy openmanage' > /etc/apt/sources.list.d/linux.dell.com.sources.list
apt-key adv --recv-keys --keyserver pool.sks-keyservers.net 1285491434D8786F 
aptitude update
aptitude install srvadmin-all snmpd

Activation d'OMSA SNMP[1]

  • Activation de SNMP dans OMSA
    /etc/init.d/dataeng enablesnmp
    
  • Restart du Data Engine System d'OMSA
    /etc/init.d/dataeng restart
    
  • Edition du fichier <path>/etc/default/snmpd</path> pour virer -I -smux
  • Edition du fichier /etc/snmp/snmpd.conf
com2sec local           localhost                       public
com2sec local           127.0.0.1                       public
com2sec local           192.168.0.0/24                  public
group MyRWGroup         v1                              local
group MyRWGroup         v2c                             local
group MyRWGroup         usm                             local
view all                                         included  .1       80
access MyRWGroup ""      any       noauth    exact  all    all    none
syslocation B2PWeb
syscontact srs@b2pweb.com
sysName virt2.b2pweb.com
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
extend .1.3.6.1.4.1.2021.7890.1 distro /usr/bin/distro

# Allow Systems Management Data Engine SNMP to connect to snmpd using SMUX
smuxpeer .1.3.6.1.4.1.674.10892.1

test

snmpwalk -v2c -c public localhost 1.3.6.1.4.1.674.10893

Megacli

echo 'deb http://hwraid.le-vert.net/debian wheezy main' >  /etc/apt/sources.list.d/hwraid.sources.list
wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | apt-key add -
aptitude update
aptitude install megacli

x2go

apt-key adv --recv-keys --keyserver keys.gnupg.net E1F958385BFE2B6E
cat << 'EOF' >> /etc/apt/sources.list.d/x2go.list
# X2Go Repository
deb http://packages.x2go.org/debian wheezy main
# X2Go Repository (sources)
deb-src http://packages.x2go.org/debian wheezy main
EOF
aptitude update
aptitude install x2goserver gnome-session

!!! Désactivation de sfcbd update-rc.d sfcb disable

OCS Inventory

aptitude install ocsinventory-agent

choisir http et mettre http://in.b2pweb.com/ocsinventory comme serveur

echo 'tag=Serveurs_LAN' >> /etc/ocsinventory/ocsinventory-agent.cfg

NRPE pour Nagios

aptitude install nagios-nrpe-server nagios-plugins

ajout du réseau local dans le fichier /etc/nagios/nrpe.cfg

allowed_hosts=127.0.0.1,192.168.0.0/24
dont_blame_nrpe=1

Paquet nagios-plugins-b2pweb

wget -O - http://koji.b2pweb.com/repos/debian/DEB-GPG-KEY-B2PWEB-ALL
echo 'deb http://koji.b2pweb.com/repos/debian wheezy main' >> /etc/apt/sources.list
aptitude update && aptitude install nagios-plugins-b2pweb

On redémarre le service NRPE

service nagios-nrpe-server restart

Réseau

Modification du fichier <path>/etc/network/interfaces</path> pour bridger automatiquement notre interface réseau eth0

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto br0
iface br0 inet dhcp
   bridge_ports eth0

Libvirt et virt-manager

aptitude install libvirt-bin virt-manager
On modifie le fichier <path>/etc/libvirt/libvirtd.conf</path>
listen_tls = 0
listen_tcp = 1
tcp_port = "16509"
listen_addr = "0.0.0.0"
unix_sock_group = "libvirt"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"
auth_tcp = "none"
host_uuid = "a850a42b-2aff-484a-81ea-e2c7aee9b9a4"

CGroup

mkdir /dev/cgroup

Ajout de la ligne suivante au fichier <path>/etc/fstab</path>

cgroup              /dev/cgroup     cgroup  defaults        0       0

Post installation

  • On reconfigure le shell par défaut. En effet il s'agit de <app>dash</app> sur Debian. On répond que, non, on ne veut pas de cet interpreteur par défaut car on aime <app>bash</app>
    dpkg-reconfigure dash
    
  • On configure le répertoire NFS pour les sauvegardes
    mkdir /mnt/backup
    
    Ajout de la ligne suivante au fichier <path>/etc/fstab</path>
    192.168.0.89:/opt/vbox/vbox2    /mnt/backup     nfs     defaults,noatime,rw,hard        0 0
  • On va modifier le path de stockage des images, afin de mettre le chemin Xen
    virsh pool-edit default
    
    Et on remplace <path>/var/lib/libvirt/images</path> par <path>/var/lib/xen/images</path>
  • On génère une paire de clés SSH
    ssh-keygen -t rsa
    

On peut maintenant rebooter le serveur

reboot

Références