I am running Elasticsearch on VMs in Google Cloud (using the standard latest 7.x debian package installation) and am trying out different configurations. I recently tried to run a cluster with VMs with local SSD (local disks connected to VM via nvme, like instance store in AWS). I formatted and mounted the drive properly (to the path /mnt/data) and updated the elasticsearch.yml configuration to set path.data: /mnt/data/lib and path.logs: /mnt/data/log) but when I start elasticsearch it uses the defaults /var/lib/elasticsearch and /var/log/elasticsearch instead.
I'm wondering if this may be happening because the machine I installed elasticsearch on was different (it was a packer build machine). Does the elasticsearch.yml configuration need to be updated before running systemctl enable elasticsearch.service?
I install elasticsearch and run the commands systemctl daemon-reload and systemctl enable elasticsearch.service (as well as some of the other system configuration) in the packer build machine and export the image and then when I create the cluster VMs I use that image and when booting I complete the installation by updating elasticsearch.yml and running systemctl start elasticsearch.service. Is that approach not valid?
I also had tried restoring a snapshot taken from a previous cluster that used the default paths (/var/lib/elasticsearch and /var/log/elasticsearch). Would that be a possible cause of the issue?