Saturday, October 1, 2016

Nested Nutanix CE on ESXi - create your own vmdk descriptor

Why they don't provide a bootable ISO that can install to a bare VM disk, like everyone else does, is beyond me.

Instead, you get a bootable disk image, which you are supposed to rename, upload and use as the boot disk. All the tutorials I found on the net provided a text file to use as the vmdk descriptor. The ones I found were the best were by Joep Piscaer and Michael Webster.

None of the few posts I read ( and I only read 3 or 4) explained how the descriptor file was created. In my case, because the Nutanix CE file has changed from when the blog posts where published, I couldn't use the text file (not sure if just the cylinders value had to be adjusted, or what). So I created my own. I thought I would share how I did it.

1) Create a VM (following the other post's instructions) but instead of following the text file advice, add a new disk that is the exact size as the img file (that you extracted from the .gz download). For "ce-2016.08.27-stable.img" it was exactly 7100 MB.

2) Upload the img file to the datastore in the same folder as where you created the disk, with any name. In the following SSH session output, orange is the new empty disk created, green is the uploaded extracted file. Notice they are the same size.

[root@arielitox:/vmfs/volumes/5557fee9-bd5cfd2a-29f6-5404a61bb2db/Nutanix CE v1] ls -al
total 14550032
drwxr-xr-x    1 root     root          2380 Oct  2 02:01 .
drwxr-xr-t    1 root     root          4200 Sep 30 19:07 ..
-rw-------    1 root     root          8684 Oct  1 21:33 Nutanix CE v1.nvram
-rw-r--r--    1 root     root             0 Sep 30 19:07 Nutanix CE v1.vmsd
-rwxr-xr-x    1 root     root          3111 Oct  2 02:01 Nutanix CE v1.vmx
-rw-------    1 root     root     536870912000 Oct  1 21:39 Nutanix CE v1_2-flat.vmdk
-rw-------    1 root     root           506 Oct  1 21:39 Nutanix CE v1_2.vmdk
-rw-------    1 root     root     7444889600 Oct  2 01:59 Nutanix CE v1_3-flat.vmdk
-rw-------    1 root     root           472 Oct  2 02:01 Nutanix CE v1_3.vmdk
-rw-------    1 root     root     7444889600 Sep 30 19:24 ce.vmdk
-rw-r--r--    1 root     root         55642 Oct  1 21:36 vmware-3.log
-rw-r--r--    1 root     root         57243 Oct  1 21:36 vmware-4.log
-rw-r--r--    1 root     root         58555 Oct  1 21:37 vmware-5.log
-rw-r--r--    1 root     root         58340 Oct  1 21:39 vmware-6.log
-rw-r--r--    1 root     root         57322 Oct  1 21:39 vmware-7.log
-rw-r--r--    1 root     root         58631 Oct  1 21:44 vmware-8.log

3) Use the move command to overwrite the empty file with the same name as the file you created (your name will vary). I do this so we don't need to change the small vmdk descriptor file using vi. After running the command, notice the uploaded image file name no longer exists; move overwrites without confirmation, and now the image file contents are in the vmdk that we had created.

[root@arielitox:/vmfs/volumes/5557fee9-bd5cfd2a-29f6-5404a61bb2db/Nutanix CE v1] mv ce.vmdk "Nutanix CE v1_3-flat.vmdk"
[root@arielitox:/vmfs/volumes/5557fee9-bd5cfd2a-29f6-5404a61bb2db/Nutanix CE v1] ls -al
total 7279632
drwxr-xr-x    1 root     root          2240 Oct  2 02:02 .
drwxr-xr-t    1 root     root          4200 Sep 30 19:07 ..
-rw-------    1 root     root          8684 Oct  1 21:33 Nutanix CE v1.nvram
-rw-r--r--    1 root     root             0 Sep 30 19:07 Nutanix CE v1.vmsd
-rwxr-xr-x    1 root     root          3111 Oct  2 02:01 Nutanix CE v1.vmx
-rw-------    1 root     root     536870912000 Oct  1 21:39 Nutanix CE v1_2-flat.vmdk
-rw-------    1 root     root           506 Oct  1 21:39 Nutanix CE v1_2.vmdk
-rw-------    1 root     root     7444889600 Sep 30 19:24 Nutanix CE v1_3-flat.vmdk
-rw-------    1 root     root           472 Oct  2 02:01 Nutanix CE v1_3.vmdk
-rw-r--r--    1 root     root         55642 Oct  1 21:36 vmware-3.log
-rw-r--r--    1 root     root         57243 Oct  1 21:36 vmware-4.log
-rw-r--r--    1 root     root         58555 Oct  1 21:37 vmware-5.log
-rw-r--r--    1 root     root         58340 Oct  1 21:39 vmware-6.log
-rw-r--r--    1 root     root         57322 Oct  1 21:39 vmware-7.log
-rw-r--r--    1 root     root         58631 Oct  1 21:44 vmware-8.log

Your VM should be able to boot. In my case, I did assign this disk a SATA controller, so I went in BIOS and set that one to be the first boot disk, and now I could see the Nutanix splash screen, and get the installer prompt a bit later.

This procedure should work for any other release of Nutanix CE (as long as this awkward img method is used). Feel free to use this text file for release 2016.08.27-stable, but at least you know how it was created in case it doesn't work for you:

[root@arielitox:/vmfs/volumes/5557fee9-bd5cfd2a-29f6-5404a61bb2db/Nutanix CE v1] vi "Nutanix CE v1_3.vmdk"

# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=5c98c0d4
parentCID=ffffffff
isNativeSnapshot="no"
createType="vmfs"

# Extent description
RW 14540800 VMFS "Nutanix CE v1_3-flat.vmdk"

# The Disk Data Base
#DDB

ddb.adapterType = "ide"
ddb.geometry.cylinders = "14425"
ddb.geometry.heads = "16"
ddb.geometry.sectors = "63"
ddb.longContentID = "f93da8daf3cd8a949323e2d55c98c0d4"
ddb.uuid = "60 00 C2 90 85 79 c8 33-48 87 1c 59 12 32 c3 6a"
ddb.virtualHWVersion = "11"



2 comments:

  1. Ariel - Fantastic post, thanks for digging into the weeds on this one.

    Just FYI, the bootable media item has been in the queue for a while, just a matter of priorities. We're working on it though. We're also working on a formal OVA that will just pump these instances out easily, so we'll have both routes covered.

    Anyhow, I'll post this up on the Nutanix CE Forums here: http://next.nutanix.com/t5/Discussion-Forum/bd-p/Discussion so that other users can easily find it.

    - Jon K

    ReplyDelete
    Replies
    1. Glad you liked it! I found it in the Nutanix forums and replied there as well.

      Delete