GitHub user rishabhjain1997 added a comment to the discussion: Provisioning the 
control VM failed in the Kubernetes cluster

**Update — qemu-guest-agent autostart issue persists**                          
                                                    
                                                                                
                                                      
  Hi @Pearl1594 and @anirudh09041 — quick update on the `patch.sh` / qga 
investigation.                                                           
   
  ### What we did                                                               
                                                      
                  
1. Disabled the two new hosts (`cloudstack-node2.local`, 
`kvm2.cloudstack.local`) so VMs are forced onto `cloudstack.local`.        
2. Patched the Ubuntu cloud image (`/var/www/html/ubuntu-cks-fresh-qga.qcow2`) 
to install `qemu-guest-agent`, `containerd`, and CKS deps via `virt-customize 
--install`.                                                                     
                           
3. Found that `systemctl enable qemu-guest-agent.service` was a no-op because 
the unit shipped by Ubuntu has an **empty `[Install]` section** — it's "static" 
and relies on udev/device activation:                                           
                          
                  
     ```ini                                                                     
                                                      
     [Unit]       
     Description=QEMU Guest Agent
     BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device
     After=dev-virtio\x2dports-org.qemu.guest_agent.0.device                    
                                                      
   
     [Service]                                                                  
                                                      
     ExecStart=-/usr/sbin/qemu-ga
     Restart=always                                                             
                                                      
     RestartSec=0
                                                                                
                                                      
     [Install]    

4. As a workaround, manually created the symlink inside the qcow2:              
                                                    
   
  /etc/systemd/system/multi-user.target.wants/qemu-guest-agent.service          
                                                      
      -> /lib/systemd/system/qemu-guest-agent.service
5. Discovered the existing Ubuntu-CKS-Fresh-qga-v2 template was registered 
against the wrong URL (pointed at the v1 file).  Re-registered as 
Ubuntu-CKS-Fresh-qga-v3 against the patched file and provisioned 
test-cluster-29.                                  
   
Current state                                                                   
                                                    
                  
  - VM i-2-143-VM for test-cluster-29 is on cloudstack.local and has been in 
Starting for ~28 minutes.                                
  - patch.sh still times out after 5 min:
                                                                                
                                                      
  WARN  ... Process [...] for command [.../patch.sh -n i-2-143-VM ...] timed 
out. Output is [].                                       
  ERROR ... Passing cmdline failed:timeout
  - virsh qemu-agent-command i-2-143-VM '{"execute":"guest-ping"}' →            
                                                      
                                                                                
                                                      
error: Guest agent is not responding: QEMU guest agent is not connected         
                                                    
                                                                                
                                                      
Hypothesis                                                                      
                                                    
                  
The wants/ symlink alone isn't enough. BindsTo= blocks systemd from starting 
qemu-guest-agent.service until the virtio-port device unit 
(dev-virtio\x2dports-org.qemu.guest_agent.0.device) activates — and either the 
udev rule isn't firing in our boot, or the device unit never resolves.          
                                                                                
               
                  
Checking further on this                                                        
                                      
              

GitHub link: 
https://github.com/apache/cloudstack/discussions/13056#discussioncomment-16846548

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

Reply via email to