Darryl L. Pierce
2008-Dec-17 18:51 UTC
[Ovirt-devel] [PATCH server] Changed how taskomatic handles a Cobbler image record.
It will now incrementally pull out the protocol, authentication details, hostname or ip address, export path and filename for the image record. Signed-off-by: Darryl L. Pierce <dpierce at redhat.com> --- src/task-omatic/task_vm.rb | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/task-omatic/task_vm.rb b/src/task-omatic/task_vm.rb index 35d78f2..c187287 100644 --- a/src/task-omatic/task_vm.rb +++ b/src/task-omatic/task_vm.rb @@ -367,8 +367,18 @@ def start_vm(task) raise "Image #{vm.cobbler_name} not found in Cobbler server" unless details - ignored, ip_addr, export_path, filename - details.file.split(/(.*):(.*)\/(.*)/) + # extract the components of the image filename + image_uri = details.file + protocol = auth = ip_addr = export_path = filename = "" + + protocol, image_uri = image_uri.split("://") if image_uri.include?("://") + auth, image_uri = image_uri.split("@") if image_uri.include?("@") + # it's ugly, but string.split returns an empty string as the first + # result here, so we'll just ignore it + ignored, ip_addr, image_uri + image_uri.split(/^([^\/]+)(\/.*)/) unless image_uri =~ /^\// + ignored, export_path, filename + image_uri.split(/^(.*)\/(.+)/) found = false -- 1.6.0.4
Perry Myers
2008-Dec-20 02:39 UTC
[Ovirt-devel] [PATCH server] Changed how taskomatic handles a Cobbler image record.
Darryl L. Pierce wrote:> It will now incrementally pull out the protocol, authentication details, > hostname or ip address, export path and filename for the image record.This patch works fine for urls like: nfs://192.168.50.2/cobblernfs/winxp.iso but does not work for nfs://192.168.50.2:/cobblernfs/winxp.iso And according to the cobbler site: https://fedorahosted.org/cobbler/wiki/AllAboutImages The format for nfs urls should look like: nfs://user at host:/path/to/foo.iso --image-type=iso The problem is if you put the : in the url after the hostname two colons are put into the libvirt xml and the mount then fails. This needs to be fixed, but .96 will be released with this error. For .96 people will just need to use: nfs://host/dir/file.iso Since that is the format that does work Perry
Darryl L. Pierce
2008-Dec-23 13:01 UTC
[Ovirt-devel] Re: [PATCH server] Changed how taskomatic handles a Cobbler image record.
On Wed, Dec 17, 2008 at 01:51:39PM -0500, Darryl L. Pierce wrote:> It will now incrementally pull out the protocol, authentication details, > hostname or ip address, export path and filename for the image record.I spoke with Mike yesterday regarding this topic, and the conclusion is that we'll handle it as: [auth@]hostname:/[path to /]filename where "auth" is the optional (though currently unused) username and password, and the path is the absolute path, from that mount point, to the image record. There's a patch out for review with the Cobbler folks, and a matching patch for oVirt. -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Virtual Machine Management - http://www.ovirt.org/ "What do you care what other people think, Mr. Feynman?" -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20081223/e7f2c532/attachment.sig>