Bug 587675 - RFE: API to facilitate remote URL installs
Summary: RFE: API to facilitate remote URL installs
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact:
URL:
Whiteboard:
: 640974 (view as bug list)
Depends On:
Blocks: 546440 Rhel6.1LibvirtTier2
TreeView+ depends on / blocked
 
Reported: 2010-04-30 14:31 UTC by Cole Robinson
Modified: 2014-07-06 19:31 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-07 23:34:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Cole Robinson 2010-04-30 14:31:06 UTC
Libvirt support is required to enable remote VM installation from URLs. We need someway to tell libvirt to download a kernel/initrd. I figured an API like

virStorageVolImport(virStoragePoolPtr pool,
                    const char *uri,
                    int flags)

would be sufficient. This would also be useful for importing local files into a storage pool, which is something we could use in virt-manager.

Comment 2 RHEL Program Management 2010-04-30 15:52:58 UTC
This feature request did not get resolved in time for Feature Freeze
for the current Red Hat Enterprise Linux release and has now been
denied. You may re-open your request by requesting your support
representative to propose it for the next release.

Comment 3 Daniel Berrangé 2010-05-05 08:12:22 UTC
I don't think libvirtd wants to be in the business of downloading files itself, but that's not a problem because with the virStreamPtr APIs we added for tunnelled migration, we can easily provide an API for reading & writing storage volumes, eg

    int virStorageVolRead(virStorageVolPtr, virStreamPtr st, unsigned long long offset, unsigned int flags);
    int virStorageVolWrite(virStorageVolPtr, virStreamPtr st, unsigned long long offset, unsigned int flags);

  static int
  cmdPutSource(virStreamPtr st ATTRIBUTE_UNUSED,
             char *bytes, size_t nbytes, void *opaque)
  {
      int *fd = opaque;

      return read(*fd, bytes, nbytes);
  }


    virStreamPtr st;
    int fd;
    if ((fd = open(file, O_RDONLY)) < 0) {
        vshError(ctl, FALSE, "cannot read %s", name);
        goto cleanup;
    }

    st = virStreamNew(conn, 0);

    if (virStorageVolRead(vol, st, offset, 0) < 0)
        goto cleanup;

    if (virStreamSendAll(st, cmdPutSource, &fd) < 0)
        goto cleanup;

    if (close(fd) < 0) {
        virStreamAbort(st);
        goto cleanup;
    }
    fd = -1;
    if (virStreamFinish(st) < 0)
        goto cleanup;


That way virt-manager can transfer any file it has locally, to a remote storage volume. virt-manager remains in control of downloading from the remote web server, making it easy todo progress feedback there.

There is a proof of concept impl of an API that is almost identical to this here

http://gitorious.org/~berrange/libvirt/staging/commits/data-streams-demo

Comment 4 Dave Allan 2010-07-22 20:51:46 UTC
How do we handle the case in which virt-manager is connected to a datacenter via a slow link, but the vm host and the remote webserver are connected by fast links?

Comment 5 Daniel Berrangé 2010-07-23 10:42:27 UTC
We can't solve every possible scenario. virt-manager is targetted to local LAN usage where communications links are reasonably fast. Users are free to deploy Cobbler if they want to maintain a cache of distros local to the datacenter.

Comment 6 Cole Robinson 2010-10-14 16:10:22 UTC
*** Bug 640974 has been marked as a duplicate of this bug. ***

Comment 7 Cole Robinson 2012-02-07 23:34:12 UTC
This is upstream for a while, and virt-install supports remote installs with URLs


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