Ripristina un server Kimsufi su un Cloud Ikoula One VPS

Da It Ikoula wiki.
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Ripristina un server Kimsufi su un Cloud Ikoula One VPS

Prima di iniziare il processo ci occuperemo di effettuare un backup di un server Kimsufi [1] ed eseguiremo il ripristino su un VPS CIO.

Ma cos'è il VPS Coud Ikoula One

Cloud Ikoula One [2] è una soluzione chiavi in mano che include uno strumento di orchestrazione, un bilanciamento del carico, regole del firewall e un'API compatibile con EC2.

I vantaggi di Cloud Ikoula One

  • Controllo dei costi: fatturazione stabilita in anticipo
  • Un'infrastruttura dedicata: schieramento di organismi privati
  • Garanzia a bassa latenza
  • Uno strumento di orchestrazione
  • Managed Services [3]

Preparare il serveur Kimsufi

  • Avvia la macchina virtuale su un liveCD, ad esempio DebianLive
  • Definire un nome host per identificare facilmente la destinazione del restauro
root@debian:~#  hostname testrestore
  • Installazione di Acronis Agent Installation_agent_Linux[4]
  • Crea partizioni manualmente
  • Nel caso in cui non si desideri avere tanto spazio su disco
root@debian:~# fdisk /dev/xvda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition number (1-128, default 1):
First sector (34-209715166, default 2048): 40
Last sector, +/-sectors or +/-size{K,M,G,T,P} (40-209715166, default 209715166): 2048

Created a new partition 1 of type 'Linux filesystem' and of size 1004.5 KiB.

Command (m for help): n
Partition number (2-128, default 2):
First sector (2049-209715166, default 4096):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (4096-209715166, default 209715166): +97G

Created a new partition 2 of type 'Linux filesystem' and of size 97 GiB.

Command (m for help): n
Partition number (3-128, default 3):
First sector (203427840-209715166, default 203427840):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (203427840-209715166, default 209715166):

Created a new partition 3 of type 'Linux filesystem' and of size 3 GiB.

Command (m for help): t
Partition number (1-3, default 3): 1
Partition type (type L to list all types): 4

Changed type of partition 'Linux filesystem' to 'BIOS boot'.

Command (m for help): t
Partition number (1-3, default 3):
Partition type (type L to list all types): 19

Changed type of partition 'Linux filesystem' to 'Linux swap'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

root@debian:~#
    • Se si dispone di un backup

backup

sfdisk -d /dev/sda > partition.bak

Restoration :

sfdisk /dev/xvda < partition.bak
  • Formattazione delle partizioni :
root@debian:~# mkfs.ext4 /dev/xvda2
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 25427968 4k blocks and 6356992 inodes
Filesystem UUID: 675556c0-d8a0-4c4e-b1fd-87d2b3a0f19e
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done
Writing inode tables: done
Creating journal (131072 blocks): done
Writing superblocks and filesystem accounting information: done

root@debian:~# mkswap /dev/xvda3
mkswap: /dev/xvda3: warning: wiping old swap signature.
Setting up swapspace version 1, size = 3 GiB (3219103744 bytes)
no label, UUID=315aee13-ed19-4408-8d20-74253a3edbff
root@debian:~# 
  • Assemblaggio di partizioni o della partizione nel nostro caso: :
root@debian:~# mount /dev/xvda1 /mnt

Ripristino

Dall'interfaccia Acronis, ripristineremo

  • Selezionare il server da ripristinare e fare clic su Ripristina

Recover-ovh.png

  • Cliccare su Ripristino More ways to recover... per scegliere la destinazione del catering..

Recover-select-host.png

  • Cliccare su Recover... e poi su File / Files/folders'

Recover-files-folders-ovh.png

  • Naviga nell'interfaccia per scegliere tutti i file e le cartelle inclusi in una partizione

Recover-files-ovh.png

  • Conferma la destinazione, scegli il montaggio del ripristino della partizione

Recover-start-ovh.png

  • Non selezionare il reboot della destinazione perché non abbiamo terminato

Recover-proceed.png

Ripristino del grub

Per questo useremo il metodo grub-install in un chroot.

  • Monteremo l'ambiente necessario per eseguire l'installazione di grub in un chroot
mount --bind /dev/ /mnt/dev
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys

Ora stiamo avviando il chroot e lanciando un aggiornamento-grud

root@debian:~# chroot /mnt/
root@testrestore:/# grub-install
Installation pour la plate-forme i386-pc.
grub-install : erreur : le périphérique d'installation n'est pas indiqué.
root@testrestore:/# grub-install /dev/xvda
Installation pour la plate-forme i386-pc.
Installation terminée, sans erreur.
root@testrestore:/#
  • Modificatore di file / Etc / fstab da tenere in considerazione
root@testrestore:/# cat /etc/fstab
UUID="675556c0-d8a0-4c4e-b1fd-87d2b3a0f19e" / ext4 defaults 0 0
UUID="2ca7f39a-6609-884a-ac1e-8456b66ca755" swap swap defaults 0 0
root@testrestore:/# blkid
/dev/xvda2: UUID="675556c0-d8a0-4c4e-b1fd-87d2b3a0f19e" TYPE="ext4" PARTUUID="ba22cf4d-5988-254b-9f28-d58bc50f7a4f"
/dev/xvda3: UUID="315aee13-ed19-4408-8d20-74253a3edbff" TYPE="swap" PARTUUID="2ca7f39a-6609-884a-ac1e-8456b66ca755"
/dev/sr0: UUID="2019-11-16-10-15-29-00" LABEL="d-live 10.2.0 st amd64" TYPE="iso9660" PTUUID="1bf56f01" PTTYPE="dos"
/dev/loop0: TYPE="squashfs"
/dev/xvda1: PARTUUID="f40c93d3-7954-784b-afbb-608d428571fc"

root@testrestore:/#

Andiamo oltre

Per migliorare la compatibilità dei server [5] con l'ambiente cloud CIO e XenServer, adesso saremo in grado di installare cloud-init e XenTools: https://fr-wiki.ikoula.com/fr/Installation_des_XenTools_sur_une_instance_CloudStack

Adattatore di configurazione

  • Questa migrazione comporterà una modifica dell'indirizzo IP, dovrai adattare i file di configurazione del servizio (apache, MariaDB, bind, ...) in modo che traccino con gli indirizzi IP del CIO.
  • Nel caso in cui usi un plesk, [5] qui è un KB che ti permetterà di effettuare questa modifica in modo più semplice. Come modificare l'indirizzo IP utilizzato da Plesk