[libvirt-users] VM migration upon shutdown in centos 7

Michal Privoznik mprivozn at redhat.com
Fri Jan 12 10:16:49 UTC 2018


On 01/12/2018 11:08 AM, Raman Gupta wrote:
> Hi,
> 
>> I don't see your service being called.

> It started when system started, see logs:
> Jan 12 14:59:42 desktop4 systemd: systemd 219 running in system mode. (+PAM
> +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP
> +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
> Jan 12 14:59:42 desktop4 systemd: Detected architecture x86-64.
> Jan 12 14:59:42 desktop4 systemd: Set hostname to <desktop4>.
> Jan 12 14:59:42 desktop4 systemd: Started Create list of required static
> device nodes for the current kernel.
> Jan 12 14:59:42 desktop4 systemd: Started *vPreShutdownHook*.
> Jan 12 14:59:42 desktop4 systemd: Starting Create Static Device Nodes in
> /dev...

Oh, these are new.

> 
>> Anyway, look at libvirt-guests.service file. Looks like the following
> lines cause systemd to wait for a command to finish:
> The libvirt-guests.service is NOT running in either of my nodes, even
> though VM is working fine.

I did not say to run the service. I said to take a look at the service
file because it implements what you want - waiting for a command to finish.

> 
> I tried starting  libvirt-guests.service and added it as Requires target in
> vPreShutdownHook.service,  but it did not help. On reboot the VM did not
> migrated.

It makes no sense to have your service requiring libvrt-guests. Either
libvirt-guests will save all your domains and thus your script has
nothing to migrate, or it will do nothing and then it's just NO-OP.

Michal




More information about the libvirt-users mailing list