Quantcast
Channel: VMware Communities : Unanswered Discussions - vSphere Management SDK
Viewing all 1055 articles
Browse latest View live

VB.net CreateImportSpec VMDK File over 2GB.

$
0
0

Hi Everyone,

     When I call this function with an end goal of uploading a .VMDK file to an ESX host, I get an Arithmetic Overflow due to the amount of memory trying to be allocated by .NET frame over 2GB (My VM is approx 8GB) on line CreateImportSpec.

When taking a look at Java examples of this API it seems Java is able to commit to the allocation of the VMDK thus having it succeed. Does anyone know how to translate this over correctly in .NET?

Thanks!

 

[code]

Public Sub ImportToESX(pathToOVF As String, VMName As String, HostIP As String)

        '#Region "Check input"

        If String.IsNullOrEmpty(pathToOVF) Then

            Throw New ArgumentNullException()

        End If

        If String.IsNullOrEmpty(VMName) Then

            Throw New ArgumentNullException()

        End If

        If String.IsNullOrEmpty(HostIP) Then

            Throw New ArgumentNullException()

        End If

        If Not pathToOVF.ToUpper().EndsWith(".OVF") And Not pathToOVF.ToUpper().EndsWith(".VMDK") Then

            Throw New ArgumentException("pathToOVF must contain a .OVF/.VMDK file")

        End If

        '#End Region

 

 

        Dim importSpecParams As New OvfCreateImportSpecParams()

        importSpecParams.DiskProvisioning = OvfCreateImportSpecParamsDiskProvisioningType.thin.ToString()

        importSpecParams.EntityName = VMName

        importSpecParams.HostSystem = _hostSystem.MoRef

        importSpecParams.Locale = "US"

        importSpecParams.DeploymentOption = String.Empty

 

 

        Dim ovfDescriptor As String = read_ovf_content(pathToOVF)

        If String.IsNullOrEmpty(ovfDescriptor) Then

            Throw New ApplicationException("Error loading OVF descriptor")

        End If

 

 

        Dim resourcePool As ResourcePool = DirectCast(_vimClient.FindEntityView(GetType(ResourcePool), Nothing, Nothing, Nothing), ResourcePool)

 

 

        Dim ovfImportResult As OvfCreateImportSpecResult = _ovfManager.CreateImportSpec(ovfDescriptor, resourcePool.MoRef, _hostSystem.Datastore(0), importSpecParams)

 

 

        If ovfImportResult Is Nothing Then

            Throw New ApplicationException("Error creating import spec")

        ElseIf ovfImportResult.[Error] IsNot Nothing Then

            ' this fault means user has earlier version of ESXi

            ' than what OVF was created with.

            If TypeOf ovfImportResult.[Error](0).Fault Is OvfNoSupportedHardwareFamily Then

                Throw New ApplicationException("The ESXi server is not compatable with this OVF")

            End If

 

 

            Throw New ApplicationException(ovfImportResult.[Error](0).LocalizedMessage)

        End If[/code]


powercli 5.8 release 1 get-CI* set-CI*

$
0
0

I'm trying to use this set of commandlets

Get-CIAccessControlRule

Get-CIDatastore

Get-CINetworkAdapter

Get-CIRole

Get-CIUser

Get-CIVApp

Get-CIVAppNetwork

Get-CIVAppStartRule

Get-CIVAppTemplate

Get-CIView

Get-CIVM

Set-CIAccessControlRule

Set-CINetworkAdapter

Set-CIVApp

Set-CIVAppNetwork

Set-CIVAppStartRule

Set-CIVAppTemplate

 

I've downloaded and installed power cli 5.8 release 1

 

when I type "get-help" Get-CI*

nothing gets returned

 

The rest of the commandlets all work as advertised

I'm wondering what I need to do to get all of the Get-CI* commandlets to be available

 

Thank you for any assistance

 

can's run web service SDK samples

$
0
0

hello all,

 

I have download and compile the vsphere web service SDK and samples. but when I try to launch a simple test, it fails:

➜  vsphere-ws  ./run.sh com.vmware.general.Connect --basic-connection --url https://10.112.113.154:/sdk --username root --password password

-- VMware samples in Java --

 

    ERROR: com.vmware.connection.Connection

 

java.lang.InstantiationException: com.vmware.connection.Connection

    at java.lang.Class.newInstance(Class.java:427)

    at com.vmware.common.samples.parameters.Parameters.inject(Parameters.java:216)

    at com.vmware.common.samples.registry.SampleReference.run(SampleReference.java:87)

    at com.vmware.common.Main.run(Main.java:282)

    at com.vmware.common.Main.sampleSwitching(Main.java:254)

    at com.vmware.common.Main.registeredSample(Main.java:169)

    at com.vmware.common.Main.main(Main.java:121)

Caused by: java.lang.NoSuchMethodException: com.vmware.connection.Connection.<init>()

    at java.lang.Class.getConstructor0(Class.java:3082)

    at java.lang.Class.newInstance(Class.java:412)

    ... 6 more

 

Any clue?

 

thanks a lot!

Get connection closed error when trying to extract data from vCenter Server using C# application

$
0
0

I get the below error while extracting data from vCenter 5.5 Server using C# vSphere 5.5 SDK (The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.)

 

 

ERROR The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.

System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)

   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

   --- End of inner exception stack trace ---

   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

   at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)

   at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

   at System.Net.TlsStream.Read(Byte[] buffer, Int32 offset, Int32 size)

   at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)

   at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)

   --- End of inner exception stack trace ---

   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)

   at Microsoft.Web.Services3.WebServicesClientProtocol.GetResponse(WebRequest request, IAsyncResult result)

   at Microsoft.Web.Services3.WebServicesClientProtocol.GetWebResponse(WebRequest request)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

   at Vim25Api.VimService.RetrieveProperties(ManagedObjectReference _this, PropertyFilterSpec[] specSet)

   at vCenterTestConnect.vCenterESXHostInfo.getvCenterHostAdvancedInfo()

   at vCenterTestConnect.vCenterESXHostInfo.startExtraction()

 

Yje application works fine in test environment in our lab (with 2 hosts and 22 VM) but gives the above error when used in prod environment. Any help would be appreciated.

Retrieve user information (name, email, ...) for a given login name / principal

$
0
0

I use a vCenter with LDAP connection and the vSphere management SDK 5.5.

I found UserSearchResult, but it just provides "fullname", "group" and "principal".

Is it possible to:

1. at least retrieve the user's email address (no matter from which source: LDAP or if vCenter has an internal storage that is also fine)?

2. or even better to retrieve arbitrary user information via LDAP?

When I set intervalId other 20 in PerfQuerySpec api and execute api QueryPerf(querySpec => [$perfQuerySpec]) i get error

$
0
0

I am executing following piece of code to get the performance metrics. When I set intervalId other 20 in PerfQuerySpec api and execute api QueryPerf(querySpec => [$perfQuerySpec]) i get error -

A specified parameter was not correct.
querySpec.interval'

 

Need help to resolve this issue. I want to setup rollup interval as 1 hr so that we get average cpu and memeory usage of past 1 hr.

 

 

my $serviceInst = Vim::get_view (mo_ref => ManagedObjectReference->new(type => 'ServiceInstance', value => 'ServiceInstance'));

 

my $perfMgr = Vim::get_view (mo_ref => $serviceInst->content->perfManager);
my (@hosts,@metrics,%metricResults) = ();

 

my $perfCounterInfo = $perfMgr->perfCounter;
my @metricIDs ;

 

my $metric ;
my $groupInfo ;
my $nameInfo  ;
my $instance ;
my $key ;
my $rollupType ;
my $statstype ;
my $unitInfo ;
my $res;
my $unitString;
my $values;
my $metricRef;

 

#grab all counter defs
my %allCounterDefintions = ();
foreach(@$perfCounterInfo)
{
$allCounterDefintions{$_->key} = $_;
}

 

# enumerate all performance counters by their IDs
my %perfCounter = map { $_->key => $_ } @{$perfMgr->perfCounter};

 

foreach my $vm_view (@$vm_views)
{
my $vmref ;
my @vmdk ;
while (my ($key, $value) = each(%{$vm_info}))
{
my $vmname = $$vm_info{$key}{VMName};
if (defined($vmname) && $vm_view->name eq $vmname )
{
$vmref = $$vm_info{$key};
}
}
if (!$vmref)
{
next;
}
$vmref->{'averagePercentCapacityContention'} = ();
$vmref->{'cpuAveragePercentUsage'} = ();
$vmref->{'memoryAverageUsage'} = ();
if (!defined($vm_view))
{
next;
}

 

my $availmetricid = $perfMgr->QueryAvailablePerfMetric(entity => $vm_view);

 

foreach(sort {$a->counterId cmp $b->counterId} @$availmetricid)
{
if($allCounterDefintions{$_->counterId})
{
$metric = $allCounterDefintions{$_->counterId};
$groupInfo = $metric->groupInfo->key;
$nameInfo = $metric->nameInfo->key;
$instance = $_->instance;
$key = $metric->key;
$rollupType = $metric->rollupType->val;
$statstype = $metric->statsType->val;
$unitInfo = $metric->unitInfo->key;

 

#e.g. cpu.usage.average
my $vmwInternalName = $groupInfo . "." . $nameInfo . "." . $rollupType;

 

foreach(@metrics)
{
if($_ eq $vmwInternalName)
{
my $metricId = PerfMetricId->new(counterId => $key, instance => '*');
if(! grep(/^$key/,@metricIDs))
{
push @metricIDs,$metricId;
}
}
}
my $metricId = PerfMetricId->new(counterId => $key, instance => '*');
}
}

 

my $perfQuerySpec = PerfQuerySpec->new(entity => $vm_view, maxSample => 10, intervalId => 20, metricId => \@metricIDs);

 

my $metrics = $perfMgr->QueryPerf(querySpec => [$perfQuerySpec]);

The current virtual disk format of the template is “Thin provision” and It must be converted to “Thick Provision Lazy Zeroed” after cloning

$
0
0

Hi all,

 

Recently I have developed a VMware automation tool deploying Virtual Machine from a template through vSphere SDK

The current virtual disk format of the template is “Thin provision” and It must be converted to “Thick Provision Lazy Zeroed” after cloning

I have tried many different ways but I have not resolved the issue.

Could anyone help me to convert the existing virtual disk format through vSphere SDK?

 

$diskfileBacking = new VirtualDiskFlatVer2BackingInfo();

$diskfileBacking->fileName = '[Test] RHEL 6.6 Non-Prod/RHEL 6.6 Non-Prod.vmdk';

$diskfileBacking->diskMode = "persistent";

$diskfileBacking->thinProvisioned = false;

 

$desc = new Description();

$desc->label = "testvm_disk_0";

$desc->summary = "Disk 0";

 

$disk = new VirtualDisk();

$disk->capacityInKB = '58720256';

$disk->controllerKey = 1000;

$disk->unitNumber = 0;

$disk->backing = $diskfileBacking;

$disk->key = 2000;

$disk->deviceInfo = $desc;

 

$spec = new VirtualDeviceConfigSpec();

$spec->operation = 'edit';

$spec->device = $disk;

 

Regards

InitiateFileTransferToGuest copies file filled with NULL to vm

$
0
0

Hi,

I am using pyvmomi to automate some of our testing activities. There are several threads which read a single configuration file(ending with py), make some changes and then write this file with overwrite enabled to some vms. The configuration file is read with 'rb' mode in python. In most of the cases, if I open the configuration file on the vm, it is filled with NULLs due to which tests dont kick start on the vm. For my reference I am writing the modified file contents to the local disk of the system from where I am triggering the pyvmomi script. All the times, these local files will contain valid text, but on the corresponding vm, the file will be filled with NULL.

Following is the some part of the code which I am using.

self.creds = vim.vm.guest.NamePasswordAuthentication(username=vmusername, password=vmpassword)
self.si = SmartConnect(host=esx_ip, user=esx_user, pwd=esx_password)
self.vm = search_index.FindByUuid(None, self.targethost, True, False)
self.content = self.si.RetrieveContent()
filecontent = myfile.read().replace(some_string,some_other_string)

some code..

try:    fileattrib = vim.vm.guest.FileManager.FileAttributes()    url = self.content.guestOperationsManager.fileManager.InitiateFileTransferToGuest(self.vm, self.creds, hostfilename, fileattrib, len(filecontent), True)    resp = requests.put(url, data=filecontent, verify=False)    if not resp.status_code == 200:        self.logger.error("Error uploading config")        sys.exit(1)    else:        self.logger.info("Successfully uploaded the config")except Exception as e:    self.logger.error(e)    sys.exit(1)

Is there anything wrong in what I am doing? 


vcenter Host HA configuration

$
0
0

we are trying to configure 2 hosts in HA mode setup in a cluster.

one of the hosts has 10 virtual machines and the other one has no vms.Should we do anything specific in configuring HA for the hosts

currently,if we disconnect one host in HA cluster,the other host is not getting all the 10  "VM disconnected events".

 

Are we missing anything here in HA setup.Please suggest

Multi-Threading in Java API

$
0
0

Does the vSphere management SDK support multi threading. I try to realize a pool of service instance objects to be reused, because my application needs many of them and I do not want to recreate them all the time.

Now I wonder, whether objects of ServiceInstance are multi-thread safe or whether I have to make sure, that each ServiceInstance is accessed by only one thread at a time?

Can I use the vim25.jar in an open source project to develop vm specific operations?

$
0
0
I downloaded vim25.jar as part of SDK.zip. Can I use the vim25.jar in an open source project to develop vm specific operations?

'The operation is not allowed in the current state.' (c# StartProgramInGuest) - state query required

$
0
0

I'm automating some VM configuration beyond a firewall, by leveraging the VMtools (or rather the StartProgramInGuest method) - My changes can come from any number of 'Configuration' Hosts - each of which can be making the relevant change.

Rather than wrapping the attempt to make the change in a try{}catch{} inside while Do, I'd like to be able to check the state of the VM (and its ability to start a program) before executing the code.

This is my current process(some poorly written error trapping removed for clarity) - The error above can be thrown by any method against the following :

VMware.Vim.GuestProcessManager

VMware.Vim.GuestFileManager

Could someone provide an idea of how to retrieve the state of a VM (i.e.whether the VM is able to accept an attempt to execute code using the code below)

// Some code to encode my powershell script here
_gpm = new VMware.Vim.GuestProcessManager(vimClient, new VMware.Vim.ManagedObjectReference("GuestProcessManager-guestOperationsProcessManager"));
_gfm = new VMware.Vim.GuestFileManager(vimClient, new VMware.Vim.ManagedObjectReference("GuestFileManager-guestOperationsFileManager"));
var tempDir = (_gpm.ReadEnvironmentVariableInGuest(vm, auth, envVars))[0].Replace("temp=", "");
tFile = _gfm.CreateTemporaryFileInGuest(vm, auth, "vmscript", ".log", tempDir);
VMware.Vim.GuestProgramSpec spec = new VMware.Vim.GuestProgramSpec();
spec.ProgramPath = "cmd.exe";
spec.Arguments = string.Format("/C powershell -NonInteractive -EncodedCommand {0} > \"{1}\" ", runScript, tFile);
pid = _gpm.StartProgramInGuest(vm, auth, spec);
 // track the pid to determine when the app exits
Int64[] pids = new Int64[1];
pids[0] = pid;
var processInfo = _gpm.ListProcessesInGuest(vm, auth, pids);
while (processInfo[0].ExitCode == null)
{
    Thread.Sleep(1000);
    _gpm.UpdateViewData();
    processInfo = _gpm.ListProcessesInGuest(vm, auth, pids);
}
if (processInfo[0].ExitCode != 0)
{
   // do something
}
var filey = _gfm.InitiateFileTransferFromGuest(vm, auth, tFile);
using (WebClient client = new WebClient())
{
    result = client.DownloadString(filey.Url);
}
_gfm.DeleteFileInGuest(vm, auth, tFile);

In a sense, It's like trying to trap state before executing invoke-VmScript from a powercli session.

Default value of the config.vmacore.soap.sessionTimeout

$
0
0

Hi,

 

On vcenter v6 I have faced with the situation when opened vcenter soap session failed after period of idleness with the soap error:

<?xml version="1.0"?>

<NotAuthenticatedFault xmlns="urn:vim25" xsi:type="NotAuthenticated">

        <object type="VirtualMachine">vm-5967</object>

</NotAuthenticatedFault>

 

I suppose it happens due to the expired soap session and the question is what is default timeout value for the vcenter soap session? I've found some forum threads and KB articles where 30 min interval is mentioned. But when I try to keep session untouched for more then 30 minutes it doesn't fail (from these tests timeout value seems to be more than couple of days). I tried to get this settings from vcenter via Get-AdvancedSettings cmdlet but the parameter value is not presented in the output. Meanwhile as soon as I set this settings (via vpxd.cfg) to 5 minutes using of any session that was untouched more then 5 minutes causes the NotAuthenticated error.

 

Could anybody please point me to the documentation where this default value is mentioned or suggest reliable way how to identify it?

Thank you

How to check if VirtualApp is started

$
0
0

Hi there,

 

I'm pretty new to the VIM API and am trying to evaluate if a vApp is started or not. I've found the VirtualAppVAppState enum but can't seem to figure out how to test it.

I've included a C# code snippet below - would appreciate anyone letting me know where I'm going astray...

 

Thanks!

 

 

NameValueCollection filter = new NameValueCollection();
filter.Add("Name", "^vapp");

IList<EntityViewBase> vappList = c.FindEntityViews(typeof(VirtualApp), null, filter, null);
foreach (VirtualApp vapp in vappList)
{     if (vapp.???????? == VirtualAppVAppState.started) //<-- Can't figure out how to evaluate the LHS??
...

How to start a VM?

$
0
0

Good morning everybody!

 

Really quick simple question, strange that I can't find any info elsewhere, but here goes: How do I start a virtual machine using the web API? I know my VMWare hypervisor web address, what web address do I call to make it startup an existing virtual machine? So far I've tried http://machinehost/sdk and http://machinehost:8333/sdk but my browser just ends up prompting me that the security certificate for that address has expired and then if I continue it takes me to a blank page.

 

Is the web API what I think it is? I believe that it is a REST API for developers to interface with VMWare hypervisors. If not could someone please direct me to the proper knowledge resources for VMWare RESTful APIs.

 

Thanks, cheers.


How do I use a local ticket acquired via VMware.Vim?

$
0
0

Object vSphereClient is already established and logged in.

 

using VMware.Vim;

 

private SessionManager GetSessionManager() {

  SessionManager sessionManager = null;

  try {

  ManagedObjectReference _svcRef = new ManagedObjectReference();

  _svcRef.Type = "ServiceInstance";

  _svcRef.Value = "ServiceInstance";

 

 

  ServiceInstance _service = new ServiceInstance(vSphereClient, _svcRef);

 

 

  ServiceContent _sic = _service.RetrieveServiceContent();

  sessionManager = (SessionManager)vSphereClient.GetView(_sic.SessionManager, null);

  }

  catch (Exception e) {

  throw (e);

  }

  return sessionManager;

}

public SessionManagerLocalTicket GetLocalTicket(string userName) {

  return GetSessionManager().AcquireLocalTicket(userName);

}

 

Here you see at method GetLocalTicket I can acquire a local ticket.

It creates a file with a one time username and password on the host, for instance:

/var/run/vmware-hostd-ticket/52b65cfa-d0d1-0dc6-ffc1-c8428d10e973

 

This file is available for a few seconds only (4 or 5 seconds, or so), after that it dissapears. I can use the contents of it to authenticate against for instance a vSphere host, one time.

 

The firstproblem is:

1. How do I read it from the host or use it for authentication directly?

 

I tried displaying it with "more /var/run/vmware-hostd-ticket/52b65cfa-d0d1-0dc6-ffc1-c8428d10e973"and I only get data similar to this: "52 1f 94 41 69 db 7c 67-ee d9 3a e4 dc 2d 6e b9~"

 

That doesn't make any sense to me, so the second problem is:

2. When acquired from the host, how do I use it? Is this the password string maybe?


And my third question:

3. How do I set the expiration time for the ticket to be more then a few seconds? Or in other words, the server-determined expiration time?

According to https://www.vmware.com/support/developer/vc-sdk/visdk2xpubs/ReferenceGuide/vim.SessionManager.html the expiration time is set some where on the host.

" The local ticket that is returned becomes invalid either after it is used or after a server-determined ticket expiration time passes."


How do I check for a licensed feature on a ESXi host? Getting: "The operation is not supported on the object."

$
0
0

This code is C#

 

public bool CheckLicenseFeature(string featureName, string hostName = "") {

  HostSystem host = null;

  if (String.IsNullOrEmpty(hostName)) {

  host = GetHostSystems().FirstOrDefault();

  } else {

  ost = GetHostSystems().Where(_host => _host.Name == hostName).FirstOrDefault();

  }

  if (host != null) {

  LicenseFeatureInfo lfInfo = GetLicenseManager().QuerySupportedFeatures(host.MoRef).Where(x => x.FeatureName == featureName).FirstOrDefault();

  if (lfInfo != null) {

  return true;

  }

  }

  return false;

}

When running QuerySupportedFeatures, I get:

The operation is not supported on the object.

Getting Esx and guest Vms Performance Data Using Vmware Sdk vmware.vim C# (vmware management sdk for .net)

$
0
0

I'm using vmware sdk for .net to get overall data from an esx host and its guest vm's

i've connected to esx server and got some data from guest like max cpu,max memory,ip and etc

now i want to get performance data(cpu usage,memory usage,alarms,etc) of both esx server and vm's

I searched everywhere in the internet and documentation but i couldn't find any good samples that works

the only thing I know is to use performance manager!

can anyone help me how to do it in my c# code? this is how i connect to my esx server:

VMware.Vim.VimClientImpl c = new VimClientImpl();

ServiceContent sc = c.Connect("https://<my ip add>/sdk");

UserSession us = c.Login("root", "Mypass");

and to get vms:

IList<VMware.Vim.EntityViewBase> vms = c.FindEntityViews(typeof(VMware.Vim.VirtualMachine), null, null, null);

thank you too much

Performance Metric: cpu.wait.summation - what is it summing over?

$
0
0

I'm using SOAP requests to QueryPerf to pull some performance data about VMs. 

 

The request I'm making uses the realtime interval (20s), and pulls cpu.wait.summation amoung other things.

 

For one VM, i'm getting a return of 75979, which doesn't seem possible.  Considering the polling interval is 20000 ms, it means a wait of 379.90 %. 

 

Am I missing something in this calculation?  My thought is that it could be a sum of wait time over each CPU core, although it's not clearly the case

Problems setting the EnterLockdownMode Method with SOAP / PHP

$
0
0

My question is hos to I use PHP / SOAP calls to  enable Lockdown mode?  The ESXi host is controlled via a  vCenter Server and I'm able to connect to the system and perform other tasks.

 

Hers a quick snippet:

 

$soapmsg['this'] = new soapval('_this','SearchIndex','SearchIndex');
$soapmsg['dnsName'] = "esxi1";
$soapmsg['vmSearch'] = "false";
//  $result2 = $client->call('FindByIp',$soapmsg,$namespace);
$result2 = $client->call('FindByDnsName',$soapmsg,$namespace);

This works fine.  Just to test my code I run the following.

unset($soapmsg);
     $soapmsg['this'] = new soapval('_this','HostSystem',$result2);

 

$soapmsg['timeout'] = 10;

        $result3 = $client->call('ExitMaintenanceMode_Task',$soapmsg,$namespace);

 

-----------------

Now when I runs the next piece of code it fails.

$soapmsg['task'] = $result3;

$result4 = $client->call('EnterLockdownMode',$soapmsg,$namespace)

 

-----------------

This is the error I receive when I execute the query.

 

 

 

host-78 <=  This is good .. It found the ESXi host

----------

task-81060   <= This is good as well . It tried to take the ESXiout of Maintenance mode.

----------

Array

(

    [faultcode] => ServerFaultCode

    [faultstring] => Unable to resolve WSDL method name EnterLockdownMode for namespace name urn:vim25

 

 

while parsing SOAP body

at line 1, column 346

 

 

while parsing SOAP envelope

at line 1, column 43

 

 

while parsing HTTP request before method was determined

at line 1, column 0

    [detail] => Array

        (

            [InvalidRequestFault] =>

        )

 

 

)

 

 

 

-----

Has anyone had any luck with using the EnterLockdownMode method???

Viewing all 1055 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>