0

I have two CentOS KVM servers with some virtual machines: A and B

I am running as Primary on A and Secondary on B. When A fails I am able to switch DRBD on B to Primary and access the disk images there (qcow2 images). However, I am having some issues configuring it properly because my virtual machines are trying to start before the shared storage mount (with qcow2 images). This triggers errors such as "Cannot access storage file" and "No such file or directory\nocf-exit-reason:Failed to start virtual domain MyVirtMachine.". How can I fix this?

Ps: This question is related to DRBD & KVM replication is possible?

Luis
  • 1

1 Answers1

0

However, I am having some issues configuring it properly because my virtual machines are trying to start before the shared storage mount (with qcow2 images).

The easy answer here is, simply, don't start the VMs until after the shared storage is available.

The question comments show you're using pcs, so I assume you're using Pacemaker to manage this cluster. See the Pacemaker documentation here: https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html/Clusters_from_Scratch/_configure_the_cluster_for_drbd.html

The above example starts a filesystem resource after DRBD has been promoted to primary. You could easily swap out that filesystem resource for a VirtualDomain resource in your case, or configure pacemaker to start the VirtualDomains after the filesystem mount with additional constraints, if that is what you require.

Dok
  • 1,110
  • 1
  • 7
  • 13