Tuesday 18 October 2022

copying data from old datastore on to new ESXi

 This is how I copied data from an ESXi datastore on an old m2 ssd to a new ESXi machine:

  1. Put the SSD into a USB adaptor

  2. Plugged into new ESXi

  3. Enabled SSH/ESXCLI

  4. Used PuTTY to log into EXSi server

  5. /etc/init.d/usbarbitrator stop

  6. Obtain the UUID of VMFS partition using
    esxcli storage vmfs snapshot list

  7. then mount it using
    esxcli storage vmfs snapshot mount -u <UUID>

  8. then log into ESXi GUI and copy files across

 

Thanks to:

  • http://woshub.com/mount-usb-flash-drive-vmware-esxi/

  • https://serverfault.com/questions/998817/mount-vmfs-partition-in-esxi

ESXi on NUC12 NUC12WSHi5

Happily had ESXi running on a NUC7 for approx 4 years.  The NUC7 recently expired so I thought it would be an easy exercise to replace with a NUC12 and new SSD.... many frustrating hours later...

1. Intel i5-1240P contains e-cores, ESXi doesn't support these, so when booting up ESXi you'll get the "purple screen of death" and warning about CPU mismatches.  Internet advice is to disable the e-cores in the BIOS however there is no option to do this in the NUC12WSHi5 BIOS.  Instead press SHIFT+O at the start of the ESXi startup sequence.  I then added the ESXi kernel option "cpuUniformityHardCheckPanic=FALSE" to the end of the editable line (so I had "runweasel cdromBoot cpuUniformityHardCheckPanic=FALSE") and pressed enter.  ESXi will now boot ok (with a flash of red text).  To be honest I'm pretty uncomfortable about ignoring warnings but it's just a test rig and my only other option is to buy another machine.

2. Assuming you're using ESXi 7 or lower the networking isn't going to work.  This is because the drivers for the newer networking chips aren't in ESX 7 base package.  You can either download/install the community drivers or use ESXi 8+ which includes the drivers.  I did the later for ease.  Good article here: https://williamlam.com/2022/09/esxi-on-intel-nuc-12-pro-wall-street-canyon.html

3. Next I find that the ESXi does not reboot, it complains "No bootable device detected".  Forum suggestions are this is a problem writing to the UEFI NVRAM.  Not my strong area but some suggestions to use (older) MBR rather than GPT.  So I reinstall, press SHIFT+O and this time add "formatwithmbr" (so I now have "runweasel cdromBoot cpuUniformityHardCheckPanic=FALSE formatwithmbr").  It works, but I can't say I fully understand why and wouldn't dream of doing this on a production system.

We'll see how things go.  I'll report back any issues encountered below this line.

EDIT 1: so the NUC12WSHi5 has an internal fan.  It's quiet but not as quiet as my previous fanless NUC7 and that's an annoyance as I keep these machines in a bedroom cupboard.

Friday 5 August 2022

MySQL Data truncation: Incorrect datetime value

 This got me going today.  Trying to alter a datetime column to timestamp.  Fails on a single row with date '2011-10-02 02:29:42'

Gives the following error message:

SQL State  : 22001
Error Code : 1292
Message    : Data truncation: Incorrect datetime value: '2011-10-02 02:29:42' for column 'date' at row 6151

I check the format of the date again and again.  And again.  It's definitely ok.  Change the year and it works, but change the seconds on it doesn't.  WTF is going on?

Well, it's daylight saving.  Check internet and sure enough in Australia daylight saving change on  2011-10-02 moved the clocks forward one hour from 2am to 3am.  So any timestamp value between 2am and 3am is invalid (in this timezone)!