# split out all remaining entries of key = value form
for (line_nr, line) in enumerate(lines):
@@ -69,6 +70,9 @@ class vmx_parser(vmconfig.parser):
value = after_eq.replace('"',"")
value = value.strip()
config[key] = value
+ # FIXME: this should probably be a lot smarter.
+ if value.endswith(".vmdk"):
+ disks += [ value ]
except:
raise Exception("Syntax error at line %d: %s" %
(line_nr + 1, line.strip()))
@@ -80,10 +84,6 @@ class vmx_parser(vmconfig.parser):
vm.memory = config.get("memsize")
vm.description = config.get("annotation")
vm.nr_vcpus = config.get("numvcpus")
-
- # FIXME: this should probably be a lot smarter. I don't think
- # this even gets disk numbering right.
- disks = [ d for d in config.values() if d.endswith(".vmdk") ]
for (number, path) in enumerate(disks):
vm.disks += [ vmconfig.disk(path, number, vmconfig.DISK_TYPE_VMDK) ]
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
07-08-2008, 12:14 PM
"Daniel P. Berrange"
Fix multiple disks
On Mon, Jul 07, 2008 at 03:51:31PM -0700, john.levon@sun.com wrote:
> # HG changeset patch
> # User john.levon@sun.com
> # Date 1215470367 25200
> # Node ID c75d57437b7b219443580f6e9d6736d27d76ebcf
> # Parent a2be1263c2f5d3f346cfc3501682073fce2e8966
> Fix multiple disks
>
> Fix handling of multiple disks.
>
> Signed-off-by: John Levon <john.levon@sun.com>
>
> diff --git a/virtconv/parsers/virtimage.py b/virtconv/parsers/virtimage.py
> --- a/virtconv/parsers/virtimage.py
> +++ b/virtconv/parsers/virtimage.py
> @@ -117,12 +117,12 @@ class virtimage_parser(vmconfig.parser):
>
> # FIXME: needs updating for later Xen enhancements; need to
> # implement capabilities checking for max disks etc.
> - pv_disks.append("""<drive disk="%s" target="xvd%s" />""" %
> + pv_disks.append("""<drive disk="%s" target="xvd%s" />
""" %
> (path, ascii_letters[number % 26]))
> - hvm_disks.append("""<drive disk="%s" target="hd%s" />""" %
> + hvm_disks.append("""<drive disk="%s" target="hd%s" />
""" %
> (path, ascii_letters[number % 26]))
IDE only allows upto 4 disks. To allow more than this requires use of
SCSI or VirtIO/Xen paravirt drivers.
I'd probably say default to IDE for first 4, and then switch to sdNNN
for any subsequent disks.
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
07-08-2008, 12:20 PM
John Levon
Fix multiple disks
On Tue, Jul 08, 2008 at 01:14:46PM +0100, Daniel P. Berrange wrote:
> > Signed-off-by: John Levon <john.levon@sun.com>
> >
> > diff --git a/virtconv/parsers/virtimage.py b/virtconv/parsers/virtimage.py
> > --- a/virtconv/parsers/virtimage.py
> > +++ b/virtconv/parsers/virtimage.py
> > @@ -117,12 +117,12 @@ class virtimage_parser(vmconfig.parser):
> >
> > # FIXME: needs updating for later Xen enhancements; need to
> > # implement capabilities checking for max disks etc.
> > - pv_disks.append("""<drive disk="%s" target="xvd%s" />""" %
> > + pv_disks.append("""<drive disk="%s" target="xvd%s" />
""" %
> > (path, ascii_letters[number % 26]))
> > - hvm_disks.append("""<drive disk="%s" target="hd%s" />""" %
> > + hvm_disks.append("""<drive disk="%s" target="hd%s" />
""" %
> > (path, ascii_letters[number % 26]))
>
> IDE only allows upto 4 disks. To allow more than this requires use of
> SCSI or VirtIO/Xen paravirt drivers.
A later patch fixes this up somewhat, though this part is just a small
fix to existing code.
> I'd probably say default to IDE for first 4, and then switch to sdNNN
> for any subsequent disks.
Xen doesn't seem to be able to handle sd* meaningfully, at least.
regards
john
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
07-09-2008, 06:29 PM
Fix multiple disks
# HG changeset patch
# User john.levon@sun.com
# Date 1215627964 25200
# Node ID 96d74c328fd60b05c27af8ea1b4412756bf329db
# Parent c6d2254702a49d9674d6c549bd57cb87ac920e87
Fix multiple disks
# split out all remaining entries of key = value form
for (line_nr, line) in enumerate(lines):
@@ -69,6 +70,9 @@
value = after_eq.replace('"',"")
value = value.strip()
config[key] = value
+ # FIXME: this should probably be a lot smarter.
+ if value.endswith(".vmdk"):
+ disks += [ value ]
except:
raise Exception("Syntax error at line %d: %s" %
(line_nr + 1, line.strip()))
@@ -80,10 +84,6 @@
vm.memory = config.get("memsize")
vm.description = config.get("annotation")
vm.nr_vcpus = config.get("numvcpus")
-
- # FIXME: this should probably be a lot smarter. I don't think
- # this even gets disk numbering right.
- disks = [ d for d in config.values() if d.endswith(".vmdk") ]
for (number, path) in enumerate(disks):
vm.disks += [ vmconfig.disk(path, number, vmconfig.DISK_TYPE_VMDK) ]
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
07-09-2008, 10:01 PM
John Levon
Fix multiple disks
On Tue, Jul 08, 2008 at 01:14:46PM +0100, Daniel P. Berrange wrote:
> > diff --git a/virtconv/parsers/virtimage.py b/virtconv/parsers/virtimage.py
> > --- a/virtconv/parsers/virtimage.py
> > +++ b/virtconv/parsers/virtimage.py
> > @@ -117,12 +117,12 @@ class virtimage_parser(vmconfig.parser):
> >
> > # FIXME: needs updating for later Xen enhancements; need to
> > # implement capabilities checking for max disks etc.
> > - pv_disks.append("""<drive disk="%s" target="xvd%s" />""" %
> > + pv_disks.append("""<drive disk="%s" target="xvd%s" />
""" %
> > (path, ascii_letters[number % 26]))
> > - hvm_disks.append("""<drive disk="%s" target="hd%s" />""" %
> > + hvm_disks.append("""<drive disk="%s" target="hd%s" />
""" %
> > (path, ascii_letters[number % 26]))
>
> IDE only allows upto 4 disks. To allow more than this requires use of
> SCSI or VirtIO/Xen paravirt drivers.
I missed the second part of this until I just thought about it. What do
we do here? Not sure how the Linux paravirt drivers work, but I think
the Solaris ones at least can do "hde" etc.
> I'd probably say default to IDE for first 4, and then switch to sdNNN
> for any subsequent disks.
Solaris doesn't have a shim to turn the SCSI device into a PV driver
though.
regards
john
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools