Is there any option to create virtual machine in Esxi hypervisor directly using any of the sdks provided by vmware - virtual-machine

Currently I'm trying to create a vm in a Esxi server using Perl SDK provided by the vmware. The Vcenter host and name must be specified in create_vm.pl to create the vms in the Esxi server directly.
Is there any other SDK(like java) supports to install the vm directly on the Esxi serve without specifying the Vcenter.
link:https://www.vmware.com/support/developer/viperltoolkit/doc/utilityappsdoc/vmcreate.html

You just use the IP or hostname of the ESX/i host where it asks for vCenter. Keep in mind write operations are only supported on licensed versions of ESX/i so if you are using the free version it wont work.

I havent used PERL SDK for VMware, but I have used PowerCLI and PyVmomi for my tasks and the APIs require Host/vCenter IP as their host input.
When you provide VC as the host input, you get the objects related to vCenter for that VM, and if you provide ESXi host IP, you can create,manipulate VMs based on the limits of an ESXi server

Related

How can I share my virtual machine to others?

I am working with an Ubuntu 18.04 virtual machine. I can SSH into this machine via puTTy on the same computer. However, how can I access this machine from another computer? Or do I have any option to set this machine as a cloud server so others can access and run it?
I think that would all depend on how the networking is configured on your VM.
You can configure the network as bridged (where the VM has it's own dedicated IP address on the local subnet), NAT (where the VM shares the IP with the system running Workstation, but NAT rules can be configured to handle traffic), or host-only (where only the system running Workstation is able to connect to it).
Bridged is probably the easiest to use for your situation.
More information on these networking configs: Common Networking Configurations for Workstation

How could I access my VM in my host machine (By different IP)?

I want to access the virtual machine IP in the host (by ping or curl or something), but it is not ok. How could I make it?
The host machine is a win10 PC.
A virtual machine using VMware workstation 15, Ubuntu 16.04 server. It has IP address 192.168.178.138 and 10.0.0.11. I can access the 192.168.178.138, but cannot access 10.0.0.11. (no matter ping or curl...)
All are NAT mode in VMware Workstation.
Now I have a web application running on 10.0.0.11:80. How could I access it in my host machine.
Btw I have another VM with 192.168.178.39 and 10.0.0.31, and this VM can access the 10.0.0.11:80 by curl.
I can show the topo as below.
(A little Chinese but it won't affect reading, just ignore it)
Yes, now I solve this question by myself.
It seems that you cannot use the Host-only mode (Actually I can only use this mode...).
You need to set the virtual interface in your host PC (The IP, gateway, or anything else...);
Then you need to set in the VMWare workstation, set it to use speical lan (VM net 2 for me);
Then you can access it from the host machine and other vm, maybe you need to search something like NAT translation in VMWare workstation to access your web application deployed in the VM from outer network.
That's what I do, now I can access my horizon dashboard in the browser (The Ubuntu server don't have any browser... T-T sad ...)
Settings Picture

How to convert/migrate pyisical attached virtual machine to virtual disk or upload to esxi

THis request made me dysphoric, we have one VM with physical disk attached, this vm can write to this physical drive directy, now we must upload this vm to our esxi server to save places(this is pc), but I could not neither upload nor convert to virtual disk, so cannot migrate anymore.
client vm: centos
host: windows server 2012
vmware workstation version: 12.0
enter image description here
There's a couple ways this can be performed.
Since you're on a version of Workstation higher than 8.0, you might be able to connect directly to the ESXi host (or vCenter Server) and upload the VM. Here's the process to accomplish it: http://pubs.vmware.com/workstation-10/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-8C854257-8595-4877-B985-1DC801E98E88.html
If that doesn't work, you should try the vCenter Converter. It's a free "trial" through the following: https://www.vmware.com/products/converter.html
Here's a good walkthrough on how to use the converter: http://thesolving.com/virtualization/how-to-convert-a-vmware-workstation-vm-into-an-esxi-one-with-vcenter-converter/

Accessing VM's terminal using putty in host OS?

I am working on a project in which we logon to client's machine using Cirtix receiver. The machine which we connect to using Citrix receiver is basically a Windows 7 machine. Once we are in the client's windows box, inside that we have virtual box, in which VM has been added and which has all the needed software for us to do the development; for example JBOSS, database etc.
In the host machine (windows 7), we have putty, and using putty we sometimes login to the VM (i.e. terminal). The confusion which I have is as below:
We login to the VM terminal using IP address: 127.0.0.1. This is where my confusion is. 127.0.0.1 normally is the IP address with which we can refer to the current machine; so how using this IP address we are able to connect to the VM which is added to the virtual box? Doesn't the VM which is in virtualbox has its own IP address with which we can connect to? Or is there some concept which I am not aware of.
Can anyone help me in understanding this? I am not well versed with virtualization, so for the gurus this might be a naive question.
Every VM will have their uuids so to access the VM inside virtualBox or any hypervisor for that matter. so you can use that particular VM uuid and u should be able to console to that VM.
in virtual box try below
You can use: VBoxManage list vms to list all currently registered VMs with their settings, names and UUIDs.
Once you know the UUID you can also start a vm by:
VBoxManage startvm which is essentially same as: VBoxManage startvm "Name-of-vm"
Also Vm has two interfaces one loopback which will have an address of 127.0.0.1 and the rest of the interfaces so to access the VM with particular ip you need to assign an IP to that VM interface and than try with that IP.Also you might have that port 22 open for that loopback ip so may be that is the reason you are able to connect on loopback
I hope this answers your question

Is it possible to get ip address of VM's without installing ESXI tools?

I am using vSphere client to get informations from the installed VM.
I have gone through the following link :
http://benohead.com/getting-info-from-your-esx-server-using-the-vmware-infrastructure-vsphere-java-api-part-1/
and managed to get which ip's are up/down. I need the IP address.There is no tools installed. Is it possible to get IP address without installing Esxi tool?
You need to install the VMware tools if you would like to fetch the IP address. But without installing the VMware Tools there is an another way to fetch the IP address by using VM Name
In VirtualMachineConfigInfo class, getName() will return the VM Name or by using vm.config.name will return VM name and then pass the VM name to the below code
String ipAddress = InetAddress.getByName(<<VIRTUALMACHINENAME>>).getHostAddress();
Note: This code will works only if the host name is resolvable.
In short, it isn't. If it was, that'd break the whole illusion of virtualization.
There is another way, though, but it requires instrumenting the VMs. If you can install an agent inside the VM that broadcasts/pings it's IP to the outside world through some mechanism, that'd be a solution. Can't think of any other way you can get the IP of a machine. Not through the vsphere sdk definitely.