Skip to contentSkip to conversation

Toolstack/libvirt: use URI in migration command

PATCH In review Wei Liu 4 participants 8 messages Aug 11, 2015 – Aug 12, 2015

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 Toolstack/libvirt: use URI in migration command

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so use xen+ssh for the time being.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Cc: Jim Fehlig <[email protected]>

I once had email exchange with Jim and he said xen+ssh was a commonly use configuration.

Jim, I hope I got the URI right. The constructed command will be like

virsh migrate guest xen+ssh://dst-host

.

OSSTest has working ssh setup between src and dst host so I expect this setup to just work.

---
 Osstest/Toolstack/libvirt.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Osstest/Toolstack/libvirt.pm +1 -1
index bfb5ccb..477ebee 100644
@@ -108,7 +108,7 @@ sub migrate ($$$$) {
     my $sho = $self->{Host};
     my $dst = $dho->{Name};
     my $gn = $gho->{Name};
-    target_cmd_root($sho, "virsh migrate $gn $dst", $timeout);
+    target_cmd_root($sho, "virsh migrate $gn xen+ssh://$dst", $timeout);
 }
 
 sub save ($$$$) {
Signature · 1 line
2.1.4
#1 lore raw
Quoted 10 lines · Wei Liu

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so use xen+ssh for the time being.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Cc: Jim Fehlig <[email protected]>

Quoted 7 lines

I once had email exchange with Jim and he said xen+ssh was a commonly use configuration.

Jim, I hope I got the URI right. The constructed command will be like

virsh migrate guest xen+ssh://dst-host

Yes, that is correct. Note you will need a '--live' option if live migration is what you are after

  virsh migrate --live guest xen+ssh://dst-host

Regards,
Jim

Quoted 22 lines

.

OSSTest has working ssh setup between src and dst host so I expect this setup to just work.

---
 Osstest/Toolstack/libvirt.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Osstest/Toolstack/libvirt.pm +1 -1
index bfb5ccb..477ebee 100644
@@ -108,7 +108,7 @@ sub migrate ($$$$) {
     my $sho = $self->{Host};
     my $dst = $dho->{Name};
     my $gn = $gho->{Name};
-    target_cmd_root($sho, "virsh migrate $gn $dst", $timeout);
+    target_cmd_root($sho, "virsh migrate $gn xen+ssh://$dst", $timeout);
 }
 
 sub save ($$$$) {
#2 lore raw
Quoted 16 lines · Jim Fehlig
Quoted 15 lines · Wei Liu

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so use xen+ssh for the time being.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Cc: Jim Fehlig <[email protected]>

I once had email exchange with Jim and he said xen+ssh was a commonly use configuration.

Jim, I hope I got the URI right. The constructed command will be like

Quoted 7 lines
Quoted 2 lines

virsh migrate guest xen+ssh://dst-host

Yes, that is correct. Note you will need a '--live' option if live migration is what you are after

  virsh migrate --live guest xen+ssh://dst-host

I think we probably do want live (xl does it by default).

I suggest we also do

    my $duri = "xen+ssh://$dst";

else the line is probably going to get a bit long.

So I propose to fold in this:

Osstest/Toolstack/libvirt.pm +2 -1
index 477ebee..776432d 100644
@@ -108,7 +108,8 @@ sub migrate ($$$$) {
     my $sho = $self->{Host};
     my $dst = $dho->{Name};
     my $gn = $gho->{Name};
-    target_cmd_root($sho, "virsh migrate $gn xen+ssh://$dst", $timeout);
+    my $duri = "xen+ssh://$dst";
+    target_cmd_root($sho, "virsh migrate --live $gn $duri", $timeout);
 }
 
 sub save ($$$$) {

Ian.

Acked-by
#3 lore raw
Quoted 26 lines · Ian Campbell
Quoted 17 lines · Jim Fehlig
Quoted 16 lines · Wei Liu

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so
use xen+ssh for the time being.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Cc: Jim Fehlig <[email protected]>

I once had email exchange with Jim and he said xen+ssh was a commonly use configuration.

Jim, I hope I got the URI right. The constructed command will be like

Quoted 7 lines
Quoted 2 lines

virsh migrate guest xen+ssh://dst-host

Yes, that is correct. Note you will need a '--live' option if live migration is what you are after

  virsh migrate --live guest xen+ssh://dst-host
Quoted 7 lines

I think we probably do want live (xl does it by default).

I suggest we also do

    my $duri = "xen+ssh://$dst";

else the line is probably going to get a bit long.

So I propose to fold in this:

Ian agreed to this on IRC so I've pushed that to pretest. Full patch:

Quoted 1 line

From d042454d2474e0af7349838ee22131527f1208ff Mon Sep 17 00:00:00 2001

From: Wei Liu <[email protected]>
Date: Tue, 11 Aug 2015 21:25:09 +0100
Subject: [PATCH] Toolstack/libvirt: use URI in migration command

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so use xen+ssh for the time being.

Cc Ian Jackson <[email protected]>
[ ijc -- added --live and factored out $duri ]
---
 Osstest/Toolstack/libvirt.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Osstest/Toolstack/libvirt.pm +2 -1
index bfb5ccb..776432d 100644
@@ -108,7 +108,8 @@ sub migrate ($$$$) {
     my $sho = $self->{Host};
     my $dst = $dho->{Name};
     my $gn = $gho->{Name};
-    target_cmd_root($sho, "virsh migrate $gn $dst", $timeout);
+    my $duri = "xen+ssh://$dst";
+    target_cmd_root($sho, "virsh migrate --live $gn $duri", $timeout);
 }
 
 sub save ($$$$) {
Signature · 1 line
2.1.4
#4 lore raw
In reply to Jim Fehlig
Quoted 16 lines · Jim Fehlig
Quoted 15 lines · Wei Liu

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so use xen+ssh for the time being.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Cc: Jim Fehlig <[email protected]>

I once had email exchange with Jim and he said xen+ssh was a commonly use configuration.

Jim, I hope I got the URI right. The constructed command will be like

Quoted 7 lines
Quoted 2 lines

virsh migrate guest xen+ssh://dst-host

Yes, that is correct. Note you will need a '--live' option if live migration is what you are after

  virsh migrate --live guest xen+ssh://dst-host

As well as pushing to pretest I also kicked off a quicker local run, which is at http://xenbits.xen.org/people/ianc/tmp/37824/ .

http://xenbits.xen.org/people/ianc/tmp/37824/test-amd64-amd64-libvirt
-pair/info.html shows this in the log for 21.ts-migrate-log.log:

    2015-08-12 11:22:47 Z executing ssh ... [email protected] virsh migrate --live debian.guest.osstest xen+ssh    ://lace-bug
    error: End of file while reading data: nc: invalid option -- 'U'
    nc -h for help: Input/output error

I've no idea how or why nc is involved, but it seems it doesn't like Debian Wheezy's implementation?

Ian.

#5 lore raw
Quoted 34 lines · Ian Campbell
Quoted 17 lines · Jim Fehlig
Quoted 15 lines · Wei Liu

Virsh migrate expects an URI, not a host. We don't actually care what kind of transport it uses, the main objective is to test migration, so use xen+ssh for the time being.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Cc: Jim Fehlig <[email protected]>

I once had email exchange with Jim and he said xen+ssh was a commonly use configuration.

Jim, I hope I got the URI right. The constructed command will be like

Quoted 8 lines
Quoted 3 lines

virsh migrate guest xen+ssh://dst-host

Yes, that is correct. Note you will need a '--live' option if live migration is what you are after

  virsh migrate --live guest xen+ssh://dst-host

As well as pushing to pretest I also kicked off a quicker local run, which is at http://xenbits.xen.org/people/ianc/tmp/37824/ .

http://xenbits.xen.org/people/ianc/tmp/37824/test-amd64-amd64-libvirt
-pair/info.html shows this in the log for 21.ts-migrate-log.log:

Quoted 7 lines
    2015-08-12 11:22:47 Z executing ssh ... [email protected] virsh migrate --live debian.guest.osstest xen+ssh    ://lace-bug
    error: End of file while reading data: nc: invalid option -- 'U'
    nc -h for help: Input/output error

I've no idea how or why nc is involved, but it seems it doesn't like Debian Wheezy's implementation?

nc is used to relay connections on the ssh tunnel to libvirtd's unix domain socket. Is there a netcat-openbsd package? I recall seeing this long ago, perhaps from this old bug report

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348564

Regards,
Jim

#6 lore raw
Quoted 2 lines · Jim Fehlig

nc is used to relay connections on the ssh tunnel to libvirtd's unix domain socket. Is there a netcat-openbsd package?

Yes there is. It even seems to have higher priority if installed, but it is not in the default package set.

Sounds like we should just add it to the list of packages which we install either at host install time or as part of preparing a host for use. I'm inclined just to add it at install time, Ian?

Quoted 12 lines

I recall seeing this
long ago, perhaps from this old bug report

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348564

Regards,
Jim

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw

Ian Campbell writes ("Re: [Xen-devel] [PATCH OSSTEST] Toolstack/libvirt: use URI in migration command"):

Quoted 3 lines

Sounds like we should just add it to the list of packages which we install either at host install time or as part of preparing a host for use. I'm inclined just to add it at install time, Ian?

Fine by me. I think it should go in ts-xen-install, probably.

Ian.