VMware ESXi: Shared Disk Between VMs


In some cases (as a rule in clustering scenarios) it may be necessary to share the same disk between 2 (or more) virtual machines (VMs). The most optimal way is to use the vmdk disk physically located on the shared storage or locally on the ESXi host. If you want to use shared drives on different ESXi hosts, you can only use the shared storage (datastore).
Suppose the shared external storage (connected to each ESXi host using iSCSI or Fibre Channel SAN) have already presented to all VMWare ESXi hosts, which are running the VMs you want to add a shared virtual drive. On both virtual machines you need to add a new SCSI controller.

VMware: Shared disk between virtual machines

In the vSphere Client inventory select first virtual machine (Node 1), right click on it and select Edit Settings
To add a new virtual device select SCSI controller in the dropdown list and press Add button.
As a type of SCSI controller select LSI Logic SAS.
Now you need to choose the desired SCSI Bus sharing mode:
  • Virtual – virtual disk shared between VM on the same ESXi host
  • Physical – vmdk file can be shared between VM on different ESXi hosts
Press OK. Next you need to add a new virtual drive on the first VM (New Device -> New Hard Disk -> Add) with the following disk settings:
  • VM Storage Policy: optional
  • Location: you need to select a shared datastore name, that will store the disc
  • Disk Provisioning: select Thick provision eager zeroed (another disk provisioning modes are not suitable)
  • Sharing: Multi-writer
  • Virtual Device Node: select created earlier SCSI controller
  • Disk mode: Independant – Persistdent – in this mode you can’t create a snapshots for a shared drive
In the same way you need to add a new SCSI controller to another virtual machine (Node 2). After that in the settings of the second virtual machine you need to add a new disk (Existing Hard Disk).
In the menu that appears, select Datastore, which kept the shared disk you created earlier. In the submenu, select the name of the first virtual machine and in the middle pane select the desired vmdk disc file.
If you want to use more than one shared disk on VMware, keep in mind that each of them does not require the addition SCSI controller. One controller can serve up to 16 different drives.
After changing the virtual machines settings, connect to the console of the guest OS virtual machine. In this case the VM with Windows. Start the Computer Management console and expand Storage -> Disk Management section. Right click and select Rescan Disk.
The system detects the new disk and offer to initialize it. Select the desired partition table (MBR or GPT), create a new partition and format it. Similar operations must performed on the second VM. After these settings, both VMs use shared disk.

⇚============================================================================================================================⇛

Configure Autostart of VM on VMware ESXi

By default, virtual machines located on VMWare ESXi or VMware Hypervisor is not starting automatically at the host boot. This means that after the ESXi host reboot (planned restart or crash, for example, caused by a power failure), Administrator have to manually start all the virtual machines. In this guide we will show you how to config Autostart VM with ESXi host without Administrator intervention.
At first, open browser and go to the login screen page of the VMware Web Client and then log on. In Web Client console, select ESXi host which you want to configure for VMs autostart. Then go to following tab Manage -> Settings -> VM Startup / Shutdown.
Tip. If your ESXI host is a part of vSphere HA cluster, you can’t configure VM autostart and shutdown settings this way, because HA cluster respond for the availability of VM.
As you can see all of the virtual machines disposed on a given ESXi host are in Manual Startup section. This means that after host rebooting they will have to be started manually.
In order to be booted automatically you need to add VMs manually to the Automatic Startup list.

How to configure VM autostart on VMware ESXi?

Click the Edit button.

In the dialog Edit VM Startup and Shutdown check on Allow virtual machine to start and stop automatically with the system. It is now possible to configure the auto start settings for VMs.
There are common options of startup and shutdown behavior:
  • Startup delay — How many seconds VMs wait before powering on (by default 120 seconds). This delay allows you to wait for booting of custom services and scripts execution
  • Shutdown delay — Specifies the time delay before shutdown each virtual machine (by default 120 seconds)
  • Shutdown Action — for each VM available 4 shutdown actions: None, Power Off , Suspend or Guest Shutdown (using opportunities of VMware Tools). Вy default used action is Power Off.
You can place VM to the one of the following sections:
  • Automatic Startup — all virtual machines in this section are starting automatically after the completion of the ESXi host boot. Administrator specifies a specific boot sequence of virtual machines. For example, domain controller should be booted first, then Exchange servers etc.
  • Any Order — VMs powering on automatically in random order
  • Manual Startup — Administrator should start this VMs manually
Select desired virtual machine and use Move up button to move it to Automatic Startup section. Similar action is performed with all the VMs.
Click OK to save your changes and close the dialog box.
Tip. If you have not configured the HA, but it is possible to move VMs between hosts using vMotion, startup settings are migrating to the destination host with VM.

Configure autostart of VM using PowerCLI

In addition, you can configure autostart setting of the VM using PowerCLI.  Display a list of the auto start action for all VMs on the host:
Get-VM –VMname * | Select-Object VMname, AutomaticStartAction
To enable Automatic Startup for all VMs which name starts with lon-, run the following command:
Get-VM –VMname lon-* | Set-VM –AutomaticStartAction Start
That’s it! You have successfully configured automatic startup for virtual machines on VMWare ESXi or vSphere Center.
⇚============================================================================================================================⇛

This is another one......

Comments

Popular posts from this blog

esxi-host-shows-disconnected-vmware

ESXi : Lost uplink redundancy on virtual switch "vSwitch0". Physical NIC vmnic0 is down

Virtual machines appear as invalid or orphaned in vCenter Server