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!