Quantcast
Channel: VMware Communities : Popular Discussions - VIX API
Viewing all 34639 articles
Browse latest View live

CID and Parent CID are same in *0001.vmdk files

$
0
0

Hi,

 

Im using VIX api to create snapshot. Im doing in the following way...

 

1. delete the snap if already snap is available. So it merges the data's in flat.vmdk file and the changes will added in *delta.vmdk file.

2. Now creating new snapshot.

3. downloading snapshots except *Delta.vmdk and *.vswp files and logs files.

4. copy to some ESX environment.

5. MAchine is added succssfully.

 

But when i try to power on it says unable to find the file specified. when i check the *00001.vmdk file the CID and parent CID values are same. The values are same as the CID value of vmdk file. i.e unique CID is not created for the child vmdk file. So i have to edit the vmx file and chnge the line *.00001.vmdk to *.vmdk. Now the machine is powered ON successfully.

 

It happens to different guest os. My questions are 1. Why unique CID is not created foer child vmdk and am i doing anything wrong...

 

Please need answers

 

Thanks in advance


Programming VIX in Python

$
0
0

Hello:

 

I need to program some funtions with VIX API but I need do it in python. For this purpose I need to import dll, etc to python... and call vix functions from a python script...

 

someone can helps me??

 

thanks!

ESX 3.5 and the VIX API

$
0
0

 

I'm getting this error when I run "vmrun" on my ESX 3.5 system.

 

 

What library am I missing specifically? Is this a linux library I need to download or is it a VIX API library? 

 

 

Dec 07 10:38:58.223: app-3076464768| Loading Vix implementation library /usr/lib/vmware-vix/VSphere-4.1/32bit/libvix.so

Dec 07 10:38:58.229: app-3076464768| failed to load library /usr/lib/vmware-vix/VSphere-4.1/32bit/libvix.so (/lib/tls/libc.so.6: version `GLIBC_2.3.4' not found (required by /usr/lib/vmware-vix/VSphere-4.1/32bit/libvix.so))

Dec 07 10:38:58.229: app-3076464768| No Vix library found for provider 5 revision -1

Dec 07 10:38:58.229: app-3076464768| No implementation libraries loaded, cannot call 'VixJob_OnFinishAsynchOpWithHandle'

Dec 07 10:38:58.229: app-3076464768| No implementation libraries loaded, cannot call 'Vix_GetErrorText'

 

 

 

thanks

 

 

- h

 

 

how to retrieve path of vmdk files associated to a given VM (name)

$
0
0

How to retrieve list of all the vmdk files and there paths from datastore using any APIs?

 

I know it can be done via VI  API which uses web services. But is there any other way?

I could not find a way to do it using VIX API. VDD API ask for the path virtual disk mounter etc also requires path.

Where's VIX_SERVICEPROVIDER_VMWARE_PLAYER in 1.10.2?

$
0
0

Greetings,

 

I do not see VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_PLAYER in my Interop.VixCOM.dll built from the 1.10.2.15207 build of VixCOM.dll.  The VIX API reference for 1.10 indicates that it should be in there, but this is all I see:

 

#region Assembly Interop.VixCOM.dll, v2.0.50727

// G:\MSDProjects\iTest Projects\Reference Assemblies\Interop.VixCOM.dll
#endregion
using System;
using System.Runtime.InteropServices;
namespace VixCOM
{
    [Guid("3A9AC120-8161-4857-8677-F3B0B132A93D")]
    public abstract class Constants
    {
        public const int VIX_API_VERSION = -1;
        public const int VIX_CAPTURESCREENFORMAT_PNG = 1;
        public const int VIX_CAPTURESCREENFORMAT_PNG_NOCOMPRESS = 2;
        public const int VIX_CLONETYPE_FULL = 0;
        public const int VIX_CLONETYPE_LINKED = 1;
        public const int VIX_E_ALREADY_EXISTS = 23;
        public const int VIX_E_ANON_GUEST_OPERATIONS_PROHIBITED = 3018;
        public const int VIX_E_BAD_VM_INDEX = 8000;
        public const int VIX_E_BUFFER_TOOSMALL = 24;
        public const int VIX_E_CANCELLED = 10;
        public const int VIX_E_CANNOT_AUTHENTICATE_WITH_GUEST = 3024;
        public const int VIX_E_CANNOT_CONNECT_TO_HOST = 18000;
        public const int VIX_E_CANNOT_CONNECT_TO_VM = 3008;
        public const int VIX_E_CANNOT_POWER_ON_VM = 3041;
        public const int VIX_E_CANNOT_READ_VM_CONFIG = 4002;
        public const int VIX_E_CANNOT_START_READ_ONLY_VM = 3005;
        public const int VIX_E_CONSOLE_GUEST_OPERATIONS_PROHIBITED = 3026;
        public const int VIX_E_CRYPTO_BAD_BUFFER_SIZE = 17001;
        public const int VIX_E_CRYPTO_BAD_FORMAT = 17009;
        public const int VIX_E_CRYPTO_BAS_PASSWORD = 17005;
        public const int VIX_E_CRYPTO_EMPTY = 17011;
        public const int VIX_E_CRYPTO_ERROR = 17008;
        public const int VIX_E_CRYPTO_INVALID_OPERATION = 17002;
        public const int VIX_E_CRYPTO_KEYSAFE_LOCATOR = 17012;
        public const int VIX_E_CRYPTO_LOCKED = 17010;
        public const int VIX_E_CRYPTO_NEED_PASSWORD = 17004;
        public const int VIX_E_CRYPTO_NO_CRYPTO = 17007;
        public const int VIX_E_CRYPTO_NOT_IN_DICTIONARY = 17006;
        public const int VIX_E_CRYPTO_RANDOM_DEVICE = 17003;
        public const int VIX_E_CRYPTO_UNKNOWN_ALGORITHM = 17000;
        public const int VIX_E_DISK_CANTREPAIR = 16062;
        public const int VIX_E_DISK_CANTSHRINK = 16009;
        public const int VIX_E_DISK_CID_MISMATCH = 16008;
        public const int VIX_E_DISK_ENCODING = 16061;
        public const int VIX_E_DISK_FULL = 8;
        public const int VIX_E_DISK_INVAL = 16000;
        public const int VIX_E_DISK_INVALID_CONNECTION = 16054;
        public const int VIX_E_DISK_INVALIDCHAIN = 16030;
        public const int VIX_E_DISK_INVALIDDISK = 16063;
        public const int VIX_E_DISK_INVALIDPARTITIONTABLE = 16018;
        public const int VIX_E_DISK_KEY_NOTFOUND = 16052;
        public const int VIX_E_DISK_NEEDKEY = 16014;
        public const int VIX_E_DISK_NEEDSREPAIR = 16006;
        public const int VIX_E_DISK_NEEDVMFS = 16022;
        public const int VIX_E_DISK_NODEVICE = 16065;
        public const int VIX_E_DISK_NOINIT = 16001;
        public const int VIX_E_DISK_NOIO = 16002;
        public const int VIX_E_DISK_NOKEY = 16017;
        public const int VIX_E_DISK_NOKEYOVERRIDE = 16015;
        public const int VIX_E_DISK_NOLICENSE = 16064;
        public const int VIX_E_DISK_NOTENCDESC = 16020;
        public const int VIX_E_DISK_NOTENCRYPTED = 16016;
        public const int VIX_E_DISK_NOTNORMAL = 16019;
        public const int VIX_E_DISK_NOTSUPPORTED = 16013;
        public const int VIX_E_DISK_OPENPARENT = 16012;
        public const int VIX_E_DISK_OUTOFRANGE = 16007;
        public const int VIX_E_DISK_PARTIALCHAIN = 16003;
        public const int VIX_E_DISK_PARTMISMATCH = 16010;
        public const int VIX_E_DISK_RAWTOOBIG = 16024;
        public const int VIX_E_DISK_RAWTOOSMALL = 16029;
        public const int VIX_E_DISK_SUBSYSTEM_INIT_FAIL = 16053;
        public const int VIX_E_DISK_TOOMANYOPENFILES = 16027;
        public const int VIX_E_DISK_TOOMANYREDO = 16028;
        public const int VIX_E_DISK_UNSUPPORTEDDEVICE = 16066;
        public const int VIX_E_DISK_UNSUPPORTEDDISKVERSION = 16011;
        public const int VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST = 3033;
        public const int VIX_E_FAIL = 1;
        public const int VIX_E_FILE_ACCESS_ERROR = 13;
        public const int VIX_E_FILE_ALREADY_EXISTS = 12;
        public const int VIX_E_FILE_ALREADY_LOCKED = 15;
        public const int VIX_E_FILE_ERROR = 7;
        public const int VIX_E_FILE_NAME_INVALID = 22;
        public const int VIX_E_FILE_NAME_TOO_LONG = 20004;
        public const int VIX_E_FILE_NOT_FOUND = 4;
        public const int VIX_E_FILE_READ_ONLY = 11;
        public const int VIX_E_FILE_TOO_BIG = 21;
        public const int VIX_E_GUEST_OPERATIONS_PROHIBITED = 3017;
        public const int VIX_E_GUEST_USER_PERMISSIONS = 3015;
        public const int VIX_E_GUEST_VOLUMES_NOT_FROZEN = 20000;
        public const int VIX_E_HOST_DISK_INVALID_VALUE = 14003;
        public const int VIX_E_HOST_DISK_SECTORSIZE = 14004;
        public const int VIX_E_HOST_FILE_ERROR_EOF = 14005;
        public const int VIX_E_HOST_NBD_HASHFILE_INIT = 14013;
        public const int VIX_E_HOST_NBD_HASHFILE_VOLUME = 14012;
        public const int VIX_E_HOST_NETBLKDEV_HANDSHAKE = 14006;
        public const int VIX_E_HOST_NETWORK_CONN_REFUSED = 14009;
        public const int VIX_E_HOST_NOT_CONNECTED = 26;
        public const int VIX_E_HOST_SERVER_NOT_FOUND = 14008;
        public const int VIX_E_HOST_SOCKET_CREATION_ERROR = 14007;
        public const int VIX_E_HOST_TCP_CONN_LOST = 14011;
        public const int VIX_E_HOST_TCP_SOCKET_ERROR = 14010;
        public const int VIX_E_HOST_USER_PERMISSIONS = 3014;
        public const int VIX_E_INCORRECT_FILE_TYPE = 9;
        public const int VIX_E_INTERACTIVE_SESSION_NOT_PRESENT = 3034;
        public const int VIX_E_INTERACTIVE_SESSION_USER_MISMATCH = 3035;
        public const int VIX_E_INVALID_ARG = 3;
        public const int VIX_E_INVALID_HANDLE = 1000;
        public const int VIX_E_INVALID_HOSTNAME_SPECIFICATION = 18002;
        public const int VIX_E_INVALID_MESSAGE_BODY = 10001;
        public const int VIX_E_INVALID_MESSAGE_HEADER = 10000;
        public const int VIX_E_INVALID_PROPERTY_VALUE = 6001;
        public const int VIX_E_INVALID_SERIALIZED_DATA = 6004;
        public const int VIX_E_INVALID_UTF8_STRING = 27;
        public const int VIX_E_INVALID_XML = 2002;
        public const int VIX_E_LICENSE = 32;
        public const int VIX_E_LOGIN_TYPE_NOT_SUPPORTED = 3032;
        public const int VIX_E_MISSING_ANON_GUEST_ACCOUNT = 3023;
        public const int VIX_E_MISSING_REQUIRED_PROPERTY = 6003;
        public const int VIX_E_MUST_BE_CONSOLE_USER = 3027;
        public const int VIX_E_NEED_KEY = 30;
        public const int VIX_E_NO_DISPLAY_SERVER = 3043;
        public const int VIX_E_NO_GUEST_OS_INSTALLED = 3010;
        public const int VIX_E_NO_SUCH_PROCESS = 20003;
        public const int VIX_E_NOT_A_DIRECTORY = 20002;
        public const int VIX_E_NOT_A_FILE = 20001;
        public const int VIX_E_NOT_ALLOWED_DURING_VM_RECORDING = 3029;
        public const int VIX_E_NOT_ALLOWED_DURING_VM_REPLAY = 3030;
        public const int VIX_E_NOT_FOR_REMOTE_HOST = 18001;
        public const int VIX_E_NOT_FOUND = 2000;
        public const int VIX_E_NOT_SUPPORTED = 6;
        public const int VIX_E_NOT_SUPPORTED_FOR_VM_VERSION = 4001;
        public const int VIX_E_NOT_SUPPORTED_ON_HANDLE_TYPE = 1001;
        public const int VIX_E_NOT_SUPPORTED_ON_REMOTE_OBJECT = 20;
        public const int VIX_E_OBJECT_IS_BUSY = 5;
        public const int VIX_E_OBJECT_NOT_FOUND = 25;
        public const int VIX_E_OP_NOT_SUPPORTED_ON_GUEST = 3003;
        public const int VIX_E_OPERATION_ALREADY_IN_PROGRESS = 31;
        public const int VIX_E_OPERATION_NOT_ALLOWED_FOR_LOGIN_TYPE = 3031;
        public const int VIX_E_OUT_OF_MEMORY = 2;
        public const int VIX_E_POWEROP_SCRIPTS_NOT_AVAILABLE = 3009;
        public const int VIX_E_PROGRAM_NOT_STARTED = 3004;
        public const int VIX_E_READ_ONLY_PROPERTY = 6002;
        public const int VIX_E_REQUIRES_LARGE_FILES = 14;
        public const int VIX_E_ROOT_GUEST_OPERATIONS_PROHIBITED = 3019;
        public const int VIX_E_SCREEN_CAPTURE_BAD_FORMAT = 19001;
        public const int VIX_E_SCREEN_CAPTURE_COMPRESSION_FAIL = 19002;
        public const int VIX_E_SCREEN_CAPTURE_ERROR = 19000;
        public const int VIX_E_SCREEN_CAPTURE_LARGE_DATA = 19003;
        public const int VIX_E_SNAPSHOT_CHECKPOINT = 13009;
        public const int VIX_E_SNAPSHOT_CONFIG = 13007;
        public const int VIX_E_SNAPSHOT_DISKLIB = 13002;
        public const int VIX_E_SNAPSHOT_DISKLOCKED = 13014;
        public const int VIX_E_SNAPSHOT_DUMPER = 13001;
        public const int VIX_E_SNAPSHOT_DUPLICATEDDISK = 13015;
        public const int VIX_E_SNAPSHOT_EXISTS = 13004;
        public const int VIX_E_SNAPSHOT_INCONSISTENT = 13011;
        public const int VIX_E_SNAPSHOT_INDEPENDENTDISK = 13016;
        public const int VIX_E_SNAPSHOT_INVAL = 13000;
        public const int VIX_E_SNAPSHOT_LOCKED = 13010;
        public const int VIX_E_SNAPSHOT_MAXSNAPSHOTS = 13019;
        public const int VIX_E_SNAPSHOT_MEMORY_ON_INDEPENDENT_DISK = 13018;
        public const int VIX_E_SNAPSHOT_MIN_FREE_SPACE = 13020;
        public const int VIX_E_SNAPSHOT_NAMETOOLONG = 13012;
        public const int VIX_E_SNAPSHOT_NOCHANGE = 13008;
        public const int VIX_E_SNAPSHOT_NONUNIQUE_NAME = 13017;
        public const int VIX_E_SNAPSHOT_NOPERM = 13006;
        public const int VIX_E_SNAPSHOT_NOTFOUND = 13003;
        public const int VIX_E_SNAPSHOT_VERSION = 13005;
        public const int VIX_E_SNAPSHOT_VIXFILE = 13013;
        public const int VIX_E_SUSPEND_ERROR = 3012;
        public const int VIX_E_TEMPLATE_VM = 4003;
        public const int VIX_E_TIMEOUT_WAITING_FOR_TOOLS = 3000;
        public const int VIX_E_TOO_MANY_HANDLES = 1002;
        public const int VIX_E_TOOLS_INSTALL_ALREADY_UP_TO_DATE = 21010;
        public const int VIX_E_TOOLS_INSTALL_AUTO_NOT_SUPPORTED = 21006;
        public const int VIX_E_TOOLS_INSTALL_CANCELLED = 21004;
        public const int VIX_E_TOOLS_INSTALL_DEVICE_NOT_CONNECTED = 21003;
        public const int VIX_E_TOOLS_INSTALL_ERROR = 21009;
        public const int VIX_E_TOOLS_INSTALL_GUEST_NOT_READY = 21007;
        public const int VIX_E_TOOLS_INSTALL_IMAGE_INACCESIBLE = 21001;
        public const int VIX_E_TOOLS_INSTALL_IN_PROGRESS = 21011;
        public const int VIX_E_TOOLS_INSTALL_INIT_FAILED = 21005;
        public const int VIX_E_TOOLS_INSTALL_NO_DEVICE = 21002;
        public const int VIX_E_TOOLS_INSTALL_NO_IMAGE = 21000;
        public const int VIX_E_TOOLS_INSTALL_SIG_CHECK_FAILED = 21008;
        public const int VIX_E_TOOLS_NOT_RUNNING = 3016;
        public const int VIX_E_TYPE_MISMATCH = 2001;
        public const int VIX_E_UNABLE_TO_REPLAY_VM = 3039;
        public const int VIX_E_UNFINISHED_JOB = 29;
        public const int VIX_E_UNRECOGNIZED_COMMAND = 3001;
        public const int VIX_E_UNRECOGNIZED_COMMAND_IN_GUEST = 3025;
        public const int VIX_E_UNRECOGNIZED_PROPERTY = 6000;
        public const int VIX_E_VM_ALREADY_LOADED = 4004;
        public const int VIX_E_VM_ALREADY_UP_TO_DATE = 4006;
        public const int VIX_E_VM_HOST_DISCONNECTED = 34;
        public const int VIX_E_VM_INSUFFICIENT_HOST_MEMORY = 3011;
        public const int VIX_E_VM_IS_RUNNING = 3007;
        public const int VIX_E_VM_NOT_ENOUGH_CPUS = 3013;
        public const int VIX_E_VM_NOT_FOUND = 4000;
        public const int VIX_E_VM_NOT_RUNNING = 3006;
        public const int VIX_E_VMDB = 16;
        public const int VIX_E_VMX_MSG_DIALOG_AND_NO_UI = 3028;
        public const int VIX_E_WRAPPER_SERVICEPROVIDER_NOT_FOUND = 22003;
        public const int VIX_E_WRAPPER_VERSION_NOT_FOUND = 22002;
        public const int VIX_E_WRAPPER_WORKSTATION_NOT_INSTALLED = 22001;
        public const int VIX_EVENTTYPE_CALLBACK_SIGNALLED = 2;
        public const int VIX_EVENTTYPE_FIND_ITEM = 8;
        public const int VIX_EVENTTYPE_JOB_COMPLETED = 2;
        public const int VIX_EVENTTYPE_JOB_PROGRESS = 3;
        public const int VIX_FILE_ATTRIBUTES_DIRECTORY = 1;
        public const int VIX_FILE_ATTRIBUTES_SYMLINK = 2;
        public const int VIX_FIND_REGISTERED_VMS = 4;
        public const int VIX_FIND_RUNNING_VMS = 1;
        public const int VIX_GUEST_ENVIRONMENT_VARIABLE = 3;
        public const int VIX_HANDLETYPE_HOST = 2;
        public const int VIX_HANDLETYPE_JOB = 6;
        public const int VIX_HANDLETYPE_METADATA_CONTAINER = 11;
        public const int VIX_HANDLETYPE_NETWORK = 5;
        public const int VIX_HANDLETYPE_NONE = 0;
        public const int VIX_HANDLETYPE_PROPERTY_LIST = 9;
        public const int VIX_HANDLETYPE_SNAPSHOT = 7;
        public const int VIX_HANDLETYPE_VM = 3;
        public const int VIX_HOSTOPTION_USE_EVENT_PUMP = 8;
        public const int VIX_INSTALLTOOLS_AUTO_UPGRADE = 1;
        public const int VIX_INSTALLTOOLS_MOUNT_TOOLS_INSTALLER = 0;
        public const int VIX_INSTALLTOOLS_RETURN_IMMEDIATELY = 2;
        public const int VIX_INVALID_HANDLE = 0;
        public const int VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT = 8;
        public const int VIX_OK = 0;
        public const int VIX_POWERSTATE_BLOCKED_ON_MSG = 256;
        public const int VIX_POWERSTATE_PAUSED = 512;
        public const int VIX_POWERSTATE_POWERED_OFF = 2;
        public const int VIX_POWERSTATE_POWERED_ON = 8;
        public const int VIX_POWERSTATE_POWERING_OFF = 1;
        public const int VIX_POWERSTATE_POWERING_ON = 4;
        public const int VIX_POWERSTATE_RESETTING = 128;
        public const int VIX_POWERSTATE_RESUMING = 2048;
        public const int VIX_POWERSTATE_SUSPENDED = 32;
        public const int VIX_POWERSTATE_SUSPENDING = 16;
        public const int VIX_POWERSTATE_TOOLS_RUNNING = 64;
        public const int VIX_PROPERTY_FOUND_ITEM_LOCATION = 4010;
        public const int VIX_PROPERTY_HOST_API_VERSION = 51;
        public const int VIX_PROPERTY_HOST_HOSTTYPE = 50;
        public const int VIX_PROPERTY_JOB_RESULT_COMMAND_OUTPUT = 3005;
        public const int VIX_PROPERTY_JOB_RESULT_ERROR_CODE = 3000;
        public const int VIX_PROPERTY_JOB_RESULT_EXIT_CODE = 3004;
        public const int VIX_PROPERTY_JOB_RESULT_FILE_FLAGS = 3054;
        public const int VIX_PROPERTY_JOB_RESULT_FILE_MOD_TIME = 3062;
        public const int VIX_PROPERTY_JOB_RESULT_FILE_SIZE = 3061;
        public const int VIX_PROPERTY_JOB_RESULT_FOUND_ITEM_DESCRIPTION = 3036;
        public const int VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS = 3011;
        public const int VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_ELAPSED_TIME = 3017;
        public const int VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE = 3018;
        public const int VIX_PROPERTY_JOB_RESULT_HANDLE = 3010;
        public const int VIX_PROPERTY_JOB_RESULT_ITEM_NAME = 3035;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_BEING_DEBUGGED = 3057;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_COMMAND = 3053;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_ID = 3051;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_OWNER = 3052;
        public const int VIX_PROPERTY_JOB_RESULT_PROCESS_START_TIME = 3055;
        public const int VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_DATA = 3059;
        public const int VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_SIZE = 3058;
        public const int VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_COUNT = 3046;
        public const int VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS = 3049;
        public const int VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST = 3048;
        public const int VIX_PROPERTY_JOB_RESULT_USER_MESSAGE = 3002;
        public const int VIX_PROPERTY_JOB_RESULT_VM_IN_GROUP = 3001;
        public const int VIX_PROPERTY_JOB_RESULT_VM_VARIABLE_STRING = 3056;
        public const int VIX_PROPERTY_META_DATA_CONTAINER = 2;
        public const int VIX_PROPERTY_NONE = 0;
        public const int VIX_PROPERTY_SNAPSHOT_DESCRIPTION = 4201;
        public const int VIX_PROPERTY_SNAPSHOT_DISPLAYNAME = 4200;
        public const int VIX_PROPERTY_SNAPSHOT_IS_REPLAYABLE = 4207;
        public const int VIX_PROPERTY_SNAPSHOT_POWERSTATE = 4205;
        public const int VIX_PROPERTY_VM_IN_VMTEAM = 128;
        public const int VIX_PROPERTY_VM_IS_RECORDING = 236;
        public const int VIX_PROPERTY_VM_IS_REPLAYING = 237;
        public const int VIX_PROPERTY_VM_IS_RUNNING = 196;
        public const int VIX_PROPERTY_VM_MEMORY_SIZE = 106;
        public const int VIX_PROPERTY_VM_NUM_VCPUS = 101;
        public const int VIX_PROPERTY_VM_POWER_STATE = 129;
        public const int VIX_PROPERTY_VM_READ_ONLY = 107;
        public const int VIX_PROPERTY_VM_SUPPORTED_FEATURES = 197;
        public const int VIX_PROPERTY_VM_TOOLS_STATE = 152;
        public const int VIX_PROPERTY_VM_VMTEAM_PATHNAME = 105;
        public const int VIX_PROPERTY_VM_VMX_PATHNAME = 103;
        public const int VIX_PROPERTYTYPE_ANY = 0;
        public const int VIX_PROPERTYTYPE_BLOB = 6;
        public const int VIX_PROPERTYTYPE_BOOL = 3;
        public const int VIX_PROPERTYTYPE_HANDLE = 4;
        public const int VIX_PROPERTYTYPE_INT64 = 5;
        public const int VIX_PROPERTYTYPE_INTEGER = 1;
        public const int VIX_PROPERTYTYPE_STRING = 2;
        public const int VIX_PUMPEVENTOPTION_NONE = 0;
        public const int VIX_RUNPROGRAM_ACTIVATE_WINDOW = 2;
        public const int VIX_RUNPROGRAM_RETURN_IMMEDIATELY = 1;
        public const int VIX_SERVICEPROVIDER_DEFAULT = 1;
        public const int VIX_SERVICEPROVIDER_VMWARE_SERVER = 2;
        public const int VIX_SERVICEPROVIDER_VMWARE_VI_SERVER = 10;
        public const int VIX_SERVICEPROVIDER_VMWARE_WORKSTATION = 3;
        public const int VIX_SHAREDFOLDER_WRITE_ACCESS = 4;
        public const int VIX_SNAPSHOT_INCLUDE_MEMORY = 2;
        public const int VIX_SNAPSHOT_REMOVE_CHILDREN = 1;
        public const int VIX_TOOLSSTATE_NOT_INSTALLED = 4;
        public const int VIX_TOOLSSTATE_RUNNING = 2;
        public const int VIX_TOOLSSTATE_UNKNOWN = 1;
        public const int VIX_VM_CONFIG_RUNTIME_ONLY = 2;
        public const int VIX_VM_GUEST_VARIABLE = 1;
        public const int VIX_VM_SUPPORT_HARDWARE_UPGRADE = 8;
        public const int VIX_VM_SUPPORT_MULTIPLE_SNAPSHOTS = 2;
        public const int VIX_VM_SUPPORT_SHARED_FOLDERS = 1;
        public const int VIX_VM_SUPPORT_TOOLS_INSTALL = 4;
        public const int VIX_VMDELETE_DISK_FILES = 2;
        public const int VIX_VMPOWEROP_FROM_GUEST = 4;
        public const int VIX_VMPOWEROP_LAUNCH_GUI = 512;
        public const int VIX_VMPOWEROP_NORMAL = 0;
        public const int VIX_VMPOWEROP_START_VM_PAUSED = 4096;
        public const int VIX_VMPOWEROP_SUPPRESS_SNAPSHOT_POWERON = 128;
    }
}

 

Any idea why it's not in here?

 

Thank you,

 

 

-Randy

Perform Actions on a virtual host on esx server

$
0
0

Hello there

I try to connect to a virtual machine on an esx server. Creating a connection does work properly, but I can't perform anything on the virtualHost object!


This is how I create the connection:

VMWareVirtualHost virtualHost = new VMWareVirtualHost();

virtualHost.ConnectToVMWareVIServer(EsxServer, EsxUser, EsxPassword);


And now, whatever method or property I'm calling, for example:

List<VMWareVirtualMachine> vitualMachines = virtualHost.RegisteredVirtualMachines.ToList();

 

I end up getting this error:

System.Exception: Failed to get all registered virtual machines ---> System.Exception: Failed to open virtual machine: fileName="SREAT01/SREAT01.vmx" timeoutInSeconds=60 ---> Vestris.VMWareLib.VMWareException:

Insufficient permissions in the host operating system

   at Vestris.VMWareLib.VMWareInterop.Check(UInt64 errCode)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties, Int32 index, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Int32 propertyId, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName, Int32 timeoutInSeconds)

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

   at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareVirtualHost.Open(String fileName)

   at Vestris.VMWareLib.VMWareVirtualHost.get_RegisteredVirtualMachines()

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

   at Vestris.VMWareLib.VMWareVirtualHost.get_RegisteredVirtualMachines()

   at TestAutomationTool.Program.Main(String[] args) in c:\*****\Program.cs:line 20

 

Additional information:

- The user, does have the administrator rights for this VM

- vSphere Client, Version 5.5.0 / Build 1993072
- VMware vCenter Server, Version 5.5.0 / Build 1750787

 

Now, how can I fix this?

I searched the internet from the bottom to the top and could not find a solution!

 

Thanks in advance.

Regards, RUL

vmrun to change a host VM's network adapter connection settings

$
0
0

Hello!

 

I have a vSphere vCenter VM running Windows 2008 R2 that is hosting many VMs of varying OSs on several different network VLANs (100, 200, 300, etc). I would like to be able to run a command from a guest VM running Red Hat Enterprise Linux 6.5 to tell vCenter to switch the network adapter settings from one VLAN to another and back again. I have done a lot of investigating, but I have been unable to figure out a way to do it. The closest thing I have found to what I am looking for are the commands below, but they are not working.

 

vmrun -T vc -h 192.168.0.3 -P443 -gu <guestusername> -gp <guestpassword> readVariable "[Datastore Name] RHEL 6.5/RHEL 6.5.vmx" runtimeConfig ethernet0.vnet /dev/vmnet0

 

vmrun -T vc -h 192.168.0.3 -P443 -gu <guestusername> -gp <guestpassword> writeVariable "[Datastore Name] RHEL 6.5/RHEL 6.5.vmx" runtimeConfig ethernet0.vnet /dev/vmnet1

 

The readVariable command appears to execute successfully, but produces 0 bytes of data, and the writeVariable command gives an error stating that the operation is not supported. Is vmrun able to perform a switch between a VM's network connections or am I going to need to use a different approach? The reason I need to have a command to run instead of simply going into the guest VM's setting in vCenter and selecting the custom network from the drop down is so that the development and testing team can execute a script at will instead of being given administrative privileges.

Which API / SDK to use for creating and Configuring a VM

$
0
0

I'm looking to automate some tasks at work around VM creation and installation and was wondering which APIs / SDKs I should use?

 

I can see that VIX would allow me to automate tasks on the VM so I can use that to install the required software and copy files onto the VM I think, but is there an API / SDK that I can use to create a VM, set up HDD sizes and CPU / RAM allocation etc and possibly install windows from an ISO?

 

I would ideally like to interact with VMWare Workstation as the VMs generated would be used on workstation, but if not I could create the VM on an ESX server.

 

Apologies that this is a bit of an open / vague question but I wasn't really sure if this was even possible or where to look.


Clone.Vm using Vestris.VMWareLib

CopyfilefromHosttoGuest is not working: Throwing Exception

$
0
0

Hi,

 

I wrote a script to Automate file copy from my base machine(win7) to vmware workstation hosting windows 7 guest. I loaded Vestris.VMWareLib.dll(Version 1.6) in into Powershell and able to perform power on, Create directory and create snapshot but couldn't copy file from host to guest. Is there anything missing to perform file copy?

 

VIX downloaded from - VMWareTasks 1.6 - VMWareTasks: C# VixCOM wrapper library & tools (MOVED TO GITHUB) - Home

Vmware workstation: 7.0.0

Powershell: 3.0

Host: Windows 7 32 bit

Guest: Windows 7 32 bit(Running on vmware workstation 7.0.0 build-203739)

 

Script:

 

Add-Type -Path "D:\Vmware\vm\Interop.VixCOM.dll"

add-type -path "D:\Vmware\vm\Vestris.VMWareLib.dll"

$newvm =  New-Object "Vestris.VMWareComLib.VMWareVirtualHost"

$newvm.ConnectToVMWareWorkstation()

$power = $newvm.Open("D:\windows7 image\Windows 7.vmx")

$power.PowerOn()

$power.logininguest("test123","123456")

$folder = "tr1254as7"

$power.RunProgramInGuest("cmd.exe","/c md $folder")

$power.copyfilefromhosttoguest2("D:\testcopy\test.log","C:\$folder\test.log",1200)

 

Exception:

Exception calling "CopyFileFromHostToGuest2" with "3" argument(s): "Failed to

copy file from guest to host: guestPathName="D:\testcopy\test.log"

hostPathName="C:\tr1254as7\test.log" timeoutInSeconds=1200"

At line:7 char:1

+ $power.copyfilefromhosttoguest2("D:\testcopy\test.log","C:\$folder\test

.lo ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : Exception

 

I tried Copyfilefromhosttoguest() and Copyfilefromhosttoguest2() none of them is working.

Could any help me out, i am almost completed automation apart from copy file. It would be really helpful is someone answer.

 

Thanks,

Pavan

JNI VIX multithreading issues

$
0
0

Hi, we just bought VMware workstation 6 and are trying to automate some aspects of VMware through the VIX API (mostly just revert to snapshot).  We use to use VMware server but it was giving us a lot of issues (memory leaks and random crashes), so we decided to give workstation a shot.  We are accessing the VIX API through a JNI class that we developed so we can do all of our automation in Java.  The automation works just fine when we are automating just one virtual machine, but when our multithreaded program tries to control multiple virtual machines at the same time, we run into problems.  The problem occurs when we try to revert to snapshot; it will pop up an error message saying that "Windows XP Professional-000000x.vmdk" could not be found on the system.  I see that on every revert to snapshot, the name of the vmdk file changes between Windows XP Professional-0000001.vmdk and Windows XP Professional-0000002.vmdk, so it just seems that VMware is just somehow losing its reference to the newly renamed vmdk file.

 

OK, so what I've done so far for testing:  I created program where all it does is connect to virtual machines and loop over reverting to snapshot and waiting for VMware tools.  This program is multithreaded, and each thread is using our VIX JNI class to interface with its respective VM.  I have tried testing it with and without synchronized calls to the JNI class, and it would fail with the error message listed above with both cases.  It would not fail right away... it would throw up that error message randomly after each virtual machine has reverted to snapshot 3 or 4 times (or less).  I then changed my testing class around so that it would just interface with one VM, and that would work without any issues (i let it revert to snapshot and wait for VMtools around 20 times).  Another test that I did was to spawn off a seperate JVM for each virtual machine (which would load its own instance of the JNI dll), but that caused the same issues I had before.

 

So, it seems like there is some sort of shared state in the VIX API that is causing my program to lose its reference to its vmdk file.  I'm kind of stuck now at the moment; I thought that synchronizing my calls to revert to snapshot and wait for tools would have fixed any sort of multithreading issues we had... but that wasn't the case.  If anybody has any input on this, I would be very grateful.  Thanks.

glibc double free or corruption

$
0
0

I did not find this potential bug already posted.  Thus, I wanted to share it.

 

In certain situations when a VMware image (handler) has become corrupted, specifically its associated snapshot, and one calls the VIX API a glibc double free error will occur.  This leads to a SIGABRT and an immediate termination of the application.

 

The specs on the machine and API are as follows:

VIX API v1.2 (32 bit)

OS: Linux Red Hat Enterprise 4

 

(gdb) run

Starting program: /home/shasta/VIX_Tester_32/cj_tester

Reading symbols from shared object read from target memory...done.

Loaded system supplied DSO at 0xffffe000

going to call VixVM_Open()

Got open now wait for call....

Done waiting...

      • glibc detected *** double free or corruption (fasttop): 0x083842d0 ***

 

Program received signal SIGABRT, Aborted.

0xffffe410 in __kernel_vsyscall ()

(gdb) bt

#0  0xffffe410 in __kernel_vsyscall ()

#1  0x0050c7a5 in raise () from /lib/tls/libc.so.6

#2  0x0050e209 in abort () from /lib/tls/libc.so.6

#3  0x0054071a in __libc_message () from /lib/tls/libc.so.6

#4  0x00546fbf in intfree () from /lib/tls/libc.so.6

#5  0x0054733a in free () from /lib/tls/libc.so.6

#6  0xf7c7bbf6 in VixVM_GetCurrentSnapshot ()

   from /home/shasta/VIX_Tester_32/vmware-vix-distrib/vmware-vix/lib/ws-3/32bit/libvix.so

#7  0x0804a5eb in getCurrentSnapshot (

    vmxFilePath=0xffffd470 "/apps/Symantec/shasta/analysis/VMWareSessions/vmxphomesp2_5/vmxphomesp2_5.vmx")

at VMWareController.cpp:422

#8  0x0804aa6b in main () at cj_tester.cpp:12

 

You'll see that when the program calls VixVM_GetCurrentSnapshot() that the double free occurs.  Is it possible for the API to appropriately check and determine if the VM Handle is possible corrupt or at least has no allocate for it.  This would potentially eliminate the double free.

 

Below is my sample code that calls VixVM_GetCurrentSnapshot()

 

int getCurrentSnapshot(const char vmxFilePath[]) {

        /* Retrieve the current snapshot associated with a VM Images */

        VixError err;

        VixHandle vmHandle = GetHandleMap()->GetHandle(std::string(vmxFilePath));

        VixHandleWrapper snapshotHandle (VIX_INVALID_HANDLE);

 

       err = VixVM_GetCurrentSnapshot(vmHandle, snapshotHandle.GetHandleByPtr());      /* <----


SIGABRT occurs here */

        

        if (VIX_OK != err || snapshotHandle.GetHandle() == VIX_INVALID_HANDLE) {

#ifdef ERROR

                printf("Error getting snapshot handle: %s \n", Vix_GetErrorText(err, NULL));

#endif

                return err;

        }

 

        char* snapshotName = NULL;

        err = Vix_GetProperties(snapshotHandle.GetHandle(), VIX_PROPERTY_SNAPSHOT_DISPLAYNAME, &snapshotName, VIX_PROPERTY_NONE);

 

        char sName[strlen(snapshotName)];

        strcpy(sName, snapshotName);

        Vix_FreeBuffer(snapshotName);

 

        return 0;

}

VIX API 1.6.2 on ESXi 3.5

$
0
0

 

Hi,

 

 

I'm new to VIX and ESXi. To get familar with VIX I modified the enclosed sample code  guestOps.c so that I can try something on my ESXi host.

 

 

But it failed to execute VixVM_Open(...) , the output error message is "failed to open virtual machine '/vmfs/volumes/48ab13da-4bda1170-42d0-0019b9e157cf/Ubuntu/Ubuntu.vmx'(4000 The virtual machine cannot be found)".

 

 

I checked the vmpath, there's nothing wrong on the path, why can't it open the virtual machin?

 

 

Can anyone help me on this problem?

 

 

Thank you very much!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Running Commands on the guest from the VMWare 4.0 host

$
0
0

 

Hi all,

 

 

I wrote a script which would execute command in the Guest OS and return the output back to the host os. For this I used a Perl script guestCommand.pl("http://blogs.vmware.com/vix/files/guestcommand.pl"). But when I tried to run the same script with the VMWare 4.0, the perl script guestCommand.pl is not working.

 

 

During VMWare VIX 1.6.2 installation I had to compile and install vix-perl to make the guestCommand.pl to work. But GCC and Make utils are not available in the VMWare 4.0. How can I install GCC and other development tools in 4.0 or is there anyother way to install the vix-perl in the VMWare 4.0 system.

 

 

Any help is highly appericiated.

 

 

Thanks,

 

 

Vijaya.

 

 

 

 

 

How to script/program creation of image from web app

$
0
0

I have a web app that will need to take an existing VmWare image and create multiple instances of this image on the fly.  I'm guessing I could either do this via an API or VmWare CLI.  Any advice?


Error when running vmrun on Linux (vmrun 2.0.1)

$
0
0

 

Hi,

 

 

I tried to use vmrun on Linux (Ubuntu 8) with VMWare Server 2.0 installed (and vmrun 2.0.1 included).

 

 

I can browse my server with Web GUI (locally or remotely) with no problem, but when I tried to control it via command line locally (from that Linux itself), I keep getting this error message:

 

 

    Error: The specified service provider was not found

 

 

As I also have installed VMWare Server 2.0 on Windows (and vmrun 2.0.0, under VIX directory), I tried to control remotely to that first Linux machine and it works perfectly (needless to say that I can also control my local VMWare Server on my Windows box itself). The documentation and forum I read so far suggest that the vmrun is probably too old, to support -T server (but while my Windows can successfully do it with vmrun 2.0.0, and my Linux has 2.0.1, I'm a bit puzzled in that remark - but if it's the case, where can we download newer vmrun that support "-T server" for Linux?).

 

 

I'm pretty sure, it's not the security problem or wrong syntax (I even tried it as root), as I executed identical command on both machine. But if you're interested to know, the command I tried is:

 

 

   vmrun -T server -h https://10.128.41.27:8333/sdk -u (username) -p (password) list

 

 

(also have tried to use localhost, its machine name, or 127.0.0.1 on my local Linux with no difference)

 

 

Note:

 

 

I actually found a workaround to make it works using vmware-vim-cmd, but I found it much more tedious in syntax than vmrun. So, would prefer if I can make vmrun works.

 

 

Thanks for helping.

 

 

How to get/answer question via VIX API?

$
0
0

 

What I'm trying to do is to create virtual machines using C program with VIX API. First I create a VM as template. Then I copy all files of the first VM and do some neccessary modificaitons on the copy. After that, I use VIX API to regiester the new VM. From the web interface, I can see registration is successful. At last, I try to use VIX API to power on the new VM. The power on process hangs up in the middle way, and from the web interface, I can see it appears a "?" mark on the new VM, I click the "?" mark, and get a question to ask if I copied or moved the VM file since it detects uuid conflit. After I choose "I copied it", the uuid of the new VM is updated and the new VM get successfully powered on.

 

 

My question is that if it's possible to let my C program automatically answer the question via VIX API or some other mechanism? I want to automatically create new VMs based on the template VM.

 

 

Thanks in advance.

 

 

WaitForToolsInGuest does not return and hangs

$
0
0

 

I'm using VIX API 1.6.2 on 32 bit Windows 2003 (SP2) to control vitrual machines running on another 64-bit machine running ESXi 4.0.0 (171294).

 

 

The Virtual machine is running 32-bit Windows 2003 (SP2)  and has VMWare tools installed.

 

 

Using the VIX API I first revert to a named snapshot (that has the machine in shutdown state), then I power it on and wait for tools in guest before I run programs inside the VM.

 

 

The problem is that WaitForToolsInGuest ( ) does not return and hangs indefinately even after the OS has booted up successfully.

 

 

The code below works fine for ESX 3.5 (update 3) and also VMWare Server 2.0.1 but does not work forESXi 4.0.0 (171294)

 

 

 

 

 

My VBScript code that uses VIX API looks like this:

 

 

 

 

 

' Create the VIX library

 

 

Dim lib

 

 

Set lib = CreateObject("VixCOM.VixLib")

 

 

 

 

 

' Connect to ESXi server

 

 

Dim jobConnect

Set jobConnect = lib.Connect(VixCOM.Constants.VIX_API_VERSION, VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_VI_SERVER, "https://myesxiserver:443/sdk/", 0, "root", "mypwd", 0, Nothing, Nothing)

 

 

Set connectResults = Nothing

err = jobConnect.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), connectResults)

If lib.ErrorIndicatesFailure(err) Then

       Wscript.Echo "Connecting to host failed with error code "

       WScript.Quit(err)

End If

 

 

Dim host

 

 

Set host = connectResults(0)

 

 

 

 

 

' Open the virtual machine

 

 

Set jobOpenVM = host.OpenVM("[datastore] myvm/myvm.vmx", Nothing)

 

Set openVMResults = Nothing

err = jobOpenVM.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), openVMResults)

If lib.ErrorIndicatesFailure(err) Then

       WScript.Echo "Opening virtual machine failed with error code "

       WScript.Quit(err)

End If

 

' The vm object will be first element in the results array.   

 

 

Dim vm

Set vm = openVMResults(0)

 

 

 

 

 

' Power on the virtual machine

 

 

Dim jobPowerOn

Set jobPowerOn = vm.PowerOn(VixCOM.Constants.VIX_VMPOWEROP_NORMAL, Nothing, Nothing)

err = jobPowerOn.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

        WScript.Echo "Powering on guest failed with error code "

        WScript.Quit(err)

End If

 

 

 

' Wait until VMWare tools starts inside the guest

 

 

Dim jobWaitForTools

 

 

Set jobWaitForTools = vm.WaitForToolsInGuest(0, Nothing)

err = jobWaitForTools.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

       WScript.Echo "Waiting for tools in guest failed with error code "

       WScript.Quit(err)

 

 

End If

 

 

 

 

 

Thanks in advance.

 

 

 

 

 

Host Connect Problems [Vix-Perl]

$
0
0

 

Hi,

 

My code (shown below) is producing the following error:

 

 

 

Failed to get property type for 3010 on handle 16799219.

HostConnect() failed, 22003, GetErrorText(22003)

Retrieving Host Handle...% 

 

 

Code: http://www.pastie.org/544455

 

 

The above is the module, and to test it I just made a normal .plx file that included the module,  and

 

 

vm( '/home/josh/vmware/SLES 10.2/SLES10.2.vmx' , 'start' );

 

 

...which should run the subroutine start, and use the path specified, but as shown above, I get that instead.

 

 

All help is greatly appreicated :).

 

 

 

 

 

-Josh

 

 

"Unknown Error" problem

$
0
0

 

Hi,

 

 

I see an error like one below in my program and have no idea what's causing it:

 

 

7/14/2009 11:34:52 AM: Vestris.VMWareLib.VMWareException: Unknown error

   at Vestris.VMWareLib.VMWareInterop.Check(UInt64 errCode)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties)

   at Vestris.VMWareLib.VMWareJob.Wait[T](Object[] properties, Int32 timeoutInSeconds)

   at Vestris.VMWareLib.VMWareVirtualMachine.RunProgramInGuest(String guestProgramName, String commandLineArgs, Int32 options, Int32 timeoutInSeconds)

 

 

I'm using dblocks VMWareTasks VIX Wrapper for C# (http://vmwaretasks.codeplex.com). My program is responsible for managing automation jobs running on an ESXi 3.5 server. The format of such an automation jobs is as follows:

 

 

- Open the required VM, and login.

 

 

- Copy in some script files necessary to run the job.

 

 

- Run the scripts, wait until they're complete, (could be 30 - 40 minutes).

 

 

- Copy out some results files.

 

 

- Logout and close the VM.

 

 

I get the this 'Unknown Error' in the following scenario, (for example):

 

 

- Three automation jobs are running, with each running on a different VM on the same ESX server. I have three distinct connections to the server.

 

 

- One job completes and logs out and closes down the VM.

 

 

- This error is seen on the other two jobs, so they don't complete.

 

 

I know there is a VIX bug with multiple connections and host handle sharing, but these are three distinct connections to the server and I even keep any handles to the server until the end of the programs execution.

 

 

Does anyone have any idea what may be happening? If you need anymore information, please ask and I will provide. Or can anybody give me some steps to help debug this further?

 

 

Thanks.

 

 

 

 

 

Viewing all 34639 articles
Browse latest View live


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