GitHub user nickaccuweb added a comment to the discussion: VM cannot start on 
the host, prompting certificate expiration

@maic 

>From the logs you have shared, it appears that the VNC SSL certificate on your 
>KVM host has expired. Due to this, QEMU is unable to initialize the VNC 
>server, which prevents the VM from starting.

You can try the following steps to resolve the issue.

**1. Verify the certificate expiration date**

Log in to the affected KVM host as root and execute the following commands:

bash
date -u
openssl x509 -in /etc/pki/libvirt-vnc/server-cert.pem -noout -dates
openssl x509 -in /etc/cloudstack/agent/cloud.crt -noout -dates

This will help you confirm the expiration dates of both the VNC and CloudStack 
agent certificates.

**2. Renew the host certificate**

If the affected KVM host is still connected to the CloudStack Management Server:

- Log in to the CloudStack UI as an administrator.
- Navigate to Infrastructure -> Hosts.
- Select the affected KVM host.
- Click on **Provision Host Security Keys** and confirm the operation.
- Wait until the host reconnects and its status is Up.

CloudStack should generate and deploy the new certificates to the KVM host.

**3. Verify the renewed certificate**

Execute the following commands again on the affected KVM host:

openssl x509 -in /etc/pki/libvirt-vnc/server-cert.pem -noout -dates
systemctl status cloudstack-agent
systemctl status libvirtd

If the certificate has been renewed successfully, try starting one of the 
affected VMs and check its console access.

**4. Prevent the issue from occurring again**

Navigate to Global Settings in CloudStack and review the following parameters:

- ca.framework.cert.automatic.renewal - Make sure it is set to true.
- ca.framework.cert.validity.period - Review the configured certificate 
validity period in days.

We also recommend monitoring certificate expiration dates across all your KVM 
hosts.

Since this is a production environment, please perform this operation on one 
affected host first during a maintenance window. Certificate provisioning may 
restart the libvirt and CloudStack agent services. Once everything is verified, 
you can proceed with the remaining affected hosts.

Please note that already-running VMs may require a planned stop/start or 
migration to pick up the renewed VNC certificate, depending on your CloudStack 
version.

If the host is disconnected from the Management Server or you are unable to 
re-provision the certificate, please share your CloudStack version, KVM host 
operating system and current host status so we can suggest the appropriate 
recovery steps.

You can also refer to the official CloudStack documentation:

https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines.html#securing-instance-console-access-kvm-only

Regards,
Nick R 
Accuweb.Cloud

GitHub link: 
https://github.com/apache/cloudstack/discussions/12984#discussioncomment-19936098

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to