Vmware

From Halfface
Jump to navigation Jump to search

Reload vmx file

vim-cmd vmsvc/reload Vmid

To power on a virtual machine from the command line:

  1. List the inventory ID of the virtual machine with the command:
vim-cmd vmsvc/getallvms
  1. Check the power state of the virtual machine with the command:
vim-cmd vmsvc/power.getstate <vmid>
  1. Power-on the virtual machine with the command:
vim-cmd vmsvc/power.on <vmid>

deploy vmware machine on cli

Look at image.

/vmfs/volumes/datastore1/ipmon_images/vmware-ovftool/ovftool /vmfs/volumes/datastore1/Test_image.ova
OVF version:   1.0
VirtualApp:    false
Name:          test

Annotation:  Test image. 
            
            Virtual Machine Version: 8
            
            CPU:       4vCPU
            Memory:  8G
            HD:         50G [ Optimal Performance = Thick Provision Eager 
            Zeroed ] 

Download Size:  1.69 GB

Deployment Sizes:
 Flat disks:   50.00 GB
 Sparse disks: 3.86 GB

Networks:
 Name:        vmware
 Description: vmware description

Virtual Machines:
 Name:               Test-SL-6.6-NovAPP
 Operating System:   rhel6_64
 Virtual Hardware:
   Families:         vmx-08 
   Number of CPUs:   4
   Cores per socket: 1
   Memory:           8.00 GB

   Disks:
     Index:          0
     Instance ID:    9
     Capacity:       50.00 GB
     Disk Types:     SCSI-VirtualSCSI 

   NICs:
     Adapter Type:   VmxNet3
     Connection:     dvpg-VM Linux-820

Setup machine from image.

/vmfs/volumes/datastore1/vmware-ovftool/ovftool -dm=thick -ds=datastore1 "--net:vmware=VM Network" '/vmfs/volumes/datastore1/ipmon_images/Test_image.ova' 'vi://root:password@localhost'
Opening OVA source: /vmfs/volumes/datastore1/Test_image.ova
Opening VI target: vi://root@10.151.105.131:443/
Deploying to VI: vi://root@10.151.105.131:443/
Transfer Completed                    
The manifest validates
Warning:
 - No manifest entry found for: 'SL-6.6-NovAPP-05092015-disk1.vmdk'.
Completed successfully

which version of esxi

# vmware -vl
VMware ESXi 4.1.0 build-260247
VMware ESXi 4.1.0 GA

backup

Backing up a running virtual machine. Run the following command to create a snapshot:

vmware-cmd <path to vmx file> createsnapshot <name of snapshot> <snapshotdescription> 1 1

Run the following command to make a clone:

vmkfstools -i  

Run the following command to remove all snapshots:

vmware-cmd <path to vmx file> removesnpshots

Backup the cloned VMDK file using NetBackup.

list virtual machines

esxcli vm process list

show ip address of esxi host

esxcli network ip interface ipv4 get