Bug 981693 - RFE: Provide cloud-init integration for VMs
Summary: RFE: Provide cloud-init integration for VMs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-05 13:48 UTC by Daniel Berrangé
Modified: 2020-09-15 21:25 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-15 21:25:01 UTC


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.