-
-
Save 8bitjoey/53e754d0e94df45271f964a11d3ebed2 to your computer and use it in GitHub Desktop.
Revisions
-
Hengjie revised this gist
Jun 20, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,7 +43,7 @@ If you're new to EXSI, you should know a few things: - Make sure you read [Prerequisite knowledge](#prerequisite-knowledge) section about datastores, and virtual disks first. - `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. - The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. In my case, `Samsung 850 Pro` is simply the datastore name I wrote to be self descriptive. nb. It has to ben an existing store or else you get error `Failed to create virtual disk: The system cannot find the file specified (25)`. See https://gist.github.com/Hengjie/1520114890bebe8f805d337af4b3a064#gistcomment-2834063 - Do not name your RDM's with `-rdm` in the end of the name or you'll receive error `The value was rejected by rule "Virtual SCSI or NVMe Devices"`. See https://gist.github.com/Hengjie/1520114890bebe8f805d337af4b3a064#gistcomment-2845874 and https://communities.vmware.com/thread/491979 6. Attach the newly created RDM to the VM -
Hengjie revised this gist
Jun 20, 2019 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,15 +43,16 @@ If you're new to EXSI, you should know a few things: - Make sure you read [Prerequisite knowledge](#prerequisite-knowledge) section about datastores, and virtual disks first. - `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. - The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. In my case, `Samsung 850 Pro` is simply the datastore name I wrote to be self descriptive. nb. It has to ben an existing store or else you get error `Failed to create virtual disk: The system cannot find the file specified (25).`. See https://gist.github.com/Hengjie/1520114890bebe8f805d337af4b3a064#gistcomment-2834063 - Do not name your RDM's with `-rdm` in the end of the name or you'll receive error `The value was rejected by rule "Virtual SCSI or NVMe Devices"`. See https://gist.github.com/Hengjie/1520114890bebe8f805d337af4b3a064#gistcomment-2845874 and https://communities.vmware.com/thread/491979 6. Attach the newly created RDM to the VM - Go back to the web app, go to the Virtual Machine, and click Edit. - Under `Add other device`, click `SCSI controller` (If you already have an existing SCSI controller for RDMs, you don't need to create another one). In other words, you can reuse the controllers. - Under `Add hard disk`, click `Existing hard disk` and select the newly created vmdk file. You'll have to use the Datastore file browser to select the `HGST_RDM_1.vmdk` file - Once the HDD is created, under the new disk e.g. `Hard disk 2`, expand it and make sure it's using the newly created SCSI controller. You'll have to click on the drop down and select e.g. `SCSI controller 1` and `SCSI (1:0)` - Change `Disk Mode` to `Independent - persistent`. If the `Disk Mode` is greyed out then change `Disk compatibility` from `Physical` to `Virtual`. Note: We use `independent persistent` mode because RDMs won't work with VMWare disk snapshots. More thorough explanation [here](http://cormachogan.com/2013/04/16/what-are-dependent-independent-disks-persistent-and-non-persisent-modes/). -
Hengjie revised this gist
Jun 20, 2019 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,9 @@ There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on [VMWare's own KB](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530) and the now deprecated [Forza IT blog post](http://forza-it.co.uk/esxi-5-1-using-raw-device-mappings-rdm-on-an-hp-microserver/). ## A word about VMWare ESXI 6.7 There is now an option while editing your VM's settings to add a `New raw disk` when you click `Add hard disk`. I have not personally tried it yet, but the comments below have confirmed it works. ## Summary We attach the SATA HDDs as a RDM (Raw Device Mapper) into an existing virtual disk in the command line, then on the web app, we attach a new SCSI controller to the VM, and attach the newly created RDM as an "existing HDD" to the newly created SCSI controller. -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ If you're new to EXSI, you should know a few things: 1. Before you get started, make sure you've got a VM setup, and running. In my example, I have a virtual machine and virtual disk both conveniently named `Ubuntu Storage` 2. In EXSI's web interface, log in, go to the home page. Click on `Actions` > `Services` > `Enable Secure Shell (SSH)`. 3. Open a SSH session to the ESXi/ESX host. ``` -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ If you're new to EXSI, you should know a few things: 2. In EXSI's web interface, log in, go to the home page. Click on Actions > Services > Enable Secure Shell (SSH). 3. Open a SSH session to the ESXi/ESX host. ``` # ssh root@YOUR_EXSI_IP -p 22 ``` @@ -40,7 +40,7 @@ If you're new to EXSI, you should know a few things: - Make sure you read [Prerequisite knowledge](#prerequisite-knowledge) section about datastores, and virtual disks first. - `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. - The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. In my case, `Samsung 850 Pro` is simply the datastore name I wrote to be self descriptive. 6. Attach the newly created RDM to the VM -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on [VMWare's own KB](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530) and the now deprecated [Forza IT blog post](http://forza-it.co.uk/esxi-5-1-using-raw-device-mappings-rdm-on-an-hp-microserver/). ## Summary We attach the SATA HDDs as a RDM (Raw Device Mapper) into an existing virtual disk in the command line, then on the web app, we attach a new SCSI controller to the VM, and attach the newly created RDM as an "existing HDD" to the newly created SCSI controller. ## Prerequisite knowledge If you're new to EXSI, you should know a few things: -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,4 +60,4 @@ If you're new to EXSI, you should know a few things: 2. How can I passthrough multiple disks to the same VM? Simply follow steps 4 to 6 but with the new disk. You can mount the RDM drives to the same SCSI controller. In other words, the first drive could be on `0:0`, and the next drive could be on `0:1`. There is a limit of 4 SCSI controllers per VM. *nb: Thanks to commenters for pointing out that you don't actually need a separate SCSI controllers per RDM. Personally, I'd have a separate SCSI controller just for RDMs only for cleaniness.* -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ If you're new to EXSI, you should know a few things: ``` # ls -l /vmfs/devices/disks ``` It should look like this. We care about the physical disks with the prefix `t10`. As mentioned in the comments, it may not necessarily start with `t10`. You can determined the name/path by going to the web console then `Storage`, then `Device`, click on the device you're setting up as RDM, and then copying the path. ``` [root@localhost:~] ls -l /vmfs/devices/disks total 12221184373 -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ If you're new to EXSI, you should know a few things: ``` # ls -l /vmfs/devices/disks ``` It should look like this. We care about the physical disks with the prefix `t10`. As mentioned in the comments, it may not necessarily start with `t10`. You can determined the name by going to the web console then `Storage`, then `Device`, click on the device you're setting up as RDM, and then copying the path. ``` [root@localhost:~] ls -l /vmfs/devices/disks total 12221184373 -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,7 +24,7 @@ If you're new to EXSI, you should know a few things: ``` # ls -l /vmfs/devices/disks ``` It should look like this. We care about the physical disks with the prefix `t10`. As mentioned in the comments, it may not necessarily start with `t10`. ``` [root@localhost:~] ls -l /vmfs/devices/disks total 12221184373 -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ We attach the SATA HDDs as an RDM (Raw Device Mapper) into an existing virtual d ## Prerequisite knowledge If you're new to EXSI, you should know a few things: - A Datastore is basically this separate layer that sits between a physical device/disk and a virtual disk. A datastore can max the storage of a physical disk, or not. A datastore can have many virtual disks. Virtual disks are what a virtual machine will stores files on. In other words `Physical Disk > Datastore > Virtual Disks > Your filesystem e.g. EXT4` - RDM aka Raw Device Mapper is a pointer file that acts like a virtual disk but instead maps directly to a physical disk. RDMs on EXSI 6.5 have to be created in the command line. # Instructions 1. Before you get started, make sure you've got a VM setup, and running. -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,12 +45,12 @@ If you're new to EXSI, you should know a few things: 6. Attach the newly created RDM to the VM - Go back to the web app, go to the Virtual Machine, and click Edit. - Under `Add other device`, click `SCSI controller` (If you already have an existing SCSI controller for RDMs, you don't need to create another one). In other words, you can reuse the controllers. - Under `Add hard disk`, click `Existing hard disk` and select the newly created vmdk file. You'll have to use the Datastore file browser to select the `HGST_RDM_1.vmdk` file - Once the HDD is created, under the new disk e.g. `Hard disk 2`, expand it and make sure it's using the newly created SCSI controller. You'll have to click on the drop down and select e.g. `SCSI controller 1` and `SCSI (1:0)` - Change `Disk Mode` to `Independent - persistent` Note: We use `independent persistent` mode because RDMs won't work with VMWare disk snapshots. More thorough explanation [here](http://cormachogan.com/2013/04/16/what-are-dependent-independent-disks-persistent-and-non-persisent-modes/). # FAQ 1. What if I want to change the RDM to another VM? @@ -59,4 +59,5 @@ If you're new to EXSI, you should know a few things: 2. How can I passthrough multiple disks to the same VM? Simply follow steps 4 to 6 but with the new disk. You can mount the RDM drives to the same SCSI controller. In other words, the first drive could be on `0:0`, and the next drive could be on `0:1`. There is a limit of 4 SCSI controllers per VM. *nb: Thanks to commenters pointing out you don't actually need separate SCSI controllers per RDM. Personally, I'd have a separate SCSI controller just for RDMs only for cleaniness.* -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # How to passthrough SATA drives directly on VMWare EXSI 6.5 as RDMs There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. You used to be able to setup RDMs in the desktop client, but with the introduction of the web console, this is no longer the case. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on [VMWare's own KB](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530) and the now deprecated [Forza IT blog post](http://forza-it.co.uk/esxi-5-1-using-raw-device-mappings-rdm-on-an-hp-microserver/). ## Summary We attach the SATA HDDs as an RDM (Raw Device Mapper) into an existing virtual disk on command line, then on the web app, we attach a new SCSI controller to the VM, and attach the newly created RDM as an "existing HDD" to the newly created SCSI controller. @@ -31,7 +31,7 @@ If you're new to EXSI, you should know a few things: -rw------- 1 root root 5000981078016 Feb 1 10:04 t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ ``` Here I have a HGST 5TB disk attached to SATA that I'm trying to passthrough to my VM. There will be other listings here of datastores, and virtual disks that is not relevant. 5. Attach a physical disk as a RDM ``` -
Hengjie revised this gist
Apr 29, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ We attach the SATA HDDs as an RDM (Raw Device Mapper) into an existing virtual d ## Prerequisite knowledge If you're new to EXSI, you should know a few things: - A Datastore is basically this separate layer that sits between a physical device/disk and a virtual disk. A datastore can max the storage of a physical disk, or not. A datastore can have many virtual disks. Virtual disks are what a virtual machine will stores files on. In other words `Physical Disk > Datastore > Virtual Disks > Your filesystem e.g. EXT4` - RDM aka Raw Device Mapper is a pointer file that acts like a virtual disk but instead maps directly to a physical disk. RDMs on EXSI 6.5 has to be created in the command line. # Instructions @@ -33,7 +33,7 @@ If you're new to EXSI, you should know a few things: Here I have a HGST 5TB disks attached to SATA that I'm trying to passthrough to my VM. There will be other listings here of datastores, and virtual disks that is not relevant. 5. Attach a physical disk as a RDM ``` # vmkfstools -z /vmfs/devices/disks/t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ "/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/HGST_RDM_1.vmdk" ``` -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,7 +37,10 @@ If you're new to EXSI, you should know a few things: ``` # vmkfstools -z /vmfs/devices/disks/t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ "/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/HGST_RDM_1.vmdk" ``` - Make sure you read [Prerequisite knowledge](#prerequisite-knowledge) section about datastores, and virtual disks first. - `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. - The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. 6. Attach the newly created RDM to the VM -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,9 @@ If you're new to EXSI, you should know a few things: # FAQ 1. What if I want to change the RDM to another VM? Simply rm the vmdk file and go through steps 5 and 6 again with the new virtual disk for the new VM. 2. How can I passthrough multiple disks to the same VM? Simply follow steps 4 to 6 but with the new disk. Make sure in step 6 that you create a new SCSI controller for each new disk. -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,7 @@ If you're new to EXSI, you should know a few things: # FAQ 1. What if I want to change the RDM to another VM? Simply rm the vmdk file and go through steps 5 and 6 again with the new virtual disk for the new VM. 2. How can I passthrough multiple disks to the same VM? Simply follow steps 4 to 6 but with the new disk. Make sure in step 6 that you create a new SCSI controller for each new disk. -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -47,7 +47,7 @@ If you're new to EXSI, you should know a few things: - Once the HDD is created, under the new disk e.g. `Hard disk 2`, expand it and make sure it's using the newly created SCSI controller. You'll have to click on the drop down and select e.g. `SCSI controller 1` and `SCSI (1:0)` - Change `Disk Mode` to `Independent - persistent` Note: We use independent persistent mode because RDMs won't work with VMWare disk snapshots. More thorough explanation [here](http://cormachogan.com/2013/04/16/what-are-dependent-independent-disks-persistent-and-non-persisent-modes/). # FAQ 1. What if I want to change the RDM to another VM? -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 25 additions and 25 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,42 +12,42 @@ If you're new to EXSI, you should know a few things: # Instructions 1. Before you get started, make sure you've got a VM setup, and running. In my example, I have a virtual machine and virtual disk both conveniently named `Ubuntu Storage` 2. In EXSI's web interface, log in, go to the home page. Click on Actions > Services > Enable Secure Shell (SSH). 3. Open an SSH session to the ESXi/ESX host. ``` # ssh root@YOUR_EXSI_IP -p 22 ``` 4. Run this command to list the disks that are attached to the ESXi host: ``` # ls -l /vmfs/devices/disks ``` It should look like this. We care about the physical disks with the prefix `t10` ``` [root@localhost:~] ls -l /vmfs/devices/disks total 12221184373 -rw------- 1 root root 5000981078016 Feb 1 10:04 t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ ``` Here I have a HGST 5TB disks attached to SATA that I'm trying to passthrough to my VM. There will be other listings here of datastores, and virtual disks that is not relevant. 5. Attach a physicak disk as a RDM ``` # vmkfstools -z /vmfs/devices/disks/t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ "/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/HGST_RDM_1.vmdk" ``` Make sure you read `Prerequisite knowledge` section about datastores, and virtual disks first. `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. 6. Attach the newly created RDM to the VM - Go back to the web app, go to the Virtual Machine, and click Edit. - Under `Add Another Device`, click `SCSI controller` - Under `Add Another Device`, click `Existing hard disk` and select the newly created vmdk file. You'll have to use the Datastore file browser to select the `HGST_RDM_1.vmdk` file - Once the HDD is created, under the new disk e.g. `Hard disk 2`, expand it and make sure it's using the newly created SCSI controller. You'll have to click on the drop down and select e.g. `SCSI controller 1` and `SCSI (1:0)` - Change `Disk Mode` to `Independent - persistent` Note: We use independent persistent mode because we RDMs don't work with VMWare disk snapshots. More thorough explanation by [here](http://cormachogan.com/2013/04/16/what-are-dependent-independent-disks-persistent-and-non-persisent-modes/). # FAQ 1. What if I want to change the RDM to another VM? -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 14 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # How to passthrough SATA drives directly on VMWare EXSI 6.5 as RDMs There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. In v6.5, the web app was introduced and the desktop client was deprecated. This tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on [VMWare's own KB](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530) and the now deprecated [Forza IT blog post](http://forza-it.co.uk/esxi-5-1-using-raw-device-mappings-rdm-on-an-hp-microserver/). ## Summary We attach the SATA HDDs as an RDM (Raw Device Mapper) into an existing virtual disk on command line, then on the web app, we attach a new SCSI controller to the VM, and attach the newly created RDM as an "existing HDD" to the newly created SCSI controller. @@ -11,7 +11,8 @@ If you're new to EXSI, you should know a few things: - RDM aka Raw Device Mapper is a pointer file that acts like a virtual disk but instead maps directly to a physical disk. RDMs on EXSI 6.5 has to be created in the command line. # Instructions 1. Before you get started, make sure you've got a VM setup, and running. In my example, I have a virtual machine and virtual disk both conveniently named `Ubuntu Storage` 2. In EXSI's web interface, log in, go to the home page. Click on Actions > Services > Enable Secure Shell (SSH). @@ -44,4 +45,13 @@ Make sure you read `Prerequisite knowledge` section about datastores, and virtua - Under `Add Another Device`, click `SCSI controller` - Under `Add Another Device`, click `Existing hard disk` and select the newly created vmdk file. You'll have to use the Datastore file browser to select the `HGST_RDM_1.vmdk` file - Once the HDD is created, under the new disk e.g. `Hard disk 2`, expand it and make sure it's using the newly created SCSI controller. You'll have to click on the drop down and select e.g. `SCSI controller 1` and `SCSI (1:0)` - Change `Disk Mode` to `Independent - persistent` Note: We use independent persistent mode because we RDMs don't work with VMWare disk snapshots. More thorough explanation by [here](http://cormachogan.com/2013/04/16/what-are-dependent-independent-disks-persistent-and-non-persisent-modes/). # FAQ 1. What if I want to change the RDM to another VM? Simply rm the vmdk file and go through steps 5 and 6 again with the new virtual disk for the new VM. 2. How can I passthrough multiple disks to the same VM? Simply follow steps 4 to 6 but with the new disk. Make sure in step 6 that you create a new SCSI controller for each new disk. -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,13 +16,13 @@ If you're new to EXSI, you should know a few things: 2. In EXSI's web interface, log in, go to the home page. Click on Actions > Services > Enable Secure Shell (SSH). 3. Open an SSH session to the ESXi/ESX host. ``` # ssh root@YOUR_EXSI_IP -p 22 ``` 4. Run this command to list the disks that are attached to the ESXi host: ``` # ls -l /vmfs/devices/disks ``` It should look like this. We care about the physical disks with the prefix `t10` ``` [root@localhost:~] ls -l /vmfs/devices/disks @@ -33,9 +33,9 @@ total 12221184373 Here I have a HGST 5TB disks attached to SATA that I'm trying to passthrough to my VM. There will be other listings here of datastores, and virtual disks that is not relevant. 5. Attach a physicak disk as a RDM ``` # vmkfstools -z /vmfs/devices/disks/t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ "/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/HGST_RDM_1.vmdk" ``` Make sure you read `Prerequisite knowledge` section about datastores, and virtual disks first. `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. 6. Attach the newly created RDM to the VM -
Hengjie revised this gist
Feb 1, 2017 . 1 changed file with 45 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,47 @@ # How to passthrough SATA drives directly on EXSI 6.5 There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs, or refered to old ESXI versions (below 6.5) that used a more comprehensive desktop client instead of the web app. The web app was only introduced in v6.5. Instead, this tutorial shows you how to pass SATA HDDs to the virtual machine on VMWare ESXI 6.5. This tutorial is partially based on [VMWare's own KB](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530) and the now deprecated [Forza IT blog post](http://forza-it.co.uk/esxi-5-1-using-raw-device-mappings-rdm-on-an-hp-microserver/). ## Summary We attach the SATA HDDs as an RDM (Raw Device Mapper) into an existing virtual disk on command line, then on the web app, we attach a new SCSI controller to the VM, and attach the newly created RDM as an "existing HDD" to the newly created SCSI controller. ## Prerequisite knowledge If you're new to EXSI, you should know a few things: - A Datastore is basically this separate layer that sits between a physical device/disk and a virtual disk. A datastore can max the storage of a physical disk, or not. A datastore can have many virtual disks. Virtual disks is what a virtual machine will stores files on. - RDM aka Raw Device Mapper is a pointer file that acts like a virtual disk but instead maps directly to a physical disk. RDMs on EXSI 6.5 has to be created in the command line. # Instructions 1. Before you get started, make sure you've got a VM setup, and running. 2. In EXSI's web interface, log in, go to the home page. Click on Actions > Services > Enable Secure Shell (SSH). 3. Open an SSH session to the ESXi/ESX host. # ssh root@YOUR_EXSI_IP -p 22 4. Run this command to list the disks that are attached to the ESXi host: # ls -l /vmfs/devices/disks It should look like this. We care about the physical disks with the prefix `t10` ``` [root@localhost:~] ls -l /vmfs/devices/disks total 12221184373 -rw------- 1 root root 5000981078016 Feb 1 10:04 t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ ``` Here I have a HGST 5TB disks attached to SATA that I'm trying to passthrough to my VM. There will be other listings here of datastores, and virtual disks that is not relevant. 5. Attach a physicak disk as a RDM # vmkfstools -z /vmfs/devices/disks/t10.ATA_____HGST_HDN726050ALE610____________________NAG4P4YX____________ "/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/HGST_RDM_1.vmdk" Make sure you read `Prerequisite knowledge` section about datastores, and virtual disks first. `vmkfstools` is attaching the physical disk and mapping it to a `vmdk` file. `vmdk` files can only mount in virtual disk folders. e.g. `/vmfs/volumes/Samsung 850 Pro/Ubuntu Storage/` folders. The folder structure is in this format: `/vmfs/volumes/DATASTORE/VIRTUAL_DISK/` The `VIRTUAL_DISK` should be the name of the virtual disk you're using in your VM, for me it's called `Ubuntu Storage`. You should `cd /vmfs/volumes/` and `ls` around to find the right virtual disk. 6. Attach the newly created RDM to the VM - Go back to the web app, go to the Virtual Machine, and click Edit. - Under `Add Another Device`, click `SCSI controller` - Under `Add Another Device`, click `Existing hard disk` and select the newly created vmdk file. You'll have to use the Datastore file browser to select the `HGST_RDM_1.vmdk` file - Once the HDD is created, under the new disk e.g. `Hard disk 2`, expand it and make sure it's using the newly created SCSI controller. You'll have to click on the drop down and select e.g. `SCSI controller 1` and `SCSI (1:0)` - Change `Disk Mode` to `Independent - persistent` -
Hengjie created this gist
Feb 1, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ # How to passthrough SATA drives directly on EXSI 6.5 There aren't many tutorials about this, the only tutorials I've found were about passing through entire PCIe cards to VMs. This tutorial is partially based on [VMWare's own KB](https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530) and the now deprecated [Forza IT](http://forza-it.co.uk/esxi-5-1-using-raw-device-mappings-rdm-on-an-hp-microserver/) post.