Il y a 389 articles et 19 utilisateurs inscrits (ce bandeau est défini dans MediaWiki:Sitenotice)

« Migration d'une VM Proxmox à chaud » : différence entre les versions

De AJLSM
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
 
(4 versions intermédiaires par 2 utilisateurs non affichées)
Ligne 3 : Ligne 3 :
# Un cluster Proxmox
# Un cluster Proxmox
# Une VM avec une IP issue d'un bloc vRack
# Une VM avec une IP issue d'un bloc vRack
# Vérifier que les disques "dur sont non locaux", sinon il faut utiliser migrate with-local-disks option (cf. infra)
# Vérifier que l'interface CD/ROM est vide (ouvrir l'interface et cocher la case "Do not use any media").
== Migration depuis l'interface GUI ==
== Migration depuis l'interface GUI ==
Proxmox permet de migrer à chaud une VM directement depuis l'interface GU. Pour cela, faire un clic droit sur le nom de la VM et sélectionner "Migration".  
Proxmox permet de migrer à chaud une VM directement depuis l'interface GUI. Pour cela, faire un clic droit sur le nom de la VM et sélectionner "Migration".  


[[Fichier:Migration-103-2.png]]
[[Fichier:Migration-103-2.png]]
Ligne 19 : Ligne 22 :
2019-05-16 14:03:42 ERROR: migration aborted (duration 00:00:00): Failed to sync data - can't migrate VM - check log
2019-05-16 14:03:42 ERROR: migration aborted (duration 00:00:00): Failed to sync data - can't migrate VM - check log
TASK ERROR: migration aborted</syntaxhighlight>
TASK ERROR: migration aborted</syntaxhighlight>
== Migration with-local-disks en ligne de commande ==
== Migration with-local-disks en ligne de commande ==
Depuis le serveur Proxmox où se trouve la VM, lancer la commande suivante :
Depuis le serveur Proxmox où se trouve la VM, lancer la commande suivante :
Ligne 74 : Ligne 78 :
2019-05-28 08:57:03 migration finished successfully (duration 00:05:28)</syntaxhighlight>
2019-05-28 08:57:03 migration finished successfully (duration 00:05:28)</syntaxhighlight>
[[category:Proxmox]]
[[category:Proxmox]]
=== Second type d'erreur ===
Si dans les log, l'erreur suivante apparaît:
<syntaxhighlight lang="bash">
2019-06-28 10:38:04 starting migration of VM 108 to node 'sun' (51.75.129.136)
2019-06-28 10:38:04 found local disk 'local:108/vm-108-disk-0.qcow2' (in current VM config)
2019-06-28 10:38:04 found local disk 'local:iso/ubuntu-18.04.2-server-amd64.iso' (in current VM config)
2019-06-28 10:38:04 can't migrate local disk 'local:iso/ubuntu-18.04.2-server-amd64.iso': local cdrom image
2019-06-28 10:38:04 ERROR: Failed to sync data - can't migrate VM - check log
2019-06-28 10:38:04 aborting phase 1 - cleanup resources
2019-06-28 10:38:04 ERROR: migration aborted (duration 00:00:00): Failed to sync data - can't migrate VM - check log
</syntaxhighlight>
'''Solution :''' Vérifier que l'interface CD/ROM est vide (ouvrir l'interface et cocher la case "Do not use any media").
=== Voir aussi ===
https://www.youtube.com/watch?v=RFyZf99whDg

Dernière version du 18 janvier 2021 à 15:23

Dans un cluster Proxmox, on souhaite faire passer une VM d'un des serveur à un autre à chaud, c'est-à-dire, sans arrêter la VM et ses services. Pour l'utilisateur, l'opération est transparente.

  1. Un cluster Proxmox
  2. Une VM avec une IP issue d'un bloc vRack
  3. Vérifier que les disques "dur sont non locaux", sinon il faut utiliser migrate with-local-disks option (cf. infra)
  4. Vérifier que l'interface CD/ROM est vide (ouvrir l'interface et cocher la case "Do not use any media").

Migration depuis l'interface GUI

[modifier | modifier le wikicode]

Proxmox permet de migrer à chaud une VM directement depuis l'interface GUI. Pour cela, faire un clic droit sur le nom de la VM et sélectionner "Migration".

Cependant, cette fonctionnalité n'est active que pour les VM ayant des disques durs "non locaux". Elle génère l'erreur suivante pour les VM avec un disque local.

2019-05-16 14:03:42 starting migration of VM 108 to node 'sun' (51.75.129.136)
2019-05-16 14:03:42 found local disk 'local:108/vm-108-disk-0.qcow2' (in current VM config)
2019-05-16
 14:03:42 can't migrate local disk 'local:108/vm-108-disk-0.qcow2': 
can't live migrate attached local disks without with-local-disks option
2019-05-16 14:03:42 ERROR: Failed to sync data - can't migrate VM - check log
2019-05-16 14:03:42 aborting phase 1 - cleanup resources
2019-05-16 14:03:42 ERROR: migration aborted (duration 00:00:00): Failed to sync data - can't migrate VM - check log
TASK ERROR: migration aborted

Migration with-local-disks en ligne de commande

[modifier | modifier le wikicode]

Depuis le serveur Proxmox où se trouve la VM, lancer la commande suivante :

qm migrate <l'id de la VM> <le nom duserveur> --online --with-local-disks

Par exemple : Depuis le serveur sun2, on veut migrer la VM 108 vers sun :

qm migrate 108 sun --online --with-local-disks

Voici le log d'une migration réussie (suppression d'une partie du log de la mise en place du mirroring et de la migration) :

root@sun:~# qm migrate 103 sun2 --online --with-local-disks
2019-05-28 08:51:35 starting migration of VM 103 to node 'sun2' (51.77.135.49)
2019-05-28 08:51:35 found local disk 'local:103/vm-103-disk-0.qcow2' (in current VM config)
2019-05-28 08:51:35 copying disk images
2019-05-28 08:51:35 starting VM 103 on remote node 'sun2'
2019-05-28 08:51:37 start remote tunnel
2019-05-28 08:51:37 ssh tunnel ver 1
2019-05-28 08:51:37 starting storage migration
2019-05-28 08:51:37 ide0: start migration to nbd:51.77.135.49:60000:exportname=drive-ide0
drive mirror is starting for drive-ide0
drive-ide0: transferred: 917504 bytes remaining: 107373264896 bytes total: 107374182400 bytes progression: 0.00 % busy: 1 ready: 0 
drive-ide0: transferred: 411041792 bytes remaining: 106963140608 bytes total: 107374182400 bytes progression: 0.38 % busy: 1 ready: 0 
drive-ide0: transferred: 535822336 bytes remaining: 106838360064 bytes total: 107374182400 bytes progression: 0.50 % busy: 1 ready: 0 
drive-ide0: transferred: 651821056 bytes remaining: 106722361344 bytes total: 107374182400 bytes progression: 0.61 % busy: 1 ready: 0 
drive-ide0: transferred: 768606208 bytes remaining: 106605576192 bytes total: 107374182400 bytes progression: 0.72 % busy: 1 ready: 0 
drive-ide0: transferred: 887095296 bytes remaining: 106487087104 bytes total: 107374182400 bytes progression: 0.83 % busy: 1 ready: 0 
drive-ide0: transferred: 1022492672 bytes remaining: 106351689728 bytes total: 107374182400 bytes progression: 0.95 % busy: 1 ready: 0 

[...]

drive-ide0: transferred: 106747133952 bytes remaining: 631570432 bytes total: 107378704384 bytes progression: 99.41 % busy: 1 ready: 0 
drive-ide0: transferred: 106866671616 bytes remaining: 512032768 bytes total: 107378704384 bytes progression: 99.52 % busy: 1 ready: 0 
drive-ide0: transferred: 106988306432 bytes remaining: 390397952 bytes total: 107378704384 bytes progression: 99.64 % busy: 1 ready: 0 
drive-ide0: transferred: 107107844096 bytes remaining: 270860288 bytes total: 107378704384 bytes progression: 99.75 % busy: 1 ready: 0 
drive-ide0: transferred: 107224236032 bytes remaining: 154468352 bytes total: 107378704384 bytes progression: 99.86 % busy: 1 ready: 0 
drive-ide0: transferred: 107378704384 bytes remaining: 0 bytes total: 107378704384 bytes progression: 100.00 % busy: 0 ready: 1 
all mirroring jobs are ready 
2019-05-28 08:56:42 starting online/live migration on unix:/run/qemu-server/103.migrate
2019-05-28 08:56:42 migrate_set_speed: 8589934592
2019-05-28 08:56:42 migrate_set_downtime: 0.1
2019-05-28 08:56:42 set migration_caps
2019-05-28 08:56:42 set cachesize: 268435456
2019-05-28 08:56:42 start migrate command to unix:/run/qemu-server/103.migrate
2019-05-28 08:56:43 migration status: active (transferred 94191813, remaining 2044928000), total 2165383168)
2019-05-28 08:56:43 migration xbzrle cachesize: 268435456 transferred 0 pages 0 cachemiss 0 overflow 0
2019-05-28 08:56:44 migration status: active (transferred 203335739, remaining 1903407104), total 2165383168)

[...]

2019-05-28 08:56:58 migration xbzrle cachesize: 268435456 transferred 0 pages 0 cachemiss 7270 overflow 0
2019-05-28 08:56:58 migration speed: 6.38 MB/s - downtime 101 ms
2019-05-28 08:56:58 migration status: completed
drive-ide0: transferred: 107378900992 bytes remaining: 0 bytes total: 107378900992 bytes progression: 100.00 % busy: 0 ready: 1 
all mirroring jobs are ready 
drive-ide0: Completing block job...
drive-ide0: Completed successfully.
drive-ide0 : finished
2019-05-28 08:57:03 migration finished successfully (duration 00:05:28)

Second type d'erreur

[modifier | modifier le wikicode]

Si dans les log, l'erreur suivante apparaît:

2019-06-28 10:38:04 starting migration of VM 108 to node 'sun' (51.75.129.136)
2019-06-28 10:38:04 found local disk 'local:108/vm-108-disk-0.qcow2' (in current VM config)
2019-06-28 10:38:04 found local disk 'local:iso/ubuntu-18.04.2-server-amd64.iso' (in current VM config)
2019-06-28 10:38:04 can't migrate local disk 'local:iso/ubuntu-18.04.2-server-amd64.iso': local cdrom image
2019-06-28 10:38:04 ERROR: Failed to sync data - can't migrate VM - check log
2019-06-28 10:38:04 aborting phase 1 - cleanup resources
2019-06-28 10:38:04 ERROR: migration aborted (duration 00:00:00): Failed to sync data - can't migrate VM - check log

Solution : Vérifier que l'interface CD/ROM est vide (ouvrir l'interface et cocher la case "Do not use any media").

https://www.youtube.com/watch?v=RFyZf99whDg