Re: [ovirt-users] HEVM root reset?

2017-10-31 Thread Martin Sivak
Hi,

you could also do this offline using libguestfs tools:

- Find the path to the disk using virsh -r dumpxml HostedEngine
- Stop the vm using hosted-engine --vm-shutdown
- and then use guestfish tool to edit the filesystem: guestfish --rw -a disk.img

Best regards

Martin Sivak

On Tue, Oct 31, 2017 at 9:00 AM, Simone Tiraboschi  wrote:
> Hi,
> the simplest approach is:
>
> hosted-engine --set-maintenance --mode=global
> hosted-engine --vm-shutdown
> # wait for it
> hosted-engine --vm-start-paused
> hosted-engine --add-console-password
> # open a vnc or spice console pointing to the VM
> # when ready
> virsh -c qemu://$(hostname)/system resume HostedEngine
> # quickly stop the boot process from the vnc or spice console
> # force root password as for a regular el7 system
> # shutdown the engine VM
> hosted-engine --set-maintenance --mode=none
>
>
>
> On Sat, Oct 28, 2017 at 11:25 PM, Chas Ecomm  wrote:
>>
>> TIA for any guidance you can give me here, I’m in a bit of a pickle and
>> have spent many hours reading many posts and blogs that don’t seem to get me
>> where I need to be, and despite my gut feeling that someone has had to have
>> dealt with this somewhere else, my google-fu is failing me in finding anyone
>> who has dealt with this particular problem.
>>
>>
>>
>> My issue:
>>
>>
>>
>> I’ve inherited a 4.1 hosted-engine setup.  This is for a non-profit, so
>> the previous consultant did what she could to save capital expense by using
>> older gear and oVirt rather than VMware/Hyper-V and newer equipment.  For
>> the most part it has worked quite well as I understand it.  This particular
>> setup has gone from 3.5 with a standalone engine to 4.1 with a hosted
>> engine, in case that matters.
>>
>>
>>
>> The VMs hosted on the 2 clusters associated with this engine are currently
>> working fine, but I am trying to get into the hosted-engine VM, and either
>> there was a problem with the root password during setup and the
>> hosted-engine-setup script didn’t catch it or I’ve been given a bad
>> password.  The previous admin didn’t setup any alternative users, which is a
>> major no-no in my book, and so I’m trying to do that – but I can’t login to
>> the VM.  I can log into the portal and manage the hosts, storage, VMs, etc.,
>> just not the HEVM.  As I understand it, even if I could set aside my need
>> for alternate users, when it comes time to upgrade I will need access to the
>> HEVM, so I have to solve this at some point.
>>
>>
>>
>> If this were a physical machine, I’d reboot in single user mode and work
>> at things from there, but it’s not, and I’ve not found a good guide to get
>> to the engine console to put it into single user mode.  I’ve found lots (and
>> lots, and lots) of links on the oVirt docs site regarding hosted engine
>> setups that simply don’t exist as pages anymore and others that don’t
>> address this issue, as well as a couple of links on the RedHat site that
>> made me think I could connect via ssh to the host running the VM, and do
>> some sort of X forwarding, but I haven’t come anywhere close to success with
>> that, and since I can’t log into the VM, I’m not sure how that would work
>> anyway.  I’ve always struggled with X forwarding, too, so that doesn’t help,
>> I’m sure.
>>
>>
>>
>> I read a few posts from what look like the early days of the hosted-engine
>> OVA implying you could launch a console from the management portal and maybe
>> try to reboot and set single user mode there, but they all dead-ended.
>> Also, I may be confused on how the hosted engine works (I find this much
>> more confusing than either VMware or Hyper-V), but if I’m connected to the
>> console via the oVirt management portal and I reboot the VM to try and get
>> into single user mode, wouldn’t I lose my connection and still not be able
>> to get into single user mode?
>>
>>
>>
>> I can connect via hosted-engine –console, but that asks me for the root
>> password, which of course I don’t have.
>>
>>
>>
>> Am I just doomed to have to rebuild this whole set of servers from scratch
>> or is there some way I could either re-run hosted-engine –deploy so I can
>> set the root password and not lose my current config; or alternatively is
>> there a way to get the VM into single user mode and accessible so I can use
>> normal Linux practices for a lost root password?
>>
>>
>>
>> Thanks for listening and for any help you can possibly give.  I’m sure
>> there’s some simple thing that I’ve overlooked, but after hours and hours of
>> trying to solve this one on my own, I have to admit the need for help.
>>
>>
>>
>> Thank you
>>
>>
>> ___
>> Users mailing list
>> Users@ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/users
>>
>
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
___
Users mailing list
Users@ovirt.org
http://l

Re: [ovirt-users] HEVM root reset?

2017-10-31 Thread Simone Tiraboschi
Hi,
the simplest approach is:

hosted-engine --set-maintenance --mode=global
hosted-engine --vm-shutdown
# wait for it
hosted-engine --vm-start-paused
hosted-engine --add-console-password
# open a vnc or spice console pointing to the VM
# when ready
virsh -c qemu://$(hostname)/system resume HostedEngine
# quickly stop the boot process from the vnc or spice console
# force root password as for a regular el7 system
# shutdown the engine VM
hosted-engine --set-maintenance --mode=none



On Sat, Oct 28, 2017 at 11:25 PM, Chas Ecomm  wrote:

> TIA for any guidance you can give me here, I’m in a bit of a pickle and
> have spent many hours reading many posts and blogs that don’t seem to get
> me where I need to be, and despite my gut feeling that someone has had to
> have dealt with this somewhere else, my google-fu is failing me in finding
> anyone who has dealt with this particular problem.
>
>
>
> My issue:
>
>
>
> I’ve inherited a 4.1 hosted-engine setup.  This is for a non-profit, so
> the previous consultant did what she could to save capital expense by using
> older gear and oVirt rather than VMware/Hyper-V and newer equipment.  For
> the most part it has worked quite well as I understand it.  This particular
> setup has gone from 3.5 with a standalone engine to 4.1 with a hosted
> engine, in case that matters.
>
>
>
> The VMs hosted on the 2 clusters associated with this engine are currently
> working fine, but I am trying to get into the hosted-engine VM, and either
> there was a problem with the root password during setup and the
> hosted-engine-setup script didn’t catch it or I’ve been given a bad
> password.  The previous admin didn’t setup any alternative users, which is
> a major no-no in my book, and so I’m trying to do that – but I can’t login
> to the VM.  I can log into the portal and manage the hosts, storage, VMs,
> etc., just not the HEVM.  As I understand it, even if I could set aside my
> need for alternate users, when it comes time to upgrade I will need access
> to the HEVM, so I have to solve this at some point.
>
>
>
> If this were a physical machine, I’d reboot in single user mode and work
> at things from there, but it’s not, and I’ve not found a good guide to get
> to the engine console to put it into single user mode.  I’ve found lots
> (and lots, and lots) of links on the oVirt docs site regarding hosted
> engine setups that simply don’t exist as pages anymore and others that
> don’t address this issue, as well as a couple of links on the RedHat site
> that made me think I could connect via ssh to the host running the VM, and
> do some sort of X forwarding, but I haven’t come anywhere close to success
> with that, and since I can’t log into the VM, I’m not sure how that would
> work anyway.  I’ve always struggled with X forwarding, too, so that doesn’t
> help, I’m sure.
>
>
>
> I read a few posts from what look like the early days of the hosted-engine
> OVA implying you could launch a console from the management portal and
> maybe try to reboot and set single user mode there, but they all
> dead-ended.  Also, I may be confused on how the hosted engine works (I find
> this much more confusing than either VMware or Hyper-V), but if I’m
> connected to the console via the oVirt management portal and I reboot the
> VM to try and get into single user mode, wouldn’t I lose my connection and
> still not be able to get into single user mode?
>
>
>
> I can connect via hosted-engine –console, but that asks me for the root
> password, which of course I don’t have.
>
>
>
> Am I just doomed to have to rebuild this whole set of servers from scratch
> or is there some way I could either re-run hosted-engine –deploy so I can
> set the root password and not lose my current config; or alternatively is
> there a way to get the VM into single user mode and accessible so I can use
> normal Linux practices for a lost root password?
>
>
>
> Thanks for listening and for any help you can possibly give.  I’m sure
> there’s some simple thing that I’ve overlooked, but after hours and hours
> of trying to solve this one on my own, I have to admit the need for help.
>
>
>
> Thank you
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] HEVM root reset?

2017-10-30 Thread Staniforth, Paul
Some useful commands for the host running the hosted-engine



/usr/sbin/hosted-engine --add-console-passw..d

/usr/sbin/hosted-engine  --console


Put it in maintenance, then start an alternate configuration




/usr/sbin/hosted-engine --vm-start --vm-conf=

Load an alternative vm.conf file as a recovery action


Regards,

 Paul S.



To view the terms under which this email is distributed, please go to:-
http://disclaimer.leedsbeckett.ac.uk/disclaimer/disclaimer.html
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] HEVM root reset?

2017-10-29 Thread Joop

On 28-10-2017 23:25, Chas Ecomm wrote:

My issue:

I’ve inherited a 4.1 hosted-engine setup. This is for a non-profit, so 
the previous consultant did what she could to save capital expense by 
using older gear and oVirt rather than VMware/Hyper-V and newer 
equipment.  For the most part it has worked quite well as I understand 
it.  This particular setup has gone from 3.5 with a standalone engine 
to 4.1 with a hosted engine, in case that matters.


The VMs hosted on the 2 clusters associated with this engine are 
currently working fine, but I am trying to get into the hosted-engine 
VM, and either there was a problem with the root password during setup 
and the hosted-engine-setup script didn’t catch it or I’ve been given 
a bad password.  The previous admin didn’t setup any alternative 
users, which is a major no-no in my book, and so I’m trying to do that 
– but I can’t login to the VM.  I can log into the portal and manage 
the hosts, storage, VMs, etc., just not the HEVM.  As I understand it, 
even if I could set aside my need for alternate users, when it comes 
time to upgrade I will need access to the HEVM, so I have to solve 
this at some point.



I assume you checked whether you have sudo rights with the standard 
user? If not you could also try to add that user to the sudo admin group 
and that way gain root rights. Both ways you need to get to boot the HE 
from an alternative boot device.
You could use qemu to boot the HE from a rescue CD and reset the 
password or add your user to the right sudo group.
I just tried that on a copy of my HE and can boot my HE with the 
following command:

qemu-system-x86_64.exe -m 1024.000 -name HE  -hda t:\HE.qcow
Making a copy made the image non-sparse but I didn't try too hard to fix 
this since I'm trying this out on a W10 PC :-)


Regards,

Joop


___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] HEVM root reset?

2017-10-28 Thread Charles Kozler
You might be better off rebuilding. It shouldnt be that hard albeit
slightly time consuming. Is this a production environment or is it a
lab/test area?

Two possible ways for this, I think...

1.) Not sure if HE will use it but if you right click on the HostedEngine
VM in the web UI and click edit, then "Initial Run" you may be able to use
this and set a new root password there and then reboot it. oVirt HE should
pick up the new settings, however, I have only used this on glance VM
templates and had moderate success there so not sure if this will work for
HE
or
2.) And be very cautious, again could be a complete hackshut down the
hosted engine and navigate to its disk storage. Take a backup of the image
with qemu-img or rsync --sparse. You can then mount the HE raw disk with a
loopback device, activate the LVMs, and then remove the root password from
there. Not sure if RHEL7, systemd, or SELinux will block this on reboot,
but it'd be my last ditch resort but only after rebuilding the cluster is
out of the question

On Sat, Oct 28, 2017 at 5:25 PM, Chas Ecomm  wrote:

> TIA for any guidance you can give me here, I’m in a bit of a pickle and
> have spent many hours reading many posts and blogs that don’t seem to get
> me where I need to be, and despite my gut feeling that someone has had to
> have dealt with this somewhere else, my google-fu is failing me in finding
> anyone who has dealt with this particular problem.
>
>
>
> My issue:
>
>
>
> I’ve inherited a 4.1 hosted-engine setup.  This is for a non-profit, so
> the previous consultant did what she could to save capital expense by using
> older gear and oVirt rather than VMware/Hyper-V and newer equipment.  For
> the most part it has worked quite well as I understand it.  This particular
> setup has gone from 3.5 with a standalone engine to 4.1 with a hosted
> engine, in case that matters.
>
>
>
> The VMs hosted on the 2 clusters associated with this engine are currently
> working fine, but I am trying to get into the hosted-engine VM, and either
> there was a problem with the root password during setup and the
> hosted-engine-setup script didn’t catch it or I’ve been given a bad
> password.  The previous admin didn’t setup any alternative users, which is
> a major no-no in my book, and so I’m trying to do that – but I can’t login
> to the VM.  I can log into the portal and manage the hosts, storage, VMs,
> etc., just not the HEVM.  As I understand it, even if I could set aside my
> need for alternate users, when it comes time to upgrade I will need access
> to the HEVM, so I have to solve this at some point.
>
>
>
> If this were a physical machine, I’d reboot in single user mode and work
> at things from there, but it’s not, and I’ve not found a good guide to get
> to the engine console to put it into single user mode.  I’ve found lots
> (and lots, and lots) of links on the oVirt docs site regarding hosted
> engine setups that simply don’t exist as pages anymore and others that
> don’t address this issue, as well as a couple of links on the RedHat site
> that made me think I could connect via ssh to the host running the VM, and
> do some sort of X forwarding, but I haven’t come anywhere close to success
> with that, and since I can’t log into the VM, I’m not sure how that would
> work anyway.  I’ve always struggled with X forwarding, too, so that doesn’t
> help, I’m sure.
>
>
>
> I read a few posts from what look like the early days of the hosted-engine
> OVA implying you could launch a console from the management portal and
> maybe try to reboot and set single user mode there, but they all
> dead-ended.  Also, I may be confused on how the hosted engine works (I find
> this much more confusing than either VMware or Hyper-V), but if I’m
> connected to the console via the oVirt management portal and I reboot the
> VM to try and get into single user mode, wouldn’t I lose my connection and
> still not be able to get into single user mode?
>
>
>
> I can connect via hosted-engine –console, but that asks me for the root
> password, which of course I don’t have.
>
>
>
> Am I just doomed to have to rebuild this whole set of servers from scratch
> or is there some way I could either re-run hosted-engine –deploy so I can
> set the root password and not lose my current config; or alternatively is
> there a way to get the VM into single user mode and accessible so I can use
> normal Linux practices for a lost root password?
>
>
>
> Thanks for listening and for any help you can possibly give.  I’m sure
> there’s some simple thing that I’ve overlooked, but after hours and hours
> of trying to solve this one on my own, I have to admit the need for help.
>
>
>
> Thank you
>
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
>
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


[ovirt-users] HEVM root reset?

2017-10-28 Thread Chas Ecomm
TIA for any guidance you can give me here, I'm in a bit of a pickle and have
spent many hours reading many posts and blogs that don't seem to get me
where I need to be, and despite my gut feeling that someone has had to have
dealt with this somewhere else, my google-fu is failing me in finding anyone
who has dealt with this particular problem.

 

My issue:

 

I've inherited a 4.1 hosted-engine setup.  This is for a non-profit, so the
previous consultant did what she could to save capital expense by using
older gear and oVirt rather than VMware/Hyper-V and newer equipment.  For
the most part it has worked quite well as I understand it.  This particular
setup has gone from 3.5 with a standalone engine to 4.1 with a hosted
engine, in case that matters.

 

The VMs hosted on the 2 clusters associated with this engine are currently
working fine, but I am trying to get into the hosted-engine VM, and either
there was a problem with the root password during setup and the
hosted-engine-setup script didn't catch it or I've been given a bad
password.  The previous admin didn't setup any alternative users, which is a
major no-no in my book, and so I'm trying to do that - but I can't login to
the VM.  I can log into the portal and manage the hosts, storage, VMs, etc.,
just not the HEVM.  As I understand it, even if I could set aside my need
for alternate users, when it comes time to upgrade I will need access to the
HEVM, so I have to solve this at some point.

 

If this were a physical machine, I'd reboot in single user mode and work at
things from there, but it's not, and I've not found a good guide to get to
the engine console to put it into single user mode.  I've found lots (and
lots, and lots) of links on the oVirt docs site regarding hosted engine
setups that simply don't exist as pages anymore and others that don't
address this issue, as well as a couple of links on the RedHat site that
made me think I could connect via ssh to the host running the VM, and do
some sort of X forwarding, but I haven't come anywhere close to success with
that, and since I can't log into the VM, I'm not sure how that would work
anyway.  I've always struggled with X forwarding, too, so that doesn't help,
I'm sure.

 

I read a few posts from what look like the early days of the hosted-engine
OVA implying you could launch a console from the management portal and maybe
try to reboot and set single user mode there, but they all dead-ended.
Also, I may be confused on how the hosted engine works (I find this much
more confusing than either VMware or Hyper-V), but if I'm connected to the
console via the oVirt management portal and I reboot the VM to try and get
into single user mode, wouldn't I lose my connection and still not be able
to get into single user mode?

 

I can connect via hosted-engine -console, but that asks me for the root
password, which of course I don't have.  

 

Am I just doomed to have to rebuild this whole set of servers from scratch
or is there some way I could either re-run hosted-engine -deploy so I can
set the root password and not lose my current config; or alternatively is
there a way to get the VM into single user mode and accessible so I can use
normal Linux practices for a lost root password?

 

Thanks for listening and for any help you can possibly give.  I'm sure
there's some simple thing that I've overlooked, but after hours and hours of
trying to solve this one on my own, I have to admit the need for help.

 

Thank you

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users