# HG changeset patch
# User john.levon@sun.com
# Date 1228365030 28800
# Node ID d9898b68352ad1c2491a3c9697d4b34af6630fc7
# Parent fd554fd90595417dbaadb42aecc598d586b7f99e
Add --autocf
Add an option for passing Solaris JumpStart information. For HVM
guests, this means a floppy image (!).
Signed-off-by: John Levon <john.levon@sun.com>
diff --git a/man/en/virt-install.1 b/man/en/virt-install.1
--- a/man/en/virt-install.1
+++ b/man/en/virt-install.1
@@ -1,4 +1,4 @@
-." Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05)
+." Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
."
." Standard preamble:
." ================================================== ======================
@@ -25,11 +25,11 @@
..
." Set up some character translations and predefined strings. *(-- will
." give an unbreakable dash, *(PI will give pi, *(L" will give a left
-." double quote, and *(R" will give a right double quote. *(C+ will
-." give a nicer C++. Capital omega is used to do unbreakable dashes and
-." therefore won't be available. *(C` and *(C' expand to `' in nroff,
-." nothing in troff, for use with C<>.
-.tr (*W-
+." double quote, and *(R" will give a right double quote. | will give a
+." real vertical bar. *(C+ will give a nicer C++. Capital omega is used to
+." do unbreakable dashes and therefore won't be available. *(C` and *(C'
+." expand to `' in nroff, nothing in troff, for use with C<>.
+.tr (*W-|(bv*(Tr
.ds C+ Cv'-.1v'h'-1p's-2+h'-1p'+s0v'.1v'h'-1p'
.ie n {
. ds -- (*W-
@@ -48,25 +48,22 @@
. ds R" '
'br}
."
-." Escape single quotes in literal strings from groff's Unicode transform.
-.ie
(.g .ds Aq (aq
-.el .ds Aq '
-."
." If the F register is turned on, we'll generate index entries on stderr for
." titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
." entries marked with X<> in POD. Of course, you'll have to process the
." output yourself in some meaningful fashion.
-.ie
F {
+.if
F {
. de IX
. tm Index:$1
% "$2"
..
. nr % 0
. rr F
.}
-.el {
-. de IX
-..
-.}
+."
+." For nroff, turn off justification. Always turn off hyphenation; it makes
+." way too many mistakes in technical documents.
+.hy 0
+.if n .na
."
." Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
." Fear. Run. Save yourself. No user-serviceable parts.
@@ -132,11 +129,7 @@
." ================================================== ======================
."
.IX Title "VIRT-INSTALL 1"
-.TH VIRT-INSTALL 1 "2008-09-08" "perl v5.10.0" "Virtual Machine Install Tools"
-." For nroff, turn off justification. Always turn off hyphenation; it makes
-." way too many mistakes in technical documents.
-.if n .ad l
-.nh
+.TH VIRT-INSTALL 1 "2008-12-03" "perl v5.8.8" "Virtual Machine Install Tools"
.SH "NAME"
virt-install - provision new virtual machines
.SH "SYNOPSIS"
@@ -200,7 +193,7 @@ Set which physical cpus the guest can us
.Sp
.Vb 2
& 0,2,3,5 : Use processors 0,2,3 and 5
-& 1-3,5,6-8 : Use processors 1,2,3,5,6,7 and 8
+& 1-3,5,6-8 : Use processors 1,2,3,5,6,7 and 8
.Ve
.Sp
If the value 'auto' is passed, virt-install attempts to automatically determine
@@ -211,7 +204,7 @@ general format of a disk string is
general format of a disk string is
.Sp
.Vb 1
-& --disk opt1=val1,opt2=val2,...
+& --disk opt1=val1,opt2=val2,...
.Ve
.Sp
To specify media, one of the following options is required:
@@ -234,7 +227,7 @@ specifying a 'size' value.
.IP "fBvolfR" 4
.IX Item "vol"
An existing libvirt storage volume to use. This is specified as
-&'poolname:volname'.
+&'poolname/volname'.
.RE
.RS 4
.Sp
@@ -244,6 +237,11 @@ Disk device type. Value can be 'cdrom',
Disk device type. Value can be 'cdrom', 'disk', or 'floppy'. Default is
&'disk'. If a 'cdrom' is specified, and no install method is chosen, the
cdrom is used as the install media.
+.IP "fBbuxfR" 4
+.IX Item "bux"
+Disk bus type. Value can be 'ide', 'scsi', 'usb', 'virtio' or 'xen'. The
+default is hypervisor dependent since not all hypervisors support all bus
+types.
.IP "fBpermsfR" 4
.IX Item "perms"
Disk permissions. Value can be 'rw' (Read/Write), 'ro' (Readonly),
@@ -285,7 +283,7 @@ time taken to fully-allocate the guest v
time taken to fully-allocate the guest virtual disk will be usually by balanced
by faster install times inside the guest. Thus use of this optional is recommended
to ensure consistently high performance and to avoid I/O errors in the guest
-should the host filesystem fill up.
+should the host filesystem fill up.
.IP "-m s-1MACs0, --mac=MAC" 4
.IX Item "-m MAC, --mac=MAC"
Fixed s-1MACs0 address for the guest; If this parameter is omitted, or the value
@@ -341,12 +339,12 @@ parameters are specified, this will be p
.IX Item "--vncport=VNCPORT"
Request a permanent, statically assigned port number for the guest s-1VNCs0
console. Use of this option is discouraged as other guests may automatically
-choose to run on this port causing a clash.
+choose to run on this port causing a clash.
.IP "--sdl" 4
.IX Item "--sdl"
Setup a virtual console in the guest and display an s-1SDLs0 window in the
host to render the output. If the s-1SDLs0 window is closed the guest may
-be unconditionally terminated.
+be unconditionally terminated.
.IP "--nographics" 4
.IX Item "--nographics"
Disable all interactive prompts for the guest virtual console. No graphical
@@ -558,7 +556,7 @@ virtualized guest.
.IP "--noacpi" 4
.IX Item "--noacpi"
Override the s-1OSs0 type / variant to disables the s-1ACPIs0 setting for fully
-virtualized guest.
+virtualized guest.
.IP "--arch=ARCH" 4
.IX Item "--arch=ARCH"
Request a non-native s-1CPUs0 architecture for the guest virtual machine.
@@ -593,6 +591,11 @@ An s-1FTPs0 server location containing
.RE
.RS 4
.RE
+.IP "--autocf s-1CFs0" 4
+.IX Item "--autocf CF"
+Provide a path to automated install information. Currently this can
+either be a path to a Solaris JumpStart floppy disk image, or an s-1NFSs0
+path (for network installs).
.IP "-x s-1EXTRAs0, --extra-args=EXTRA" 4
.IX Item "-x EXTRA, --extra-args=EXTRA"
Additional kernel command line arguments to pass to the installer when
@@ -627,58 +630,58 @@ booting from the host s-1CDROMs0, usin
booting from the host s-1CDROMs0, using s-1VNCs0 server/viewer
.PP
.Vb 9
-& # virt-install e
-& --connect qemu:///system e
-& --name demo e
-& --ram 500 e
-& --disk path=/var/lib/libvirt/images/demo.img,size=5 e
-& --network network:default e
-& --accelerate e
-& --vnc e
-& --cdrom /dev/cdrom
+& # virt-install e
+& --connect qemu:///system e
+& --name demo e
+& --ram 500 e
+& --disk path=/var/lib/libvirt/images/demo.img,size=5 e
+& --network network:default e
+& --accelerate e
+& --vnc e
+& --cdrom /dev/cdrom
.Ve
.PP
Install a Fedora 9 s-1KVMs0 guest, using s-1LVMs0 partition, virtual networking,
booting from s-1PXEs0, using s-1VNCs0 server/viewer
.PP
.Vb 9
-& # virt-install e
-& --connect qemu:///system e
-& --name demo e
-& --ram 500 e
-& --disk path=/dev/HostVG/DemoVM e
-& --network network:default e
-& --accelerate e
-& --vnc e
-& --os-variant fedora9
+& # virt-install e
+& --connect qemu:///system e
+& --name demo e
+& --ram 500 e
+& --disk path=/dev/HostVG/DemoVM e
+& --network network:default e
+& --accelerate e
+& --vnc e
+& --os-variant fedora9
.Ve
.PP
Install a s-1QEMUs0 guest, with a real partition, for a different architecture
using s-1SDLs0 graphics, using a remote kernel and initrd pair:
.PP
.Vb 9
-& # virt-install e
-& --connect qemu:///system e
-& --name demo e
-& --ram 500 e
-& --disk path=/dev/hdc e
-& --network bridge:eth1 e
-& --arch ppc64 e
-& --sdl e
-& --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
+& # virt-install e
+& --connect qemu:///system e
+& --name demo e
+& --ram 500 e
+& --disk path=/dev/hdc e
+& --network bridge:eth1 e
+& --arch ppc64 e
+& --sdl e
+& --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
.Ve
.PP
Run a Live s-1CDs0 image under Xen fullyvirt, in diskless environment
.PP
.Vb 8
-& # virt-install e
-& --hvm e
-& --name demo e
-& --ram 500 e
-& --nodisks e
-& --livecd e
-& --vnc e
-& --cdrom /root/fedora7live.iso
+& # virt-install e
+& --hvm e
+& --name demo e
+& --ram 500 e
+& --nodisks e
+& --livecd e
+& --vnc e
+& --cdrom /root/fedora7live.iso
.Ve
.PP
Install a paravirtualized Xen guest, 500 s-1MBs0 of s-1RAMs0, a 5 s-1GBs0 of disk, and
@@ -686,14 +689,14 @@ options:
options:
.PP
.Vb 8
-& # virt-install e
-& --paravirt e
-& --name demo e
-& --ram 500 e
-& --file /var/lib/xen/images/demo.img e
-& --file-size 6 e
-& --nographics e
-& --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
+& # virt-install e
+& --paravirt e
+& --name demo e
+& --ram 500 e
+& --file /var/lib/xen/images/demo.img e
+& --file-size 6 e
+& --nographics e
+& --location http://download.fedora.redhat.com/pub/fedora/linux/core/6/x86_64/os/
.Ve
.SH "AUTHOR"
.IX Header "AUTHOR"
diff --git a/man/en/virt-install.pod b/man/en/virt-install.pod
--- a/man/en/virt-install.pod
+++ b/man/en/virt-install.pod
@@ -538,6 +538,12 @@ An FTP server location containing an ins
An FTP server location containing an installable distribution image
=back
+
+=item --autocf CF
+
+Provide a path to automated install information. Currently this can
+either be a path to a Solaris JumpStart floppy disk image, or an NFS
+path (for network installs).
=item -x EXTRA, --extra-args=EXTRA
diff --git a/virt-install b/virt-install
--- a/virt-install
+++ b/virt-install
@@ -385,6 +385,10 @@ def parse_args():
default="",
help=_("Additional arguments to pass to the kernel "
"booted from --location"))
+ parser.add_option("", "--autocf", type="string", dest="autocf",
+ default=None, action="callback",
+ callback=check_before_store,
+ help=_("Guest auto-configuration path"))
parser.add_option_group(insg)
stog = OptionGroup(parser, _("Storage Configuration"))
@@ -588,6 +592,9 @@ def main():
if options.os_variant:
guest.set_os_variant(options.os_variant)
continue_inst = guest.get_continue_inst()
+
+ if options.autocf is not None:
+ guest.autocf = options.autocf
+ # attach a floppy device if provided '--autocf=/pathname'
+ if install and self.autocf and self.autocf.startswith('/'):
+ autocf_floppy = VirtualDisk(self.autocf,
+ device=VirtualDisk.DEVICE_FLOPPY, transient=True,
+ readOnly=True)
+ ret = autocf_floppy.get_xml_config('fda')
+
for d in self._install_disks:
saved_path = None
if d.device == VirtualDisk.DEVICE_CDROM
diff --git a/virtinst/Guest.py b/virtinst/Guest.py
--- a/virtinst/Guest.py
+++ b/virtinst/Guest.py
@@ -524,6 +524,7 @@ class Guest(object):
self._vcpus = None
self._cpuset = None
self._graphics_dev = None
+ self._autocf = None
self._os_type = None
self._os_variant = None
@@ -562,7 +563,6 @@ class Guest(object):
def set_type(self, val):
self._installer.type = val
type = property(get_type, set_type)
-
# Domain name of the guest
def get_name(self):
@@ -599,6 +599,19 @@ class Guest(object):
self._maxmemory = val
maxmemory = property(get_maxmemory, set_maxmemory)
+ # location of auto-install config data (Solaris jumpstart)
+ def get_autocf(self):
+ return self._autocf
+ def set_autocf(self, val):
+ if type(val) is not type("string") or len(val) == 0:
+ raise ValueError, _("You must specify a valid pathname to autoconfiguration data")
+ if val.startswith('nfs:'):
+ self._autocf = val
+ else:
+ if not os.path.exists(val):
+ raise ValueError, _("%s does not exist" % val)
+ self._autocf = val
+ autocf = property(get_autocf, set_autocf)
# UUID for the guest
def get_uuid(self):
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-04-2008, 11:03 AM
"Daniel P. Berrange"
Add --autocf
On Wed, Dec 03, 2008 at 08:30:53PM -0800, john.levon@sun.com wrote:
> # HG changeset patch
> # User john.levon@sun.com
> # Date 1228365030 28800
> # Node ID d9898b68352ad1c2491a3c9697d4b34af6630fc7
> # Parent fd554fd90595417dbaadb42aecc598d586b7f99e
> Add --autocf
>
> Add an option for passing Solaris JumpStart information. For HVM
> guests, this means a floppy image (!).
I think its better not to add this OS specific option. You can
apass the Jumpstart floppy image using the recently added generic
--disk option
--disk path=/path/to/image,device=floppy
Regards,
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-04-2008, 11:06 AM
John Levon
Add --autocf
On Thu, Dec 04, 2008 at 12:03:36PM +0000, Daniel P. Berrange wrote:
> > Add --autocf
> >
> > Add an option for passing Solaris JumpStart information. For HVM
> > guests, this means a floppy image (!).
>
> I think its better not to add this OS specific option. You can
I don't think it's OS specific. I set up kickstart a while back and it
involved a lot of magic boot options with -x, why not make it easy?
> apass the Jumpstart floppy image using the recently added generic
> --disk option
>
> --disk path=/path/to/image,device=floppy
And for NFS JumpStart?
regards
john
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-04-2008, 11:26 AM
"Daniel P. Berrange"
Add --autocf
On Thu, Dec 04, 2008 at 12:06:08PM +0000, John Levon wrote:
> On Thu, Dec 04, 2008 at 12:03:36PM +0000, Daniel P. Berrange wrote:
>
> > > Add --autocf
> > >
> > > Add an option for passing Solaris JumpStart information. For HVM
> > > guests, this means a floppy image (!).
> >
> > I think its better not to add this OS specific option. You can
>
> I don't think it's OS specific. I set up kickstart a while back and it
> involved a lot of magic boot options with -x, why not make it easy?
>
> > apass the Jumpstart floppy image using the recently added generic
> > --disk option
> >
> > --disk path=/path/to/image,device=floppy
>
> And for NFS JumpStart?
How is that info passed down into the XML ?
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-04-2008, 12:00 PM
John Levon
Add --autocf
On Thu, Dec 04, 2008 at 12:26:09PM +0000, Daniel P. Berrange wrote:
> > And for NFS JumpStart?
>
> How is that info passed down into the XML ?
As cmdline args, much like kickstart.
regards
john
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-09-2008, 12:55 AM
Cole Robinson
Add --autocf
John Levon wrote:
> On Thu, Dec 04, 2008 at 12:03:36PM +0000, Daniel P. Berrange wrote:
>
>
>>> Add --autocf
>>>
>>> Add an option for passing Solaris JumpStart information. For HVM
>>> guests, this means a floppy image (!).
>>>
>> I think its better not to add this OS specific option. You can
>>
>
> I don't think it's OS specific. I set up kickstart a while back and it
> involved a lot of magic boot options with -x, why not make it easy?
>
>
>> apass the Jumpstart floppy image using the recently added generic
>> --disk option
>>
>> --disk path=/path/to/image,device=floppy
>>
>
> And for NFS JumpStart?
>
I wouldn't be opposed to adding support for this, provided it is in a
sufficiently generalized manner that we could reuse the command line
and API to add support for specifying a kickstart, autoyast, etc.
Something like:
The data should also be associated with the Installer class, rather
than the Guest class.
- Cole
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-09-2008, 09:29 AM
"Daniel P. Berrange"
Add --autocf
On Mon, Dec 08, 2008 at 08:55:13PM -0500, Cole Robinson wrote:
> John Levon wrote:
> > On Thu, Dec 04, 2008 at 12:03:36PM +0000, Daniel P. Berrange wrote:
> >
> >
> >>> Add --autocf
> >>>
> >>> Add an option for passing Solaris JumpStart information. For HVM
> >>> guests, this means a floppy image (!).
> >>>
> >> I think its better not to add this OS specific option. You can
> >>
> >
> > I don't think it's OS specific. I set up kickstart a while back and it
> > involved a lot of magic boot options with -x, why not make it easy?
> >
> >
> >> apass the Jumpstart floppy image using the recently added generic
> >> --disk option
> >>
> >> --disk path=/path/to/image,device=floppy
> >>
> >
> > And for NFS JumpStart?
> >
>
> I wouldn't be opposed to adding support for this, provided it is in a
> sufficiently generalized manner that we could reuse the command line
> and API to add support for specifying a kickstart, autoyast, etc.
> Something like:
>
> --auto-install type=autocf,media=http://example.com/foo.img
I just don't see what value this gives over the existing
--extra-args media=http://example.com/foo.img
or whatever the OS wants.
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
12-09-2008, 11:21 AM
John Levon
Add --autocf
On Tue, Dec 09, 2008 at 10:29:04AM +0000, Daniel P. Berrange wrote:
> I just don't see what value this gives over the existing
>
> --extra-args media=http://example.com/foo.img
>
> or whatever the OS wants.
You're forgetting the specification of the networking setup needed in
many cases. I'm supposed to remember the exact command lines needed for
each OS's variant of automated install? Have you seen what old Solaris's
cmdline looks like?
virt-install should be fall-over easy to use.
regards
john
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools