Richard W.M. Jones
2015-Dec-29 17:58 UTC
Re: [Libguestfs] [libguestfs] RFE: virt-builder ability to print definition for single template (new option or expand --notes) (#20)
On Mon, Dec 28, 2015 at 03:51:51PM -0800, Ryan Sawhill Aroha wrote:> The `virt-builder --notes <TEMPLATE>` command is nice, but I really wish it printed the full template definition, eg, something like this: > > ``` > $ virt-builder --notes centos-70 > > [centos-70] > name=CentOS 70 > osinfo=centos70 > arch=x86_64 > file=centos-70xz > checksum=cf9ae295f633fbd04e575eeca16f372e933c70c3107c44eb06864760d04354aa94b4f356bfc9a598c138e687304a52e96777e4467e7db1ec0cb5b2d2ec61affc > format=raw > size=6442450944 > compressed_size=213203844 > expand=/dev/sda3 > notes=CentOS 70 > > This CentOS image contains only unmodified @Core group packages > > It is thus very minimal The kickstart and install script can be > found in the libguestfs source tree: > > builder/website/centossh > ```One problem with this is that the 'index' format isn't the only metadata format we now support. (SimpleStreams is another). However there is an intermediate format we use internally, and those fields could be printed by --notes or some other mechanism. https://github.com/libguestfs/libguestfs/blob/master/builder/index.mli This would be suitable for an RFE in Bugzilla.> Or maybe it could be like `virt-builder --list-format long --list` > (all prettified), but only for a particular template > > I think normal users need this option to be able to check the > `osinfo=` value for use with `virt-install` without having to > scroll/grep through all their templatesWe definitely need a way to get at the osinfo information more easily. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Pino Toscano
2016-Jan-14 11:36 UTC
Re: [Libguestfs] [libguestfs] RFE: virt-builder ability to print definition for single template (new option or expand --notes) (#20)
In data martedì 29 dicembre 2015 17:58:18, Richard W.M. Jones ha scritto:> On Mon, Dec 28, 2015 at 03:51:51PM -0800, Ryan Sawhill Aroha wrote: > > The `virt-builder --notes <TEMPLATE>` command is nice, but I really wish it printed the full template definition, eg, something like this: > > > > ``` > > $ virt-builder --notes centos-70 > > > > [centos-70] > > name=CentOS 70 > > osinfo=centos70 > > arch=x86_64 > > file=centos-70xz > > checksum=cf9ae295f633fbd04e575eeca16f372e933c70c3107c44eb06864760d04354aa94b4f356bfc9a598c138e687304a52e96777e4467e7db1ec0cb5b2d2ec61affc > > format=raw > > size=6442450944 > > compressed_size=213203844 > > expand=/dev/sda3 > > notes=CentOS 70 > > > > This CentOS image contains only unmodified @Core group packages > > > > It is thus very minimal The kickstart and install script can be > > found in the libguestfs source tree: > > > > builder/website/centossh > > ``` > > One problem with this is that the 'index' format isn't the only > metadata format we now support. (SimpleStreams is another). > > However there is an intermediate format we use internally, and those > fields could be printed by --notes or some other mechanism. > https://github.com/libguestfs/libguestfs/blob/master/builder/index.mli > > This would be suitable for an RFE in Bugzilla.I'm not sure it makes sense to print the internal representation of the templates, since that could change anytime (like the format of the revision field, which changed between 1.30 and 1.32). We have the JSON output for getting the information about templates, so additions should be done there.> > Or maybe it could be like `virt-builder --list-format long --list` > > (all prettified), but only for a particular template > > > > I think normal users need this option to be able to check the > > `osinfo=` value for use with `virt-install` without having to > > scroll/grep through all their templatesTheoretically, you can filter the JSON output using jq for the template you need, and print its osinfo key; for example: $ virt-builder --list --list-format \ | jq -r '.["templates"] | map(select(.["os-version"] == "fedora-23" and .["arch"] == "x86_64")) | .[0] | .["osinfo"]' will print the osinfo value of the fedora-23/x86_64 template.> We definitely need a way to get at the osinfo information more easily.I'm going to send a patch to allow listing just a specified template, which should make filtering the --list output a bit easier. -- Pino Toscano
Ryan Sawhill
2016-Jan-14 17:00 UTC
Re: [Libguestfs] [libguestfs] RFE: virt-builder ability to print definition for single template (new option or expand --notes) (#20)
On Thu, Jan 14, 2016 at 6:36 AM, Pino Toscano <ptoscano@redhat.com> wrote:> I'm not sure it makes sense to print the internal representation of the > templates, since that could change anytime (like the format of the > revision field, which changed between 1.30 and 1.32). We have the JSON > output for getting the information about templates, so additions should > be done there.I think virt-builder should have an option for normal people to print the full template info, but I guess that's up to you guys. I implemented it as -i/--info in my own virt-builder frontend by parsing the json, e.g.: $ mkvm --info r7.2> template : r7.2 > osinfo : rhel7.2 > compressed-size : 356163292 > full-name : rsaw's Red Hat Enterprise Linux 7.2 > hidden : False > arch : x86_64 > size : 10737418240 > notes: > Red Hat Enterprise Linux 7.2 > > THIS IMAGE IS NOT REGISTERED TO RHN/RHSM BUT IT DOES HAVE YUM REPOS > WHICH ARE ONLY AVAILABLE ON THE RH CORPORATE NETWORK. > REGARDLESS, DO NOT REDISTRIBUTE OUTSIDE OF RED HAT. > > Details: > - Image in qcow2 format for easy snapshotting. > - LVM is used for rootfs & swap with default autopart settings so > that you see what customers see. > - GRUB timeout lowered from 5 to 2 sec. > - Serial console is enabled (GRUB and kernel/init) and is primary > which means you should use it for any rescue operations. > - The @base package group is installed (not just @core), along with: > screen, vim-enhanced, kernel-doc, sos, elinks, setools-console, > policycoreutils-python, psmisc, ntp, rsawaroha-release, xsos. > - All yum repos from DVD are enabled by default (base, Optional, > HighAvailability, and ResilientStorage) as is the Extras repo. > The debuginfo & source repos are also present, but disabled. > - RPM-GPG-KEY-redhat-release is already imported and gpgcheck=1 > is set for all enabled repos. > - The kdump service is disabled. > - Console login screens (serial/tty) print IPv4 & IPv6 addrs of all > present NICs (thanks to update-etcissue-nics.service modifying > /etc/issue at boot time to add escapes for agetty). > - chronyd and ntpd are both configured with RH corporate timeservers > and settings suitable for virtual machines (chrony: "makestep 1 3"; > ntp: "tinker panic 0"); however only chronyd is enabled. >
Reasonably Related Threads
- Re: RFE: virt-builder ability to print definition for single template (new option or expand --notes) (#20)
- Re: RFE: virt-builder option to auto-detect image format (#19)
- Re: RFE: virt-builder new option (--offline maybe) to allow running only from cache (#21)
- [PATCH v7 0/9] Introducing virt-builder-repository
- [PATCH] utils: add new CLEANUP_XMLFREE cleanup, to call xmlFree()