Getting error when trying to live migrate

posted in General
Friday, June 06 2014, 02:06 AM
0
So I've been trying to live migrate a VM to get familiar with Xen. I get the following error even if I try to migrate to localhost:

Googling didn't really help. What could be the problem?

jn332@machine1:~$ sudo xl migrate ubuntu junaid@localhost
jn332@128.36.108.45's password:
xc: error: Could not obtain handle on privileged command interface (13 = Permission denied): Internal error
libxl: error: libxl.c:92:libxl_ctx_alloc: cannot open libxc handle: Permission denied
cannot init xl context
libxl: error: libxl_utils.c:396:libxl_read_exactly: file/stream truncated reading banner from migration receiver stream
libxl: info: libxl_exec.c:118:libxl_report_child_exitstatus: migration target process [10976] exited with error status 1

Accepted Answer

Monday, July 14 2014, 10:50 PM - #permalink
0
So I tried to use Xl to migrate using a completely different machine. I ran into the same exact error, but hohoho this time I figured out what was happening.

There wasn't really any resources on this error for some reason, even though it should be fairly common given what I now know about it. However I found out that essentially the new migrate command essentially just sshs to the target machine and runs the command "xl migrate-receive". Now, the issue is as with any xl command, it requires sudo priveledges. So when you try to migrate with a normal user such as myusername@localhost, its like just typing in "xl migrate-receive" without the sudo.

So you have to login as root if you want to migrate, such as root@localhost. However, my root password wasn't working when I tried this even though I set up a root password.

This is because it turns out ssh disables the ability to login as root through ssh. Here is the solution:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Virtualization/3.3/html/V2V_Guide/Preperation_Before_the_P2V_Migration-Enable_Root_Login_over_SSH.html

I pasted the essence of it below in case the link ever goes down:

-------------------------
Enable root login over SSH:
As root, edit the sshd_config file in /etc/ssh/sshd_config:

nano /etc/ssh/sshd_config

Add a line in the Authentication section of the file that says PermitRootLogin yes. This line may already exist and be commented out with a "#". In this case, remove the "#".

# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

Save the updated /etc/ssh/sshd_config file.

Restart the SSH server (ADDED: Or just restart computer):

service sshd restart

You can now connect to the conversion server as root over SSH.
-------------------------

The last service sshd restart command didn't work for me I just restarted my computer instead as I added above.

Anyway, with that command set, using migrate with root@otherserver now works!

Hooray!
Like
The reply is currently minimized Show
Responses (8)
  • Accepted Answer

    Friday, June 06 2014, 03:11 AM - #permalink
    0
    Junaid,

    Try the same command as root (or using sudo) on Domain 0. Does it work now?

    \Russ
    The reply is currently minimized Show
  • Accepted Answer

    Friday, June 06 2014, 03:34 AM - #permalink
    0
    I get an error talking about how there is no config file for Domain-0.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, June 06 2014, 04:40 AM - #permalink
    0
    name = "ubuntu"
    memory = 256
    disk = ['file:/home/junaid/XenGuest1.img,xvda,w']
    vif = [' ']

    bootloader = "pygrub"


    This is my config file
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, June 07 2014, 03:47 AM - #permalink
    0
    It sounds like a misconfiguration somewhere.

    Have you checked out this page to see if it helps:

    http://wiki.xenproject.org/wiki/Migration

    Particularly note the shared storage (or NBD) requirement.

    Then try this:

    Login to Domain 0 as root. Try the command (without the sudo). If it does not work, please give us the exact error messages (if they are different than the ones you listed above).

    Russ
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, June 08 2014, 01:29 PM - #permalink
    0
    Well if I'm migrating to local host (the same PC), it should fulfill the shared disk requirement right? I think I tried logging in as root (using su) and it didn't work but I will get back to you soon.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 09 2014, 12:51 PM - #permalink
    0
    Okay, I missed the part of trying to migrate to the same host. Other than a user exercise, why would you need to do that? Frankly, it wouldn't surprise me if migration within a single host has problems, since I can't think of a reason why one would do so, and it is very possible it wasn't designed (or tested) with that capability in mind.

    I still believe the key is in the privs, and running in Dom0 as root (either via login or sudo) could remedy the problem.

    Please let us know what happens once you get the root access problem sorted out.

    Thanks,

    Russ
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, June 25 2014, 09:30 PM - #permalink
    0
    I think the issue was that I installed the VM with XM but was trying to migrate it with XL.

    At least that's my guess because when I tried it with XM it worked.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, July 15 2014, 12:11 AM - #permalink
    0
    Junaid,

    Good job!

    Russ
    The reply is currently minimized Show
Your Reply