Bug 981693

Summary: RFE: Provide cloud-init integration for VMs
Product: [Community] Virtualization Tools Reporter: Daniel BerrangĂ© <berrange>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, dustymabe, fweimer, gscrivan, hbrock, ibaldo, jforbes, juzhou, majopela, pmukhedk, poisson02, rjones, stanislav.polasek, tim, ueberall, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-15 21:25:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Berrangé 2013-07-05 13:48:38 UTC
Description of problem:
Fedora (and many other distros) provide pre-built cloud images. These typically have no default password set, requiring the cloud-init service to pull a password and/or ssh public key off the host metadata service, or config-drive disk.

It would be desirable to use the pre-built cloud images in non-cloud world, using virt-manager and/or virt-install --import.

Without a way to populate the login password/ssh keys, this isn't practical

  http://fedoraproject.org/en/get-fedora-options#clouds

It would be desirable if virt-install have a way to specify arbitrary key,value pairs to populate the metadata source. It could then auto-generate a disk image to act as a config drive thus:

http://ubuntu-smoser.blogspot.co.uk/2013/02/using-ubuntu-cloud-images-without-cloud.html

Comment 1 Cole Robinson 2013-08-31 16:08:16 UTC
Moving to the upstream tracker

Comment 3 Dusty Mabe 2014-09-24 13:51:22 UTC
Dan,

Would it be a good first step if virt-install/virt-manager had the ability to accept a file or directory to use and build a resulting iso image and attach it to the guest on install/import?

Key/Value pair could come later.

Comment 5 Prasad Mukhedkar 2015-06-26 13:39:36 UTC
1+

Comment 6 Cole Robinson 2020-01-26 17:24:30 UTC
Work for this is committed upstream. Simplest invocation is:

  virt-install --cloud-init ...

Which will generate a random root password, print it to the console, and set cloud-init to be disabled after the first
boot up. This is to facilitate the case of grabbing a distro cloud image and wanting to use it like a regular VM.

--cloud-init has some suboptions for different usecases:

$ ./virt-install --cloud-init=help
--cloud-init options:
  disable
  meta-data
  root-password-file
  root-password-generate
  ssh-key
  user-data

For example, user-data=/path/to/user-data for cloudinit user-data passthrough, and
ssh-key=/path/to/ssh-key.pub for initializing the default user with your ssh key.

Setting to MODIFIED, I will close when a new release is out

Comment 7 Cole Robinson 2020-09-15 21:25:01 UTC
This is in virt-manager 3.0.0 release now