Skip to main content
NetworkAdminKB Logo

Knowledge Base

Go Search
NetworkAdminKB.com
Knowledge Base
VBScript Library
  
NetworkAdminKB.com > Knowledge Base > Knowledge Base > VMWare > Unable to list Folders of Datastores in VIFS.pl Script  

Unable to list Folders of Datastores in VIFS.pl Script

Author Details
Author: NetworkAdminKB.com
Created: 2008-12-10
Modified: 2008-12-12
Article Content

Issue:

The following VIFS.pl command is an example of how to list all the folders on a specific Datastore on a specific Datacenter and the specified VirtualCenter Server.

vifs.pl --server vc_server --passthroughauth -Z dc_name -D [ds_name]

 

This command (and slight variations) will always return the following error message.

 

GET https://vc_server /folder?dsName=ds_name unsuccessful : 404 Not Found

 

This issue was found in v3.5 Update 2 of the Remote CLI client available for download from VMWare here.

http://vmware.com/download/vi/drivers_tools.html

 

Cause:

The following is from the Remote Command-Line Interface Installation and Reference Guide

Update 2 Release for ESX Server 3.5, ESX Server 3i version 3.5, VirtualCenter 2.5.

 

The vifs command performs common operations such as copy, remove, get, and put

on files and directories. The command is supported on ESX Server 3 but not on

VirtualCenter Server.

 

From the syntax of the command there is no reason why the “LIST” commands should not work against a VirtualCenter server.  Ultimately the ability to “LIST” folders via VirtualCenter can be traced back to a programming error in the sub do_dir procedure in the VIFS.pl script.

 

Solution:

1)      Copy VIFS.pl file to VIFS2.pl

2)      Edit the VIFS2.pl file using Notepad

3)      Locate the sub do_dir procedure

4)      Modify the following line changing Current Line to the New Line as indicated in Bold.

a.       Current:

my $resp = VIExt::http_get_file($mode, $filepath, $ds, $dc, undef);

b.      New:

my $resp = VIExt::http_get_file($mode, $filepath, $ds, $datacenter, undef);

5)      Save the VIFS2.pl file

6)      Run the following command

Vifs2.pl --server vc_server --passthroughauth -Z dc_name -D [ds_name]

 

More Information:

The correct URL that the Perl script should send is:

https://vc_server/folder?dcPath=dc_name&dsName=ds_name

 

You can manually test the original URL and the new URL via any web browser.

 

This modification has only been tested with “LIST” commands.  The copy, remove, get, and put file commands may still not work against VirtualCenter Server.

Related Articles
 
Last modified at 12/12/2008 10:33 PM  by TEMPLATE\kbadmin 
 
 NetworkAdminKB.com
 Copyright © 2008 NetworkAdminKB.com, All rights reserved. Terms of Use | Contact US