list vms

esxcli vm process list
vim-cmd vmsvc/getallvms

create vm

steps taken from here

  1. create vm folder

    mkdir /vmfs/volumes/datastore1/hostname/
    
  2. create hard disk

    vmkfstools -c 32G -a lsilogic hostname.vmdk
    
    • -c - createvirtualdisk
    • -a - adaptertype [buslogic|lsilogic|ide|lsisas|pvscsi]
    • -d - diskformat [zeroedthick|thin|eagerzeroedthick]
  3. create hostname.vmx file with following (ref 3 for info on vmx files)

    config.version = "8"
    virtualHW.version= "7"
    guestOS = "winnetenterprise-64"
    memsize = "1024"
    displayname = "VirtualCenter"
    scsi0.present = "TRUE"
    scsi0.virtualDev = "lsilogic"
    scsi0:0.present = "TRUE"
    scsi0:0.fileName = "VirtualCenter.vmdk"
    ide1:0.present = "true"
    ide1:0.deviceType = "cdrom-image"
    ide1:0.filename = "/vmfs/volumes/4a68046d-2159a120-ebac-001a9253e68f/win2k3_x64.iso"
    ide1:0.startConnected = "TRUE"
    ethernet0.present= "true"
    ethernet0.startConnected = "true"
    ethernet0.virtualDev = "e1000"
    
  4. change permissions on vmx file

    chmod 744 hostname.vmx
    
  5. add vm to inventory

    vim-cmd solo/registervm /vmfs/volumes/datastore/hostname/hostname.vmx hostname
    

ref