vSphere API - how to determine if a virtual computer is storage vMotioned?

Hello

Is there a level of the API test to determine if a virtual computer is storage vMotioned?

We have an automation script that performs operations on a virtual machine and we would like to expect storage vMotion (triggerred by a human or automated DTS) to complete before continuing.

Thank you

P.

I think the best way would be to check the list of disabledMethod for the virtual machine.

Each managed object VirtualMachine (http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/vim.VirtualMachine.html) has a property disabledMethods (http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/vim.ManagedEntity.html#disabledMethod).  You can check this property to ensure that the MigrateVM_Task method is not disabled (you may need to check a few methods be sure - you should see what it disabled when its being svmotioned).  If the relevant methods are not disabled, you can be confident this isn't in vmotioned.

The other option would be to get the current list of events in VC, filtered by the name of the Virtual Machine and ensure that none of them have migration tasks in the process.

Tags: VMware

Similar Questions

  • Can not put on the virtual computer after Storage VMotion

    I use the snap for the customer VI do some storage vmotion, where I can best use our space on our tables. I have a particular virtual machine that I transferred autour storage that has a total of 3 VMDK, all on separate LUNS. As soon as I moved them all in the right place, where I wanted them, I can't turn on the virtual machine because it says there is no space available on the device. I am trying to boot the machine with 4 GB of memory, the boot LUN more than 400 GB free on it. The other two LUNS have 225 MB, and 192 MB of free space. I can only start the machine if I change the memory of 192 MB or less. I know that problems with the file exchange and memory overhead, but this virtual machine has always run with these two LUNS with very little space. I can only assume it is somehow related to the storage vmotion. The pagefile is set to store the virtual machine and I'm still having the problem. Need help.

    Storage vmotion the VMX file of the LUN with more space (easier) or add manually a config parameter (settings, Options, general, settings) sched.swap.dir = / vmfs/volumes/DS/Machine

    (where DS and Machine related to your environment).

  • How to determine if my Virtual Center is the correct version

    Hi people,

    I'm a quick way determine whether my Virtual Center Server is running the latest version.  I have attached the screenshot of the Build.  Is this the best way to determine the version and I'm up to dayte?

    Thank you!

    Rick

    And Yes, you are using the current version of VirtualCenter - VirtualCenter 2.5 update 3 (build 119598)

    • Kyle

  • Storage test 55 certification vmotion, storage vmotion fails with "Could not lock file" on the virtual machine during storage vmotion

    In my view, that it is a known problem in ESXi 5.5 Update 2 release notes, someone knows a solution yet? This is an excerpt from the release notes:

    • Attempts to perform live storage vMotion of virtual machines with RDM disks can fail
      Storage vMotion of virtual machines with RDM disks can fail and virtual machines can be considered in turned off of the State. Attempts to turn on the virtual machine fails with the following error:

      Cannot lock the file

      Workaround: No.

    VMware support for the record said that the patch will update 3, it is known as an intermittent problem. Finally, it happened to me on the 9th attempt.

  • Try to migrate a virtual machine with storage vMotion

    Hello

    When I try to migrate a virtual computer to another data store (using storage vmotion - change datastore option on migration Assistant) I still see this warning on the migration wizard: this virtual machine must be powered off to perform this function.

    I'm completely lost, because I check the requirements to make a storage vmotion:

    1. license compliance: OK, we are authorized this feature

    2 source and destination storage of data available on the host: OK

    3. no snapshots: OK

    So, I do not understand why this message...

    What can I do? (of course I can't turn off the virtual machine).

    Thanks in advance.

    Which is my point... The message is related to the option greyed out only...

    / Rubeck

  • How can I force a virtual computer to use a specific physical network adapter in a system with 2 network cards?

    I have a host with 2 network cards system.   I have a NETWORK card for the host computer to connect to my domain.  I have a virtual machine that is a deployment server Windows running Windows 2008 server.   The second NIC is to come and turn off the host machine and will then go to a CIsco 3550.   I need the server VM to use deployment only the second NETWORK card and does not communicate the 1st network card that the host uses.

    Can someone please help?  I'm new to VMware.   The original virtual machine on an esx server and was then converted to VMware server 2.

    Yes, just run the network on this host Editor as well.

  • How to determine the vSphere edition

    How to determine vSphere edition of GUI or command? Well want to can someone tell me how? Thanks in advance

    Because the different editions have different characteristics, ex: profile host is ok for the Enterprise Plus edition , but not the company.

    Therefore, it is important to know which edition you're playing with.

    Hello

    Connect to vCenter with your Client vSphere and go to "Homepage-> Administration-> Licensing", here you can see each available license and what license applies to what host. A fast and pleasant look.

    Concerning

  • How to change the settings of computer Image virtual using VI SDK 4

    Hello

    All the

    I just wanted to know how to change the setting of Image of computer virtual using VI SDK 4

    Setting virtual machine Image could be (memory setting etc.)

    (1) Yes (If yes or no do you while the virtual machine is online is totally based on the question of whether the operating system supports or not)

    (2) I don't know what ' TTL you are referring?

    I would say take a look at the previous documents, I've linked to familiarize yourself with what you can do and another great reference point is the vSphere API itself doc: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/index.html and make use of Research to see what properties/attributes are available on the entities/objects.

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    150 VMware developer

    Twitter: @lamw

    If you find this information useful, please give points to "correct" or "useful".

  • VSphere API is available in VMware vSphere Essentials Kit?

    Hello

    TL; DR: I would like to know if the vSphere API is available in VMware vSphere Essentials Kit.

    We evaluated VMware vSphere to build an environment very small test & dev to work. Since vSphere worked well during our assessment, we will buy vSphere licenses.

    We only need to operate a single ESXi host and we don't much care our virtual machines because they are used for testing only. Thus, we don't need features such as vMotion.

    However, take us pictures and we depend on the vSphere API, because we use pyVmomi to administer our virtual machines.

    Because we only run an ESXi host, need for API vSphere vCenter but did not need features such as vMotion, I think that the Kit Essentials fits our needs. But I'm not sure it provides the vSphere API. If anyone can confirm?

    Kind regards

    Yes, vSphere API are available in the Essentials kit.

    Please see KB

    Ref: KB VMware: vSphere 6.x products offer

  • How to create the new virtual machine vm existing in the data store on ESXI

    I have ESXi and couple of virtual machines.

    I have the vsphere client on Windows 7.

    I then deploy the ovf from the vsphere client vm and it began to import my VM 30 GB.

    In the morning, I realized my vm with a vmdk file file has been transferred in the data store

    But I couldn't see any virtual computer.

    Now I don't know how to turn on this vmdk file that is in my data store

    @King_Robert

    It's a very bad habit of yours to just copy and paste content created by someone else, without even mentioning the source (http://www.mustbegeek.com/create-copy-of-existing-virtual-machine-in-esxi-server/)

    André

  • Determine the maximum use of the processor for a virtual computer in the custom user interface

    I want to determine the maximum use of the processor for a virtual computer in the custom user interface.  How can I do this?

    If I use a supermetric, there is no kind of attribute under CPU called "maximum use.

    Certainly, you get points for a long question! Although to be fair, it's probably my fault to feed you so much information to digest at once.

    1. I would say you can do two ways visually. Use the operations > detail view for 'normal ranges' use the upper limit of the normal range as your typical max. You want an absolute peak, add the metric of a graph or observe that highlight high and low watermarks.

    2. There are a lot of ways to display data, but if you want to display a single metric over a period of time, we could use the following widgets [on top of my head]:

    Top - N analysis

    Weather map

    Analysis of distribution of data

    Among these, I think of your desire for a "peak". Who you want real value, which eliminates the weather map. Then, I think that the concept of a 'Summit' and what is the best thing, I think that the 95th percentile... then I came with the widget of data distribution. The decision is ultimately yours given your particular use case.

    3. you can have it apply to several virtual machines - it's just a widget capable of being an independent provider or receiving widget (metrics, DO NOT choose to select resources). Each resource/metric will add to the widget and you can remove them if you like after it is added. You can certainly all the time you visit... It is date and time standard options you have in all the other widgets chart. With the widget data distribution, you want as much time as possible to get an accurate histogram of the cycles of workload.

    4. This is similar to the question above. You can certainly add parameters of individual resource or a DM that summarizes or AVG groups of resources. And as above, the delay is configurable, along with the other graph widgets.

    5. it's part of Q4 - you can sumN or avgN up to any number of resources with a SM, then discovers that SM in the widget of data distribution. When I said container, I mean an application, group resource pool... all that acts as a container parent within the vCOps.

    6. that's correct, SMs calc using data collected last points... aka single period of time. When you are referring to the longest period, I gave you a few examples of the attributes that are composed of several periods of time which are calculated and created by the adapter for VMware vCenter behvaior. In this case, you have the GVA 15 min CPU 1.5; These specific simple mobile GVA can be specific OR a copy using SMs. Next, you will have the chance is to find a way to distribute what you need through a widget [at that time].

    7. the distribution of data is not for export, it is for Visual functions. If you want the data in CSV, just use a typical chart of metrics and export to a csv and calc your own pics, avg, 95th, whatever.

    8. This is a bit of a mix of all your questions, put in place.

    You are right, if you added those 3 VMs, then calc was the 95th of the AVG. Like Q7, you would not export the data of the distribution of data because the raw data points are not - you do not pass the metric to a metric graphics standard and export via csv.

    Take advantage of...

  • How to move a single virtual disk (vmdk file) of one data store

    Hi guys,.

    I have a VM with 4 virtual disks (for example, 1.vmdk, 2.vmdk, 3.vmdk and 4.vmdk) all located on a SAN volume (e.g., SANVOL03). How can I move one of the virtual disks (for example, 3.vmdk) of its current volume of SAN to another (e.g. from SANVOL03 to SANVOL04) without turning off the virtual machine? It's vsphere 4.1

    Detach the VMDK virtual machine and move it manually on the desired data store.

  • How can I type of NETWORK adapter in the virtual computer a vCloud?

    I'm trying to write a script that compares the type of NETWORK card in vCloud NIC type in vCenter to work around a bug in vCloud 1.5.  I can get the type of NETWORK adapter in the virtual computer a vCenter by getting the vCenter VM up and running:


    $vcvm | Get-NetworkAdapter | FT-auto
    Name Type NetworkName MacAddress WakeOnLanEnabled
    ----              ----           ----------- ----------        ----------------
    Network adapter 1 isolated EnhancedVmxnet 00:50:56:01:00:33 True


    I do not get the same results when you perform an action similar to vCloud:
    $vcdvm | Get-CINetworkAdapter

    Connected primary index IPAddressAllocation IPAddress ExternalIPAddress VM
    ----- ------- ---------  ------------------- ---------       ----------------- --
    0 true true manual 192.168.10.30 nic1

    I can get all the other info NIC, such as the network, IP, MAC, etc, but not the type:
    ($vcdvm. ExtensionData.section) [2] .networkconnection

    Network: isolated
    NeedsCustomization: false
    NetworkConnectionIndex: 0
    IP address: 192.168.10.30
    ExternalIpAddress:
    IsConnected: true
    MACAddress: 00:50:56:01:00:33
    IpAddressAllocationMode: MANUAL
    Get_anyattr:
    VCloudExtension:

    For the moment, I get the type of NIC the vCloud himself database vCloud.  Thanks for any help.

    I use VMware vSphere PowerCLI 5.1 Release 1 build 793510

    I could tell you where to find it, but there is a bug in the API that shows only as PCNET32 anyway (sleep if she could be VMXNET3). Keep doing what you're doing with the database query.

    See you soon,.

    Jake

  • VSphere APIs and compatibility ESX

    I've implemented the backup of a VMWare VM and application of recovery with vSphere API and VDDK. The development has been done entirely on 5.0 ESX servers. The following discussion provides an overview of how I implemented the restoration.

    http://communities.VMware.com/message/2130483#2130483

    When another person has tested my application, he noted the rollback feature does not work. When I've debugged, I found parameter spec unit to CreateVM_Task behaves differently 5.0 Esx to Esx 4.0. In the case of Esx 5.0, it works perfectly, where as in the case of Esx 4.0, none of the devices that I fill before the CreateVM_Task is created and the restore fails because of this.

    How can I understand the compatibility of the Esx and the vSphereAPI versions? I assumed that the SDK should be retro-compatible with Esx Server? Can someone shed some light how this problem can be solved?

    Thank you

    . / Siva.

    Hi Siva,

    That sounds good, maybe, we'll get you going even faster than I expected:

    As already noted William

    lamw wrote:
    but in general, the more recent editions of vSphere will support previous editions of vSphere. vSphere 5.1 supports vSphere 4.x and 5.0

    the only thing being that if new properties are added to a data in 5.1 object then you can not use in 4.x or 5.0.

    It seems to me that your code is based on 5.0 WSDL generated by gsoap stubs. It is ultimately you generate SOAP requests that are supposed to work with 5.0, 5.1, 6.x one as well now. Yet, when he delivers the SOAP messages to 4.x, it is likely that you include a property that is not defined in the WSDL of 4.x.

    Attached is a diff of the definition WSDL VirtualMachineConfigSpec of 4.0 to 5.0 Quick. Look at line 27 and following

    
    27              
    ====
          !>      
    ====
    28              
    

    Here, you can see that numCoresPerSocket property was not available in 4.0, but was added in 5.0. It is also what we said the documentation centre: for vSphere API 5.0.

    You declare that numCPUs is affected but memoryMB not. Between the two numCoresPerSocket has been inserted to 5.0. It seems that the 4.0 Server reads your VirtualMachineConfigSpec until numCPUs then encounter numCoresPerSocket and abandoned.

    So far my theory.

    What I don't understand is that this seems to happen in silence as you don't declare any exception. Yet, says William

    wlam wrote:
    As you know, there will be new properties in new versions of vSphere such as 5.1, that if you try to assign to an older version of vSphere, it will throw an unknown error...

    As you can learn from the attached diff we serveral more properties that have been added to the 5.0. Might well want to comment on all those in your current code and re-run CreateVM_Task against server 4.0.

    Perhaps this might solve the problem.

  • Question so that the migration of the VM using the vSphere API

    Hello

    I am having some problems during the migration of a virtual machine using vSphere SDK.

    I have install the vSphere environment as there are two hosts esxi installed on different physical machines with multiple virtual machines above them.

    Now I want to migrate one say the virtual macines VM1 fron host1 to host2. I did it via vCenter uses the vSphere client and it worked fine. Now, I have to perform the same task using the vSphere API. For this I use the template of "VMotion" located in the com/vmware/vm directory. I run the command as follows:

    targethost $ run.bat url username password, shows targetpool

    I'm not sure of the targetpool argument and I need advice on what I need to specify a name of pool of resources here. Acorrding to:

    http://www.VMware.com/support/developer/VC-SDK/visdk400pubs/ReferenceGuide/Vim.virtualmachine.html#migrate

    If the pool parameter remains disabled, current pool of the virtual machine is used as target the pool. I tried specifying the pool of resources such as:

    [- targetpool]

    but it gives the error:

    Error: List of resources target not found.

    Looking forward to all the advice. Thank you.

    Even if you do not have resource pools, it is actually a 'root' list of resources"which will be still exists. Try to specify 'Resources' as the name of the targetpool and allow you to migrate your VM.

Maybe you are looking for