VMware Cloud Community
Liam
Contributor
Contributor

Kickstart auto-create datastore2 during install or on firstboot

We are staging many servers with this same configuration.

They each have 2x 2TB Samsun SSD drives.

I want to do the install on firstavailable.  But after, I would like to automatically create datastore2 on the second drive.


The problem though, is that I can't seem to use path names, like vmhba0:C0:T1:L0, for example.  The installer doesn't find this. 

When I look in /dev/disks, the devices appear, but they are named t10.ATA________Blah____DRIVE SERIALNUMBER

So, I'm at a bit of a loss how to do this.

I'm thinking I might need to do this as a firstboot script, and use partedUtil and vmkfstools to create the datastore?  But what do I use in my script, to look for the drive that is not yet partitioned?

0 Kudos
1 Reply
Liam
Contributor
Contributor

So I'm not 100% familiar with all of the esxcli and vim-cmd type tools.  SO. There is probably a much easier way.


My corner case though, I can do something like the following.

I was unable to get kickstart to partition my other disk and add a datastore.  I will not know serial numbers (nor do I care about drive serial number).


So I have to do it post install.

<code>

#esxcli storage core device partition list | grep 't10.ATA' | sed -e 's/.*_____\(.*\)____/\1/' | cut -d_ -f1 | sort -un

</code>

So the device naming algorithm always does 't10.ATA_____Samsung <blah>_______________<serial number>____'

The installer partitioned out the first drive, of 2, that it came to.  So there are like 9 10 partitions on there.  So I'm just looking for the specific device that only has one partition.  The above code returns the serial number.  I'll modify it to just give me the entire device name.

I should be able to use this to automatically create my second datastore.

Again - if anyone has something less ugly than this, please share!

Smiley Happy

0 Kudos