I am not able to access an ubuntu vm on azure after restart.
This is happening several times.
Basically I created an ubuntu 18.04 LTS VM on azure and after creation I can access the machine using ssh and the correspondent keys.
When the machine is shut down by the next start I got a connection refused:
ssh: connect to host myserver.westeurope.cloudapp.azure.com port 22: Connection refused
I created the VM using an ARM template and a cloud-init file, where docker is downloaded, installed and used to start a container.
I activated the serial console and was able to see that an external data disk cannot be mounted:
I mounted the data disk using a script embedded in cloud-init
Here the relevant part of the script:
# create a partition table for the disk
parted -s /dev/sdc mklabel msdos
# create a single large partition
parted -s /dev/sdc mkpart primary ext4 0\% 100\%
# install the file system
mkfs.ext4 /dev/sdc1
# create the mount point
mkdir /datadisk
# mount the disk
sudo mount /dev/sdc1 /datadisk/
# add mount to /etc/fstab to persist across reboots
echo "/dev/sdc1 /datadisk/ ext4 defaults 0 0" >> /etc/fstab
Why is this damaged after shutting down and starting the vm again?