Quantcast
Channel: VMware Communities: Message List - vSphere Management SDK
Viewing all 2052 articles
Browse latest View live

Re: Help with creating baremetal VM on Storage DRS Cluster (vSphere SDK)

$
0
0

It seems that way yeh - i can't remember if that was intentional or if i tried the other way first and it frustrated me so i then came up with this method - as you say the end result is the same, would be easy enough to try the other way first - not noticed any performance difference in terms of deployment time etc


Re: Incompatible device backing error when changing network adapter address type

$
0
0

I am currently doing the same. Reusing the nic and just change addressType and macAddress properties but I get the following fault:

Fatal error: Uncaught exception 'Vmwarephp\Exception\Soap' with message 'ServerFaultCode: . InvalidProperty: InvalidProperty Object

{

    [name] => _

}

' in /var/www/html/Vmwarephp/Service.php:74

 

I cannot find which property is generating the error. The "_" is only available in ManagedObjectReference object which are untouched in my code.

 

mount a volume always fail invoked by vmtools

$
0
0

Hi,

 

I wrote a python script to execute command in guest OS by pyvmomi 6.0. The main function I used is "GuestProcessManager.StartProgramInGuest" to talk with vmtools in guest OS to execute specific command.  this script is working well with almost LVM related command such as lvdisplay, lvcreate ..., but got failed with command "mount" a existing LV to a mount point which  is last step for us automating create new volume in guest OS(RHEL 7.2). I observed in /var/log/message, it always complain the volume already mounted in guest system, but actually I can't see this LV in guest by root. below is specific information about my script and steps

 

python script:

ps = vim.vm.guest.ProcessManager.ProgramSpec(programPath=vm_command, arguments=vm_param, envVariables=all_envs)

res = pm.StartProgramInGuest(vm, creds, ps)

 

programPath=/usr/bin/mount

vm_param=/dev/vgdata/jason1 /sutton3  (vgdata is a existing VG,and jason1 is a existing LV, the directory /sutton3 is point I want to mount)

 

 

Run script to mount volume in guest(actually vmtools to do execution), /var/log/message complaints like this:

 

Sep 17 19:46:03 vpc4219 vmtoolsd: mount: /dev/mapper/vgdata-jason1 is already mounted or /sutton3 busy

Sep 17 19:46:03 vpc4219 vmtoolsd: /dev/mapper/vgdata-jason1 is already mounted on /sutton3

 

 

 

Actually run command in guest by root, I didn't see this volume show up

[root@vpc4219 ~]# mount -l | grep sutton3

[root@vpc4219 ~]# df -hT

Filesystem            Type      Size  Used Avail Use% Mounted on

/dev/mapper/rhel-root xfs        63G   14G   50G  22% /

devtmpfs              devtmpfs  7.8G     0  7.8G   0% /dev

tmpfs                 tmpfs     7.8G   88K  7.8G   1% /dev/shm

tmpfs                 tmpfs     7.8G   25M  7.8G   1% /run

tmpfs                 tmpfs     7.8G     0  7.8G   0% /sys/fs/cgroup

/dev/sda1             xfs       497M  211M  287M  43% /boot

tmpfs                 tmpfs     1.6G   16K  1.6G   1% /run/user/42

tmpfs                 tmpfs     1.6G     0  1.6G   0% /run/user/0

 

 

Afterward, I manually run mount command in guest by root, rather than script. It is successful easily without any error/warning. the question is why vmtools always failed command and how to fix this issue? Does anybodyhelp on this? thanks in advance.

Re: Clone VM from TPL, Change DVS Backing - Not allowed in current state

$
0
0

That is what i thought too but template seems fine and the GUI can deploy (and make "experimental" hardware changes) ok. I have parked this for the moment to give me back some sanity! Just doing a post deployment reconfiguration - works perfectly initially is not connected then the reconfig enables it

Re: mount a volume always fail invoked by vmtools

$
0
0

Nobody met this kind of problem before?

Re: PowerCLI 6.3 changes with VimClient.Connect() for C# - SSL/TLS Error

$
0
0

I am in the exact same situation with C#.   Any ideas how I might manage to get around this error?

 

Thanks.

Re: PowerCLI 6.3 changes with VimClient.Connect() for C# - SSL/TLS Error

$
0
0

Able to work it out from some other searches....not the best way to do it perhaps, but will work for this purpose...

 

 

        private void IgnoreBadCertificates()

        {

            System.Net.ServicePointManager.ServerCertificateValidationCallback=new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);

        }

 

 

        private bool AcceptAllCertifications(object sender, System.Security.Cryptography.X509Certificates.X509Certificate certification, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors)

        {

            return true;

        }

Create a VM through CreateVM_Task and SOAP WebServices

$
0
0

Hello,

 

I am facing a strange problem here, trying to create a VM with Php & SOAP !

 

I managed to connect to my vCenter, and creating an "empty" VM with no additional hardware (no deviceChange section) is working fine ! As soon as I try to add a hardware element (CDRom in this case) It stops working.

 

Here's the XML code from my SOAP Request :

 

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:vim25" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

     <SOAP-ENV:Body>

          <ns1:CreateVM_Task>

               <ns1:_this>group-v689</ns1:_this>

               <ns1:config>

                    <name>testSOAPh</name>

                    <version>vmx-11</version>

                    <guestId>RHEL7_64guest</guestId>

                    <files>

                         <vmPathName>[vsanDatastore]</vmPathName>

                    </files>

                    <numCPUs>1</numCPUs>

                    <memoryMB>4096</memoryMB>

                    <deviceChange>

                         <VirtualDeviceConfigSpec>

                              <device type="VirtualCdrom">

                                   <key>-42</key>

                                   <connectable>

                                        <startConnected>true</startConnected>

                                        <allowGuestControl>true</allowGuestControl>

                                        <connected>false</connected>

                                   </connectable>

                                   <controllerKey>200</controllerKey>

                                   <unitNumber>0</unitNumber>

                              </device>

                              <operation>add</operation>

                         </VirtualDeviceConfigSpec>

                    </deviceChange>

               </ns1:config>

               <ns1:pool>resgroup-27</ns1:pool>

          </ns1:CreateVM_Task>

     </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

 

And the error message :

 

Required property device is missing from data object of type VirtualDeviceConfigSpec

 

while parsing serialized DataObject of type vim.vm.device.VirtualDeviceSpec

at line 2, column 400

 

while parsing property &quot;deviceChange&quot; of static type ArrayOfVirtualDeviceConfigSpec

 

while parsing serialized DataObject of type vim.vm.ConfigSpec

at line 2, column 213

 

while parsing call information for method CreateVM_Task

at line 2, column 169

 

while parsing SOAP body

at line 2, column 154

 

while parsing SOAP envelope

at line 2, column 0

 

while parsing HTTP request for method createVm

on object of type vim.Folder

 


I think I am missing something pretty simple ! Like how to imbricate the device type (how to specify that you want to create a VirtualCdrom which is a special type of VirtualDevice) and how to design an ArrayOfVirtualDeviceConfigSpec !


Any ideas ?


Thanks,

GS


Re: PowerCLI 6.3 changes with VimClient.Connect() for C# - SSL/TLS Error

How to get the uuid of a host system

$
0
0

Actually I want to add a PCIPassthrough device to a VM. In the VirtualPCIPassthroughDeviceBackingInfo, it need to set a systemId.
systemId    xsd:string    The ID of the system the PCI device is attached to. 

I have tried that this systemId is not the one in the HostSystemInfo. The uuid in the HostSystemInfo is just a hardware BIOS uuid, it's not the uuid for the ESXi host.
In the Esxi shell, I found the correct id is saved in the /etc/vmware/esx.conf file, as below:
/system/uuid = "57920319-a8d9-2180-4501-3497f6000f91"

The problem is how to get it.
I have tried to print the advancedOption in the HostConfigManager in the HostSystem, but it doesn't contain this UUID.
I know that this file can be printed by the path https://[HOST_NAME]/host/esx.conf, but it seems not an official method and I'm afraid that this method can be closed for some security reasons.
So how can I get this uuid?

Thanks a lot.

Is there any way to call system calls(like ioctl) in the SDK?

$
0
0

I need send a message a vmk device driver in the Java service, but I don't know whether current SDK support this.
In a local application, I can use system calls to open the device and call ioctl to operate it, as below:
    fd = open(dev, O_RDWR);
    ioctl(fd, IOCTL_GET_SOMETHING, some_info)
So now, I want to call the ioctl in the Java services through the SDK.
Is there any APIs in the SDK(like VI SDK) to run such system calls?

If there isn't, then what is the official method to send messages to a vmk device driver in the SDK?

Thanks a lot.

Re: How to get the uuid of a host system

$
0
0

Does anybody know this?

I find that the commands "esxcli system uuid get" and "esxcfg-info | grep 'System UUID'" in the ESXi shell also can get the value.

The VMKernel UUID has the same value as this uuid.

But I still can't find a way to get it in the SDK.

Adding vGPU using pyVmomi

$
0
0

Hi Everyone

 

I have been trying to add a vGPU using pyVmomi. I found a way of doing it in powershell from a blog which is as follows:

 

Param ($VM, $vGPUProfile)

    $VM = Get-VM $VM

    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec

    $spec.deviceChange = New-Object VMware.Vim.VirtualDeviceConfigSpec[] (1)

    $spec.deviceChange[0] = New-Object VMware.Vim.VirtualDeviceConfigSpec

    $spec.deviceChange[0].operation = 'add'

    $spec.deviceChange[0].device = New-Object VMware.Vim.VirtualPCIPassthrough

    $spec.deviceChange[0].device.deviceInfo = New-Object VMware.Vim.Description

    $spec.deviceChange[0].device.deviceInfo.summary = ''

    $spec.deviceChange[0].device.deviceInfo.label = 'New PCI device'

    $spec.deviceChange[0].device.backing = New-Object VMware.Vim.VirtualPCIPassthroughVmiopBackingInfo

    $spec.deviceChange[0].device.backing.vgpu = "$vGPUProfile"

    $vmobj = $VM | Get-View

    $reconfig = $vmobj.ReconfigVM_Task($spec)

    if ($reconfig) {

        $ChangedVM = Get-VM $VM

        $vGPUDevice = $ChangedVM.ExtensionData.Config.hardware.Device | Where { $_.backing.vgpu}

        $vGPUDevice | Select Key, ControllerKey, Unitnumber, @{Name="Device";Expression={$_.DeviceInfo.Label}}, @{Name="Summary";Expression={$_.DeviceInfo.Summary}}

 

However, I need a pyVmomi equivalent. The problem I am facing it is pyVmomi is not recognizing VirtualPCIPassthroughVmiopBackingInfo class.

 

Any ideas?

Re: "vDS dvs port cannot be found" when deleting a port mirroring session

$
0
0

I had the same problem and solved it:

 

PROBLEM: Cannot disable, edit, remove any port mirroring sessions.  Received error, similar to:

"The object or item referred could not be found. vDS dvs port 463 cannot be found".

 

CAUSE:  Although I had three port mirroring sessions configured, only one of the port mirroring sessions contained a source or destination "port 463" in it's configuration.  This caused problem with any/all other port mirroring sessions.

 

SOLUTION:  Find the one port-mirroring session that contains the port number from the error ("port 463 cannot be found") and edit the source/destination by deleting the offending port number.  Once the offending port number has been removed from the one specific port mirroring session, you will be able to edit/delete all the other port mirroring sessions.

Re: Building and Running Samples (vSphere Web Services SDK 6.0 and JDK 8 (1.8.0_x) and make code

$
0
0

Lower versions of JDK works fine, and not the JDK 1.8. Any workaround? We need a solution.


Re: Adding vGPU using pyVmomi

$
0
0

The powershell way I was referring to is available in the blog here:

http://www.virtu-al.net/2015/10/26/adding-a-vgpu-for-a-vsphere-6-0-vm-via-powercli/

 

I am able to model removing a vGPU in a python function that uses pyVmomi and it works just fine. However, adding a vGPU results in an error saying:

Incompatible device backing specified for device '0'

 

Here is my python implementation for adding a vGPU.

 

spec = vim.vm.ConfigSpec()

spec.deviceChange = [vim.VirtualDeviceConfigSpec()]

spec.deviceChange[0].operation = 'add'

spec.deviceChange[0].device = vim.VirtualPCIPassthrough()

spec.deviceChange[0].device.deviceInfo = vim.Description()

spec.deviceChange[0].device.deviceInfo.summary = 'NVIDIA GRID vGPU '+vgpuProfile

spec.deviceChange[0].device.deviceInfo.label = 'New PCI device'

# spec.deviceChange[0].device.backing = vim.vm.device.VirtualPCIPassthrough.VmiopBackingInfo()

spec.deviceChange[0].device.backing = vim.VirtualPCIPassthroughVmiopBackingInfo()

spec.deviceChange[0].device.backing.vgpu = str(vgpuProfile)

vmMor.ReconfigVM_Task(spec)

 

I supply vmMor(managed object reference for virtual machine) and vgpuProfile (string indicating profile name such as 'grid_m60-8q')

 

What am I missing?

vvol datastore became inactive

$
0
0

 

Hello there

 

After we registered our VASA Provider to the webclient(Version 6.5.0 Build 4240420),we successfully created datastores.

But after we refreshing the datastores,their status came into "inactive" and the capacity was "0.00B"

 

We searched the vvold logs and found something below:

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

2016-10-18T03:39:45.704Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::InitSoap: https://100.115.195.31:18543/XXXXXX/vasaService session state (TransportError) - recreating soap

2016-10-18T03:39:45.704Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::InitSoap: Soap client deleted successfully

2016-10-18T03:39:45.704Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::InitSoap: Master soap client created successfully

2016-10-18T03:39:45.704Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::InitSoap: _masterSoap=02c70940, iomode=33558544

2016-10-18T03:39:45.704Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::InitSoap VVold using 15 secs for soap connect timeout

2016-10-18T03:39:45.704Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::InitSoap VVold using 75 secs for soap receive timeout

2016-10-18T03:39:46.270Z warning vvold[6039B70] [Originator@6876 sub=Default] vvol_ssl_auth_init: Will skip CRL check as env variable VVOLD_DO_CRL_CHECK is not set!

2016-10-18T03:39:46.270Z info vvold[6039B70] [Originator@6876 sub=Default] VasaSession::KillAllConnections VP (vvol), purged 0 connections, 0 currently active, new genId (2978) (broadcast wakeup to all threads waiting for free connection)

2016-10-18T03:39:46.287Z error vvold[6039B70] [Originator@6876 sub=Default] VasaSession::DoSetContext: setContext for VP vvol (url: https://100.115.195.31:18543/XXXXXXX/vasaService) failed [connectionState: AuthorizationError]: INVALID_LOGIN (SSL_ERROR_SSL

--> error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small / SSL_connect error in tcp_connect())

2016-10-18T03:39:46.287Z error vvold[6039B70] [Originator@6876 sub=Default]

--> VasaOp::ThrowFromSessionError [#21779]: ===> FINAL FAILURE getEvents, error (INVALID_SESSION / Bad session state (TransportError)) VP (vvol) Container (vvol) timeElapsed=583 msecs (#outstanding 0)

2016-10-18T03:39:46.287Z error vvold[6039B70] [Originator@6876 sub=Default] VasaSession::EventPollerCB VP vvol: getEvents failed (INVALID_SESSION, Bad session state (TransportError)) [session state: TransportError]

2016-10-18T03:40:15.540Z info vvold[5FF8B70] [Originator@6876 sub=Default] VVolUnbindManager::UnbindIdleVVols called

2016-10-18T03:40:15.540Z info vvold[5FF8B70] [Originator@6876 sub=Default] VVolUnbindManager::UnbindIdleVVols done for 0 VVols

2016-10-18T03:40:16.297Z info vvold[5B97B70] [Originator@6876 sub=Default]

--> VasaOp::EventPollerCB [#21781]: ===> Issuing 'getEvents' to VP vvol (#outstanding 0/4) [session state: TransportError]

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

While we executed the ESXcli command of "esxcli storage vvol vasaprovider list "on the ESXi host,we found that the "Status" of the VP was "syncError".

Otherwise,if we run the command of "esxcli storage vvol storagecontainer list",we could see the status of the VVOL datastore was "inaccessible"

 

We didnot quite sure if there was something wrong with the SSL protocol and where need we modify.

Does anybody have any suggestions to this issue please?

Thank you very much!

 

Re: vCenter API description about instance for virtual disk performance counter "totalReadLatency"

$
0
0

Hi mahe90, I have the same problem. Did you find any solution??

Re: How to get the uuid of a host system

$
0
0

Finally I find the method by myself....

The systemIds of passthrough devices can be find by the path the EnvironmentBrowser->VirtualMachinePassthroughInfo->SystemId.

Can we get password of vCenter Server within vCenter Plugin?

$
0
0
I want to create a vCenter Plugin. In the plugin, I want to get password of vCenter Server and send it to another machine. I don't want user to input it manually. Can I get password of vCenter Server in the plugin?
Viewing all 2052 articles
Browse latest View live


Latest Images

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