Friday 20 February 2015

Starting a Ganeti VM to reset root password

# gnt-instance start -H kernel_args="rw init=/bin/sh" INSTANCE
Waiting for job 1333533 for INSTANCE ...
# gnt-instance console INSTANCE
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.32-358.23.2.el6.x86_64 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Wed Oct 16 18:37:12 UTC 2013
Command line: ro root=LABEL=root rhgb noquiet root=/dev/xvda rw init=/bin/sh

[cut]

sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
sh-4.1# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
sh-4.1# exit

# gnt-instance reboot INSTANCE