Code Monkey home page Code Monkey logo

vmwarephp's People

Contributors

estheban avatar vadimcomanescu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vmwarephp's Issues

Could anyone know how to register extension?

Hi, I'd try to use as same as java vsphere management sdk, but not work...
Could anyone know how to register an extension?

Below is my code...but not work...
`

function register() {
    $dse = new Description();
    $dse->label="MyPlugin";
    $dse->summary="Testing Plugin";

    $esi = new ExtensionServerInfo();
    $esi->description=$dse;
    $esi->url="";
    $esi->company="MyCompany";
    $esi->type="test";
    $esi->adminEmail="[email protected]";

    $eci = new ExtensionClientInfo();
    $eci->version="1.0.0";
    $eci->url="";
    $eci->description=$dse;
    $eci->company="MyCompany";
    $eci->type="vsphere-client-serenity";

    $eti = new ExtensionTaskTypeInfo();
    $eti->taskID="testTask";

    $eei = new ExtensionEventTypeInfo();
    $eei->eventID="testEvent";

    $keyV0 = new KeyValue();
    $keyV0->key="Task.label";
    $keyV0->value="Task value";

    $eri = new ExtensionResourceInfo();
    $eri->locale="en_US";
    $eri->module="task";
    $va = array();
    array_push($va, $keyV0);

    $ext = new Extension();
    $ext->description=$dse;
    $ext->key="com.mycompany.test.myplugin";
    $ext->version="1.0.0";
    $ext->subjectName="vSphere 6.0 Extension";

    $sa = array();
    array_push($va, $esi);
    $ext->server=$sa;

    $ca = array();
    array_push($ca, $eci);
    $ext->client=$ca;

    $ext->lastHeartbeatTime="1970-01-01T00:00:00";
    $ext->company="MyCompany";

    $ta = array();
    array_push($ta, $eti);
    $ext->taskList=$ta;

    $ea = array();
    array_push($ea, $eei);
    $ext->eventList=$ea;

    $ra = array();
    array_push($ra, $eri);
    $ext->resourceList=$ra;

    $serviceContent = $this->vsphere->getServiceContent();
    $extensionManager = $serviceContent->extensionManager;
    $extensionManager->registerExtension($ext);
}

`

and error show
`
error:

PHP Warning:  array_merge(): Argument #2 is not an array in /opt/www-data/openmediavault/phpTest/Vmwarephp/Factory/SoapMessage.php on line 10

Warning: array_merge(): Argument #2 is not an array in /opt/www-data/openmediavault/phpTest/Vmwarephp/Factory/SoapMessage.php on line 10

Caught exception: ServerFaultCode: 
Expected <_this> tag not found

while parsing call information for method RegisterExtension
at line 2, column 115

while parsing SOAP body
at line 2, column 100

while parsing SOAP envelope
at line 2, column 0

while parsing HTTP request for method registerExtension
on object of type vim.ExtensionManager
at line 1, column 0. InvalidRequest: InvalidRequest Object
(
)

`

InvalidRequest error with vSphere 4.1.0

Hello,

I've been using vmwarephp very successfully with vSphere 5.5 - thanks for the great library!

However, I've got to use it with vSphere 4.1.0 now, which is supported according to the docs. However, I'm just getting a very anonymous error when trying to use it:

PHP Fatal error:  Uncaught exception 'Vmwarephp\Exception\Soap' with message 'ServerFaultCode: type. InvalidRequest: InvalidRequest Object
(
)
' in /root/vmw/vmwarephp/library/Vmwarephp/Service.php:74
Stack trace:
#0 /root/vmw/vmwarephp/library/Vmwarephp/Service.php(57): Vmwarephp\Service->makeSoapCall('RetrieveService...', Array)
#1 /root/vmw/vmwarephp/library/Vmwarephp/Service.php(82): Vmwarephp\Service->getServiceContent()
#2 /root/vmw/vmwarephp/library/Vmwarephp/Service.php(21): Vmwarephp\Service->getQueriedProperty('getSessionManag...', Array)
#3 /root/vmw/vmwarephp/library/Vmwarephp/Service.php(50): Vmwarephp\Service->__call('getSessionManag...', Array)
#4 /root/vmw/vmwarephp/library/Vmwarephp/Service.php(50): Vmwarephp\Service->getSessionManager()
#5 /root/vmw/vmwarephp/library/Vmwarephp/Factory/Service.php(13): Vmwarephp\Service->connect()
#6 /root/vmw/vmwarephp/library/Vmwarephp/Vhost.php(45): Vmwarephp\Factory\Service::makeConnected(Object(Vmwarephp\Vhost))
#7 /root/vmw/vmwarephp/library/Vmwarephp/Vhost.php(31): Vmwa in /root/vmw/vmwarephp/library/Vmwarephp/Service.php on line 74

Here's our VMWare version:

VMware vSphere Web Access Version 4.1.0 Build 426686
VMware vCenter Server Version 4.1.0 Build 491557

Any suggestions? Is there something wrong with our VMWare setup that is disallowing API access?

Thanks in advance!

soap fault when calling EnterMaintenanceMode_Task or RebootHost_Task

It seems second parameter disappears before the last SOAP call:

$task = $vhost->EnterMaintenanceMode_Task( $hosts, -1  );

PHP Fatal error: SOAP-ERROR: Encoding: object has no 'timeout' property in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php on line 71

PHP Fatal error: Uncaught exception 'Vmwarephp\Exception\Soap' with message 'Client: SOAP-ERROR: Encoding: object has no 'timeout' property. ' in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php:74

$task = $vhost->RebootHost_Task( $host, false  );

PHP Fatal error: SOAP-ERROR: Encoding: object has no 'force' property in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php on line 71

PHP Fatal error: Uncaught exception 'Vmwarephp\Exception\Soap' with message 'Client: SOAP-ERROR: Encoding: object has no 'force' property. ' in /var/cache/src/vmwarephp-master/library/Vmwarephp/Service.php:74

Tried to debug in Service.php:74 , print_r($soapMessage) shows that the second parameter is indeed missing.

The server is esxcli 5.5

Accessing VirtualMachine->snapshot when there are not snapshots creates an infinite loop

vm-123 has no snapshots.

$vm = $vhost->findOneManagedObject('VirtualMachine', 'vm-123');
$vm->snapshot; //infinite loop
$vm->hasSnapshots(); // tries to get $this->snapshot, infinite loop

The problem is that when there are no snapshots for the virtual machine, vSphere does not return a snapshot index at all. I verified this by inspecting the result from PropertyCollector->collectPropertiesFor. When it tries to access snapshot on that object it just starts the process all over again and loops until the maximum amount of nested function calls is reached.

Luckily, checking for the existence of snapshot with isset in Service->getQueriedProperty solves the issue:

    private function getQueriedProperty($method, $arguments) {
        $propertyToRetrieve = $this->generateNameForThePropertyToRetrieve($method);
        $content = $this->getServiceContent();
        if (isset($content->$propertyToRetrieve)) return $content->$propertyToRetrieve;
        $managedObject = $arguments[0];
        $foundManagedObject = $this->findOneManagedObject($managedObject->getReferenceType(),
            $managedObject->getReferenceId(), array($propertyToRetrieve));
        if (!isset($foundManagedObject->$propertyToRetrieve)) return null;
        return $foundManagedObject->$propertyToRetrieve;
    }

I'm going to make a pull request for the fix.

RetrieveServiceContent() not found

every time i tried to get Data out of a VHost i get the Error
PHP Fatal error: Uncaught Error: Call to undefined method Vmwarephp\SoapClient::RetrieveServiceContent()

Setting up the connection to vhost

This looks like something that could be very useful to me.
However, I’m having trouble connecting to my host.

Using a simple, existing SOAP client request, i can connect to my vhost using:
https://top.mydomain.net/sdk’

When trying to connect using this library, I tried:

$vhost = new \Vmwarephp\Vhost(‘https://top.mydomain.net/sdk’, ‘username’, ‘password’);
$virtualMachines = $vhost->findAllManagedObjects(‘VirtualMachine’, array(‘configStatus’));

But when I try to connect, I get errors:

PHP Notice: Undefined property: SoapFault::$detail in /var/www/smc/lib/vendor/vmwarephp/library/Vmwarephp/Exception/Soap.php on line 27
PHP Warning: Invalid argument supplied for foreach() in /var/www/smc/lib/vendor/vmwarephp/library/Vmwarephp/Exception/Soap.php on line 27
PHP Fatal error: Uncaught exception ‘Vmwarephp\Exception\Soap’ with message ‘HTTP: Could not connect to host. ‘ in /var/www/smc/lib/vendor/vmwarephp/library/Vmwarephp/Service.php:74
Stack trace:

I tried to use (removing the https:// and the sdk)
‘top.mydomain.net:443’

And I get a similar, but slightly less verbose error message:

PHP Fatal error: Uncaught exception ‘Vmwarephp\Exception\Soap’ with message ‘ServerFaultCode: type. InvalidRequest: InvalidRequest Object
(
)
‘ in /var/www/smc/lib/vendor/vmwarephp/library/Vmwarephp/Service.php:74

Added a bit of debugging to Service.php, but i'm not sure what to do with the response:

error is – RetrieveServiceContentArray
(
[_this] => SoapVar Object
(
[enc_type] => 101
[enc_value] => ServiceInstance
[enc_stype] => ServiceInstance
)

)
PHP Fatal error: Uncaught exception ‘Vmwarephp\Exception\Soap’ with message ‘ServerFaultCode: type. InvalidRequest: InvalidRequest Object

Any suggestions? I’m connecting to a vCenter server running 5.5

How to access virtual machine host information

Trying to figure out how to get information about the host for a given virtual machine.

Tried:
$virtualMachines = $vhost->findAllManagedObjects('VirtualMachine', array('parent', 'name', 'guest'));
but accessing $vm->parent or $vm->host or $vm->hostSystem doesn't get me to the eSXI machine running the vm.

Tried:
$hosts = $vhost->findAllManagedObjects('HostSystem', array('name')); foreach($hosts as $host){ echo '<h1>'.$host->name.'</h1>'; var_dump($host->findAllManagedObjects('VirtualMachine', array('parent', 'name', 'guest')); }
But it doesn't look like running 'findAllManagedObjects' on the host is supported

Using $vm->guestOperationsManager->fileManager fails

I'm trying to list the files a guest by using the following code:

    public function listFilesInVm(ManagedObject $vm, string $path, $offset = 0, $limit = 50, $pattern = null)
    {
        $this->logger->info('Listing files in '.$path.' of '.$vm->name);

        // Get file manager
        $fileManager = $vm->guestOperationsManager->fileManager;

        // Build args
        $args = [
            'vm' => $vm->getReferenceId(),
            'auth' => $this->getGuestAuthentication(),
            'filePath' => $path,
            'index' => $offset,
            'maxResults' => $limit,
            'matchPattern' => $pattern,
        ];

        $fileManager->ListFilesInGuest($args);
    }

Executing this fails always with the following exception:

  [Vmwarephp\Exception\Soap]
  ServerFaultCode: The request refers to an unexpected or unknown type.. InvalidType: InvalidType Object
  (
      [argument] => Type Mismatch: expected: N3Vim2Vm5Guest11FileManagerE, found: 13FileManagerMo
  )

The same error occurs if I use other methods of the $vm->guestOperationsManager->fileManager. All other request works perfectly

I'm using a vCenter server running 6.5

Any suggestions?

vSphere version 5.1

Hi,

Currently the README mentions "Currently the library supports vSphere API from version 4.1 to 5.0.1.".

I was wondering if this lib been tested on 5.1, or if any issues were to be expected?

Thanks!

Unable to determine type of Any error

Hi, great job! everything went fine until I try some codes to modify vm's extraConfig.

$vm = $vhost->findManagedObjectByName('VirtualMachine', 'new', array('config'));
$vmconf = $vm->config;
$vmExConf = $vmconf->extraConfig;
$vmExConf1[] = new OptionValue('RemoteDisplay.vnc.enabled','true');
$vmcs = new VirtualMachineConfigSpec();
$vmcs->extraConfig = $vmExConf1;
$vm->ReconfigVM_Task(array('spec'=>$vmcs));

here is the error message(Webservice faultString):

PHP Fatal error: Uncaught SoapFault exception: [ServerFaultCode]
Unable to determine type of Any

error parsing Any value
at line 2, column 253

while parsing property "value" of static type anyType

while parsing serialized DataObject of type vim.option.OptionValue
at line 2, column 192

while parsing property "extraConfig" of static type ArrayOfOptionValue

while parsing serialized DataObject of type vim.vm.ConfigSpec
at line 2, column 182

while parsing call information for method ReconfigVM_Task
at line 2, column 115

while parsing SOAP body
at line 2, column 100

while parsing SOAP envelope
at line 2, column 0

while parsing HTTP request for method reconfigure
on object of type vim.VirtualMachine
at line 1, column 0 in C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php:68
Stack trace:
#0 C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php(68): SoapClient->__call('ReconfigVM_Task', Array)
#1 C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php(68): Vmwarephp\SoapClient->ReconfigVM_Task(Array)
#2 C:\wamp in C:\wamp\www\VMPHP\vmwarephp\library\Vmwarephp\Service.php on line 68

I track down the soap request, do it in SoapUI, same error message shows.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:vim25">
SOAP-ENV:Body
ns1:ReconfigVM_Task
<ns1:_this type="VirtualMachine">2/ns1:_this
ns1:spec
ns1:extraConfig
ns1:keyRemoteDisplay.vnc.enabled/ns1:key
ns1:valuetrue/ns1:value
/ns1:extraConfig
/ns1:spec
/ns1:ReconfigVM_Task
/SOAP-ENV:Body
/SOAP-ENV:Envelope

I'm pretty sure ns1:valuetrue/ns1:value is the cause the problem, I look into the source code OptionValue class which indicate 'value' property is a type of //AnyType. Is there anyway I can quick fix this, thanks.

vSphere API v6 causes segfault after a certain number of machines

With the small script below, I get a segfault after looping through roughly half of our VMs.
Can you help me understand why? And if I am lucky, fix it?

Br
Robert

End of output

Ubuntu Linux (64-bit)
Number of virt : 1275
521
Microsoft Windows 7 (32-bit)
Number of virt : 1275
522
Microsoft Windows 7 (64-bit)
Number of virt : 1275
523
Segmentation fault

Code

<?php
   function CollectVMInfos()
  {
      require_once 'collectors/library/Vmwarephp/Autoloader.php';
      $autoloader = new \Vmwarephp\Autoloader;
      $autoloader->register();

      $sVSphereServer = "host";
      $sLogin = "user";
      $sPassword = "password";

      $vhost = new \Vmwarephp\Vhost($sVSphereServer, $sLogin, $sPassword);

      var_dump("vSphere API type: ".$vhost->getApiType().", version: ".$vhost->getApiVersion());

      //$aVirtualMachines = $vhost->findAllManagedObjects('VirtualMachine', array('config', 'runtime', 'guest', 'network', 'storage'));
      $aVirtualMachines = $vhost->findAllManagedObjects('VirtualMachine', array('config'));
      $i=0;
      foreach($aVirtualMachines as $oVirtualMachine)
      {
        echo "Number of virt : ".count($aVirtualMachines)."\n";
        echo $i++."\n";
        //var_dump($oVirtualMachine->config);
        //echo $oVirtualMachine->config->name."\n";
        echo $oVirtualMachine->config->guestFullName."\n";
      }
  }


CollectVMInfos();
?>

trying to get Tasks, fails

Dear Community,
i have a Problem with vmwarephp with version 5.5.
I am trying to get Tasks for a VM. Currently i am able to get all Tasks for a User, but not only for a VM.

My sourcecode looks like:

$oVM = $oVHost->findManagedObjectByName('VirtualMachine', "ib-webradio");
$oTaskVM = new TaskFilterSpecByEntity($oVM, 'self');
$oFilter = new TaskFilterSpec($oTaskVM);
$oTaskManager = $o->getServiceContent()->taskManager;

/* @var $oTasks TaskHistoryCollector */
$oTasks = $oTaskManager->CreateCollectorForTasks(array(
    "filter" => $oFilter,
));
print_r($oTasks);

when i am trying to execute the sourcecode above i get following exception:

Fatal error: Uncaught exception 'Vmwarephp\Exception\Soap' with message 'ServerFaultCode: . InvalidProperty: InvalidProperty Object ( [name] => _ ) ' in /Applications/MAMP/htdocs/vmware/library/Vmwarephp/Service.php:75 Stack trace: #0 /Applications/MAMP/htdocs/vmware/library/Vmwarephp/Service.php(24): Vmwarephp\Service->makeSoapCall('RetrievePropert...', Array) #1 /Applications/MAMP/htdocs/vmware/library/Vmwarephp/ManagedObject.php(42): Vmwarephp\Service->__call('RetrievePropert...', Array) #2 /Applications/MAMP/htdocs/vmware/library/Vmwarephp/ManagedObject.php(42): Vmwarephp\Service->RetrieveProperties(Object(Vmwarephp\Extensions\PropertyCollector), Array) #3 /Applications/MAMP/htdocs/vmware/library/Vmwarephp/Extensions/PropertyCollector.php(28): Vmwarephp\ManagedObject->__call('RetrievePropert...', Array) #4 /Applications/MAMP/htdocs/vmware/library/Vmwarephp/Extensions/PropertyCollector.php(28): Vmwarephp\Extensions\PropertyCollector->RetrieveProperties(Array) #5 /Applications/MAMP/htdocs/vmware/library/Vmwarephp/Ex in /Applications/MAMP/htdocs/vmware/library/Vmwarephp/Service.php on line 75

Maybe someone can help?

When i am leaving the Parameter "filter" blank, i get all tasks for a User unfiltered by Entity.

It seems, that the reference for the var "_this" is empty. I think, that i have the same problem, like another guy from here with "reconfigVM_Task".

Search Clustername - Hostname

I'm trying to set up a query as follows:
Find all Cluster names and show all Host in each Cluster
CLUSTERNAME1-> HOSTNAME1
HOSTNAME2

CLUSTERNAME2- HOSTNAME3
HOSTNAME4

My initial query:

$vCenterConnection = new \Vmwarephp\Vhost(vcenter.example.com:443', '[email protected]', 'password_of_user_auth'); //$Clusters = $vCenterConnection->findAllManagedObjects('ClusterComputeResource', array('host','name')); $Clusters = $vCenterConnection->findAllManagedObjects('ClusterComputeResource', array('name','host'));

This result as follow:

array(3) { [0]=> object(stdClass)#12 (2) { ["host"]=> array(2) { [0]=> object(stdClass)#80 (0) { } [1]=> object(stdClass)#84 (0) { } } ["name"]=> string(16) "CLUSTERNAME1" } [1]=> object(stdClass)#81 (2) { ["host"]=> array(2) { [0]=> object(stdClass)#82 (0) { } [1]=> object(stdClass)#83 (0) { } } ["name"]=> string(19) "CLUSTERNAME2" } [2]=> object(stdClass)#99 (2) { ["host"]=> array(6) { [0]=> object(stdClass)#109 (0) { } [1]=> object(stdClass)#101 (0) { } [2]=> object(stdClass)#102 (0) { } [3]=> object(stdClass)#92 (0) { } [4]=> object(stdClass)#98 (0) { } [5]=> object(stdClass)#94 (0) { } } ["name"]=> string(12) "CLUSTERNAME3" } }
["host"] give to me object(stdClass)# where number, I believe it is the host identifier.
My question is: How to use this identifier to determine the host name.

Can someone help me?

Title of project is incorrect

The title of this project, which is currently 'Vmwarephp - vShere API bindings for PHP' has a spelling error.

'vShere' should be renamed to 'vSphere', thus changing the title to 'Vmwarephp - vSphere API bindings for PHP' has a spelling error'

Get Alarm Descriptions

Hi.

Nice job!!

I would like to use your class to create Zabbix integration into the vCenter alarms, using the Discovery feature in Zabbix.
Im almost done, but i need one important thing.
Im not able to pull the AlarmDescription from the ID's in the declaredAlarmState. I think i need to be able to get data from the AlarmManager object.
Is it possible to add this?

Need help with getting information about VMs etc.

Hello,

I need some help with getting information about all VMs such as (only getting the name at the moment..):

  • Operation System
  • Power State
  • Numbers of vCores
  • RAM (in MB)

Also I want to copy a VM (it's offline), want to rename it, set the MAC address of it, and boot it afterwards. Could anybody help me?

isMethodAPropertyRetrieval is incompatible with some methods

The AlarmManager ManagedObject has the method GetAlarm. When you try to call it, the method gets changed to a property access for 'alarm' instead of calling the function GetAlarm. Since all of the vSphere methods start with an uppercase character, I changed isMethodAPropertyRetrieval to not use strtolower when evaluating the $calledMethod. So if you do $Vhost->getSessionManager(), it will retrieve the SessionManager object, but if you do $AlarmManager->GetAlarm(), it will call the method GetAlarm.

tcp连接状态CLOSE WAIT过多

当我使用swoole定时任务获取虚拟机平台数据的过程中,一段时间服务器会产生大量的CLOSE WAIT的tcp连接

CloneVM_Task throws an error

CloneVM_Task throws an error :

PHP Fatal error:  Uncaught exception 'Vmwarephp\Exception\Soap' with message 'ServerFaultCode: . InvalidProperty: InvalidProperty Object
(
    [name] => _
)
' in /root/vmwarephp/library/Vmwarephp/Service.php:77
Stack trace:
#0 /root/vmwarephp/library/Vmwarephp/Service.php(24): Vmwarephp\Service->makeSoapCall('RetrievePropert...', Array)
#1 /root/vmwarephp/library/Vmwarephp/ManagedObject.php(42): Vmwarephp\Service->__call('RetrievePropert...', Array)
#2 /root/vmwarephp/library/Vmwarephp/ManagedObject.php(42): Vmwarephp\Service->RetrieveProperties(Object(Vmwarephp\Extensions\PropertyCollector), Array)
#3 /root/vmwarephp/library/Vmwarephp/Extensions/PropertyCollector.php(28): Vmwarephp\ManagedObject->__call('RetrievePropert...', Array)
#4 /root/vmwarephp/library/Vmwarephp/Extensions/PropertyCollector.php(28): Vmwarephp\Extensions\PropertyCollector->RetrieveProperties(Array)
#5 /root/vmwarephp/library/Vmwarephp/Extensions/PropertyCollector.php(23): Vmwarephp\Extensions\PropertyCollector->getPropertiesUsingSpec(Object(PropertyFilte in /root/vmwarephp/library/Vmwarephp/Service.php on line 77

Not sure if it's a bug, may be it's something with my code. Please point me where I'm wrong. vmwarephp source code is latest from github.

Here is my code :

$vhost = new \Vmwarephp\Vhost('*****','*****','*****');

$vm = $vhost->findManagedObjectByName("VirtualMachine", "test1", array());
echo "vms is : $vm->name\n";

$cfs = new VirtualMachineCloneSpec();
$cfs->powerOn=FALSE;
$cfs->template=FALSE;
$cfs->snapshot=$vm->snapshot->currentSnapshot;
$cfs->location =new VirtualMachineRelocateSpec();
$cfs->location->diskMoveType='createNewChildDiskBacking';

$ret = $vm->CloneVM_Task(array('folder' => $vm->parent, 'name' => $vm->name .'-clone', 'spec' => $cfs));

I added some debug in /root/vmwarephp/library/Vmwarephp/Service.php, but can't find where to digg (following is the output of my script):

vms is : test1
error is - RetrievePropertiesArray
(
    [_this] => ManagedObjectReference Object
        (
            [_] => ha-property-collector
            [type] => PropertyCollector
        )

    [specSet] => PropertyFilterSpec Object
        (
            [propSet] => Array
                (
                    [0] => PropertySpec Object
                        (
                            [type] => Folder
                            [all] => 
                            [pathSet] => Array
                                (
                                    [0] => _
                                )

                        )

                )

            [objectSet] => Array
                (
                    [0] => ObjectSpec Object
                        (
                            [obj] => ManagedObjectReference Object
                                (
                                    [_] => ha-folder-vm
                                    [type] => Folder
                                )

                            [skip] => 
                            [selectSet] => 
                        )

                )

            [reportMissingObjectsInResults] => 
        )

    [options] => Array
        (
        )

)
<here comes the error message I pasted in first block>

Missing include for TypeDefinitions.inc with PSR0

It's been touched on on your blog as well: http://vadimcomanescu.wordpress.com/2013/03/19/vmwarephp-vsphere-api-bindings-for-php/comment-page-1/#comment-30

If you install \Vmwarephp via the following Composer:

{    
    "require": {
        "vmwarephp/vmwarephp": "dev-master"
    },
    "autoload": {
        "psr-0": {
            "Vmwarephp" : "vendor/vmwarephp/vmwarephp/library"
        }
    },
    "minimum-stability": "dev"
}

And you the try to use:

$vhost = new \Vmwarephp\Vhost(...);

you get the following error:

  [Vmwarephp\Exception\Soap]                                  
  Client: Class 'RetrieveServiceContentResponse' not found. 

I've solved it (ugly?) by including the necessary file within my usages:

require_once 'vendor/vmwarephp/vmwarephp/library/Vmwarephp/TypeDefinitions.inc';

After which it works. Could it be PSR0 autoloading isn't working as expected?

Also, the example in the readme for including the package in composer isn't working as I had to explicitly specify the PSRO autoloader to point to the correct 'libraries' directory - isn't the default naming either 'src' or 'lib'?

Let me know if I can help troubleshoot this further.

Thanks,
Mattias

I need help install or configure

Hello,

I can not install or configure Vmwarephp,

Vmwarephp is a pear module?

I need help

My web server is a Windows 2008 R2 with IIS 7.5 + php 5.3.13 + pear

thank you
Cirvent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.