Humphry
Contributor
Contributor

invalid datastore path

Creating a new virtual machine I always get an 'Invalid datastore path' soap fault:

SOAP Fault:

-


Fault string: Invalid datastore path '[sata1]'.

Fault detail: InvalidDatastorePath=HASH(0xad3de14)

I've tried diferent formats for the datastore path, but no one has worked:

[sata1]

[sata1] vm_name/

[sata1] vm_name/vm_name.vmdk

The datastore 'sata1' exists and is working properly. I don't know what's going on with the datastore path. Can anybody help me??

Thanks.

Tags (2)
0 Kudos
4 Replies
njain
Expert
Expert

Couple of things that you can check:

1. Are you able to create a VM (specifying the "sata" datastore" using VI Client directly connected to your ESX/VC server?

2. Do you face the SOAP Fault only with this specific datastore? Does the script work fine with other datastores?

The datastore path should be of the format [<datastore name>]. Can you post your script here?

0 Kudos
Humphry
Contributor
Contributor

Debugging the application I've seen that the problem is here:

my $files = VirtualMachineFileInfo->new(logDirectory => undef, snapshotDirectory => undef, suspendDirectory => undef, vmPathName => $ds_path);

The vmPathName is what provokes the error. What value should I assign to de vmPathName variable??

0 Kudos
njain
Expert
Expert

How are you constructing variable $ds_path? It should be as follows:

my $ds_path = "[sata1]";

You can try hard coding this value for testing purposes to nail down the exact issue.

0 Kudos
Humphry
Contributor
Contributor

1. Are you able to create a VM (specifying the "sata" datastore" using VI Client directly connected to your ESX/VC server?

Yes, I've created several VM using the VI Client.

2. Do you face the SOAP Fault only with this specific datastore? Does the script work fine with other datastores?

I receive the soap fault with all datastores.

Code:

my $dc_view = Vim::find_entity_view(view_type => 'Datacenter', filter => {'name' => $datacenter});
my %ds_info = HostUtils::get_datastore(host_view => $dc_view, datastore => $datastore, disksize => $diskSize);
my $ds_path = '[sata1]';
my $files = VirtualMachineFileInfo->new(logDirectory => undef, snapshotDirectory => undef,
suspendDirectory => undef, vmPathName => $ds_path);                                 

my $controller_vm_dev_conf_spec = create_conf_spec();
my $disk_vm_dev_conf_spec = create_virtual_disk(ds_path => $ds_path, disksize => $diskSize);

my %net_settings = get_network(network_name => $nicNetwork,	poweron => NIC_POWERON,	host_view => $dc_view);

my @vm_devices = ();                           
if($net_settings{'error'} eq 0) 
{
  push(@vm_devices, $net_settings{'network_conf'});
} 
elsif ($net_settings{'error'} eq 1) 
{
  die("No se encontró la red $nicNetwork.");
}

push(@vm_devices, $controller_vm_dev_conf_spec);
push(@vm_devices, $disk_vm_dev_conf_spec);

my $vm_config_spec = VirtualMachineConfigSpec->new(
name => $vm_name,
memoryMB => $memory,
numCPUs => $numCpus,
files => $files,
guestId => undef,
deviceChange => \@vm_devices);      

my $vm_folder_view = Vim::get_view(mo_ref => $dc_view->vmFolder);
my $rp_moref = Vim::find_entity_view(view_type => 'ResourcePool');
my $res = $vm_folder_view->CreateVM(config => $vm_config_spec, pool => $rp_moref);

0 Kudos