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 ...
See more...
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);