In my DC admins have to unplug my FC connection from ESXi5 (from EMC VNX) (temporary, some maintance works). I have never done that before and have some doubt about my own procedure...
My first thought was to turn off all VM's (but only few are using storage mounten via FC), then turn off ESXi, then admins will do they work and after reconect I will turn on my ESXi and all VM's (I don't is this correct thinking).
Second plan was to turn off only VM's that uses mounted storage via FC then let admins unplug FC connection...
I'm not convinced about the two ways. So what is a proper procedure for unplugging fiber chanel from ESXi.
What version of ESXi hypervisor do you have installed? The following procedure is for ESXi 5.x and it is performed from GUI with vSphere client 5.x.
I would shutdown all the virtual machines on that datastore as you wrote, then I would remove/unregister all the machines from the inventory and finally I would unmount it which ensures that there is no active machine on it, there is no storage DRS running and so on. The successful unmount should present you this confirmation window
After confirmation, you can begin with maintenance of the storage. When you are finished mount the datastore and re-register the machines.
Finally, I would like to mention that if you had deployed vCenter server and proper licensing in your environment you you could use Storage vMotion feature to migrate the machines to another storage/datastore without any downtime.
If you have the time, the best way would be to shut down or suspend the VMs and unmount the data store (or even shut down the ESXi instance altogether if you do not have other VMs which have to keep running and do not depend on the data store) for the duration of the maintenance.
At times where you cannot afford the suspend/unmount/remount/restart cycle (e.g. if you have VMs which would take too long to either shut down or suspend and subsequently restart to possibly fit into the maintenance window), you might want to consider an entirely unsupported, hacky but very quick alternative:
vcpu-<X>:<vmname>
processes of the affected virtual machineskill STOP <pid>
- this will stop execution and thus cease the VM's I/O.echo "scsi-qlalip"> /proc/scsi/qla2xxx/<hba#>
on the console to do sovcpu-<X>:<vmname>
processes you've STOPped beforeThe most crucial point here is that you need to get the HBA to re-login, otherwise the ESXi instance would not be able to get to the store unless you reboot - this should be tested and verified to work beforehand, especially if you have non-QLogic HBAs (where the procedure has been quite well documented all over the web and which I personally can confirm to be working).