Created attachment 794303 [details] engine.log,vdsm.log,cloud-init.log Description of problem: cloud-init inside guest does not configure guest OS correctly, it seems engine is not passing data in valid order/format. For example ssh public key is not passed and because cloud-init is soooo intellingent while disabling PasswordAuthentication, then ssh access is impossible :-) I defined following data in Run-Once dialog: * Hostname: foobar (set) * SSH Authorized Keys: my ssh public key (wrong) * Regenerate System SSH Keys: true (not done) * Time Zone: hawaiian Standard Time (not done) * Root Password: foopass (not done) * inside guest: # cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=foobar.localdomain # cat /root/.ssh/authorized_keys foobar # ls -l /etc/ssh/ssh_host_* -rw-------. 1 root root 672 Sep 5 14:00 /etc/ssh/ssh_host_dsa_key -rw-r--r--. 1 root root 590 Sep 5 14:00 /etc/ssh/ssh_host_dsa_key.pub -rw-------. 1 root root 963 Sep 5 14:00 /etc/ssh/ssh_host_key -rw-r--r--. 1 root root 627 Sep 5 14:00 /etc/ssh/ssh_host_key.pub -rw-------. 1 root root 1675 Sep 5 14:00 /etc/ssh/ssh_host_rsa_key -rw-r--r--. 1 root root 382 Sep 5 14:00 /etc/ssh/ssh_host_rsa_key.pub # uptime 16:18:33 up 18 min, 2 users, load average: 0.00, 0.00, 0.00 # cat /etc/sysconfig/clock ZONE="Europe/Prague" # ls -l /etc/shadow ----------. 1 root root 732 Sep 5 14:00 /etc/shadow * inspecting vm payload # cat /mnt/openstack/latest/* { "launch_index" : "0", "availability_zone" : "nova", "name" : "foobar", "hostname" : "foobar", "uuid" : "ba9cbf2d-f06f-492f-af63-dc509b1f642f", "public_keys" : [ "foobar" ], "password" : "foopass", "meta" : { "essential" : "false", "role" : "server", "dsmode" : "local" } }timezone: Pacific/Honolulu ssh_deletekeys: 'True' output: all: '>> /var/log/cloud-init-output.log' user: root runcmd: - 'sed -i ''/^datasource_list: /d'' /etc/cloud/cloud.cfg; echo ''datasource_list: ["NoCloud", "ConfigDrive"]'' >> /etc/cloud/cloud.cfg' Version-Release number of selected component (if applicable): is13 / cloud-init-0.7.2-2.el6.noarch How reproducible: 100% Steps to Reproduce: 1. install rhel6 and create a template (as described in docs) 2. create new VM 3. run-once - cloud-init - define same values as I did Actual results: not all values are passed correctly, ssh login is not possible because cloud-init funcionality in RHEVM messed ssh public keys :) Expected results: ... Additional info:
Omer, file rhel 6 cloud-init bugs as required... also, why is it searching for network service, shouldn't it be not used in our case?
Verified in rhevm-3.3.0-0.35.beta1.el6ev.noarch (is24). Verified by following the reproducer in comment 0: 1. Install RHEL 6 VM (optional: install also cloud-init-0.7.2 or newer). 2. Run Once VM with Cloud-Init: Hostname: hostname-rhel6 SSH Authorized Keys: cloud-init-ssh-pubkey Regenerate System SSH Keys: true Time Zone: Hawaiian Standard Time Root Password: 654321 3. On the host, mount the config drive CD image and inspect the generated user data and meta data. Results: (on the host:) # mount -t iso9660 -o loop /var/run/vdsm/payload/d80627d0-04f4-48d5-9335-753354c2cc29.81b3df31f8697cbeb6accd60218166b7.img /mnt/cloud-init/ # cat /mnt/cloud-init/openstack/latest/meta_data.json { "launch_index" : "0", "availability_zone" : "nova", "name" : "hostname-rhel6", "hostname" : "hostname-rhel6", "uuid" : "60485b67-3532-4350-b9f2-41cac7b84c26", "public_keys" : [ "cloud-init-ssh-pubkey" ], "meta" : { "essential" : "false", "role" : "server", "dsmode" : "local" } } # cat /mnt/cloud-init/openstack/latest/user_data #cloud-config timezone: Pacific/Honolulu ssh_deletekeys: 'True' output: all: '>> /var/log/cloud-init-output.log' user: root password: '654321' runcmd: - 'sed -i ''/^datasource_list: /d'' /etc/cloud/cloud.cfg; echo ''datasource_list: ["NoCloud", "ConfigDrive"]'' >> /etc/cloud/cloud.cfg' All data look good. Optional: verify that the values from meta data and user data are applied on the guest: 1. SSH to the guest with password '654321'. 2. Check guest hostname, time zone and autohorized SSH keys: # cat /etc/sysconfig/clock ZONE=Pacific/Honolulu # cat /root/.ssh/authorized_keys cloud-init-ssh-pubkey # hostname hostname-rhel6
Closing - RHEV 3.3 Released