vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
787 stars 267 forks source link

Cloud-init config is not applied when the VM has a VDI allocated on a local SR of a pool member #7953

Closed ilyapelyovin closed 3 weeks ago

ilyapelyovin commented 2 months ago

Are you using XOA or XO from the sources?

XO from the sources

Which release channel?

stable

Provide your commit number

916c1

Describe the bug

Cloud-init config is not applied when the VM has a VDI placed on the pool member's local SR. The VDI does not have to be the system drive for the bug to appear. The config is still applied, if the VM has its VDIs placed on the pool master's local SR or on a shared SR.

This cloud-init config was used for testing:

#cloud-config
users:
  - name: user
    gecos: user
    primary_group: user
    groups: adm
    lock_passwd: false
    shell: /bin/bash
    sudo: ALL=(ALL) NOPASSWD:ALL
    # credentials: user:user
    passwd: $6$rounds=4096$2DePWKgmLn$MFNWNQgtbse89PIlwiD7szo.Q5.Lx4VtLS82g0bxFhpqkHX7IP04C7QmUOJiSdQ0ysbuOUoutagRSYggUwyDn/
growpart:
  mode: auto
  devices:
    - "/"
write_files:
  - content: |
      net.ipv4.conf.all.arp_notify = 1
    path: /etc/sysctl.d/90-cloudinit-xcp.conf
package_update: true
packages:
  - xe-guest-utilities

Error message

There is no error message, cloud-init just can't detect the noCloud drive.

The noCloud drive is created and presented to the VM as /dev/xvdb, but it filled with zeros:

root@ubuntu:~# hexdump /dev/xvdb
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0c00000

To reproduce

  1. Go to 'New VM'
  2. Select an VM template made of an Ubuntu cloud-ready image
  3. Select a local SR of a pool member
  4. Provide the VM with a cloud-init config

Expected behavior

The cloud-init config should be applied

Screenshots

No response

Node

v20.17.0

Hypervisor

XCP-ng 8.2.1

Additional context

No response

olivierlambert commented 2 months ago

Thanks for your report, we'll try to reproduce the issue here.

edit: can you retry with the latest commit and confirm the problem? Can you reproduce with XOA on latest release channel?

b-Nollet commented 1 month ago

Hi,

I tried to reproduce the problem on the latest release channel using the cloud-init config you provided, but I had no problem. As Olivier suggested, can you try to reproduce the problem on latest ?

ilyapelyovin commented 3 weeks ago

Hi, thank you for checking the issue and suggesting to upgrade to the latest! After upgrading to a5967, the issue can be reproduced on the old XCP-ng pool which is waiting for 45 updates, but not on the up-to-date pools. I suppose, this issue can be closed. Thanks again for your support!