In that kind of circumstances, you should check all processus related to the do-release-upgrade processus. I am not sure at 100%, but I remember that the do-release-upgrade command was running inside a screen, not modifying the system until it’s been executed successfully.
So, rebooting the VM should abort the do-release-upgrade, as it will proceed in a rollback operation. You may also try to attach the screen if the user running it is the user you are using is part of an the same UNIX group or the user itself.
To avoid that kind of problem, I advice you to add an SSH key in your root account, allowing you to log as ‘root’ using ssh identication, which does not need you to be in the sudoers. The DigitalOcean admin panels proposes this solution, and it can be a good way to get out of that situation.
The other solution you can use is to include your users in the 'wheel group’, and modify the PAM libs to allow you using the 'su’ command if you are part of the wheel UNIX group. Here is the way you can do it, running those commands as root :
adduser 'your_user' wheel
echo "auth sufficient pam_wheel.so trust use_uid" >> /etc/pam.d/su
Then you just type 'su’ in the shell, and you’re root ;)
I hope this information could help you to solve this issue,