Re: >>: [libvirt] OpenVZ capabilites in LibVIRT

Hi, Anton.
You can specify an IP address and a netmask like this:
http://libvirt.org/formatnetwork.html#elementsAddress Such bridge will be automatically set up.
- thanks for the hint. I assigned 0.0.0.0 as I don't need IP on bridges at the moment.
2) there is a default network "Default" with enabled 'Autostart'. Is
there any way to remove this network completely?
Yes, # virsh net-destroy defaul
correct answer is # virsh net-undefine default
- you were correct in both cases: you can't undefine active network so it should be destroyed and after that undefine. So it worked!
Short answer: it doesn't work now. Wait for nex libvirt release (libvirt-4.6-alt2). I will try to make it as soon as possible. For details see http://www.redhat.com/archives/libvir-list/2008-October/msg00323.html
- yeah, i've already read that thread and known it was a bug. Just needed a confirmation that it was going to be fixed in next release. So may be my question will be a bit indelicate, but is there a hope to see this release by the end of november?
5) Is there any way to destroy domain completely like it can be done via
'vzctl destroy <ID>'?
Yes, # virsh destroy <domain-name>
And here too, if domain was previously defined, command must be:
# virsh undefine <domain-name>
- got the idea. And noticed the following: virsh # define ovz.xml Domain 3005 defined from ovz.xml virsh # start 3005 Domain 3005 started virsh # shutdown 3005 Domain 3005 is being shutdown virsh # undefine 3005 libvir: OpenVZ error : Domain not found Domain 3005 has been undefined It really removes domain from file system, but why does it throw that error message? 6) Where does libvirt store info about already created domains? I can't
create a new domain with ID 3005 after I completely destroy previous one via 'vzctl destroy 3005'.
And what does it saying?
- if i simply destroy domain via vzctl (without undefining it via virsh): [root@alt-03 ~]# vzctl destroy 3005 Destroying container private area: /var/lib/vz/private/3005 Container private area was destroyed - and then try to create another one (this time via virsh) virsh # create ovz.xml libvir: OpenVZ error : operation failed: Already an OPENVZ VM defined with the id '3005' error: Failed to create domain from ovz.xml It seems domain is still defined from LibVirt's point of view but actually it doesn't exist any more. It was removed via native OpenVZ tool. In case I try to undefine it: virsh # undefine 3005 libvir: OpenVZ error : Domain not found libvir: error : vzctl exited with non-zero status 14 and signal 0 libvir: OpenVZ error : internal error Could not exec vzctl error: Failed to undefine domain 3005 And from this moment it is imposible to create domain with ID 3005. So how can I obtain a list of already defined domains? And how can it be purged? 7) Is there any way to publish domain's console on a host system so that I
can connect via telnet to HW node on some TCP/4567 and get into domain's console?
vzctl enter <domain ID>
- yeah, that for sure is true wheh you are on HW node itself. But I need to organize access into domain's consoles from remote mashines. In my case there is no network connectivity between real lan and domains. I believed, this XML definition could help me: http://libvirt.org/formatdomain.html#elementsCharTCP - "*The character device acts as a TCP client connecting to a remote server, or as a server waiting for a client connection*", so when you connect to HW node on some TCP port you get into domain's console. But it seems I got it in a wrong way because is didn't work in case of OpenVZ. P.S. You can ask ALT-specific questions to me directly.
- thanks, will keep that in mind. ___________ Best regards, Ivan V.

Hi - yeah, i've already read that thread and known it was a bug. Just needed a
confirmation that it was going to be fixed in next release. So may be my question will be a bit indelicate, but is there a hope to see this release by the end of november?
Yes, I think
virsh # undefine 3005 libvir: OpenVZ error : Domain not found Domain 3005 has been undefined
It really removes domain from file system, but why does it throw that error
message?
I think, that it is a virsh error
6) Where does libvirt store info about already created domains? I can't
create a new domain with ID 3005 after I completely destroy previous one via 'vzctl destroy 3005'.
And what does it saying?
- if i simply destroy domain via vzctl (without undefining it via virsh): [root@alt-03 ~]# vzctl destroy 3005 Destroying container private area: /var/lib/vz/private/3005 Container private area was destroyed
- and then try to create another one (this time via virsh) virsh # create ovz.xml libvir: OpenVZ error : operation failed: Already an OPENVZ VM defined with the id '3005' error: Failed to create domain from ovz.xml
I can't repeat that behaviour. Try to restart libvirtd: # service libvirtd restart
It seems domain is still defined from LibVirt's point of view but actually it doesn't exist any more. It was removed via native OpenVZ tool. In case I try to undefine it: virsh # undefine 3005 libvir: OpenVZ error : Domain not found libvir: error : vzctl exited with non-zero status 14 and signal 0 libvir: OpenVZ error : internal error Could not exec vzctl error: Failed to undefine domain 3005
And from this moment it is imposible to create domain with ID 3005. So how can I obtain a list of already defined domains? And how can it be purged?
See # virsh help list
7) Is there any way to publish domain's console on a host system so that
I can connect via telnet to HW node on some TCP/4567 and get into domain's console?
vzctl enter <domain ID>
- yeah, that for sure is true wheh you are on HW node itself.
And maybe an ssh will help you here? :)
But I need to organize access into domain's consoles from remote mashines. In my case there is no network connectivity between real lan and domains. I believed, this XML definition could help me:
http://libvirt.org/formatdomain.html#elemInactive implies defined, i thinkentsCharTCP <http://libvirt.org/formatdomain.html#elementsCharTCP> - "*The character device acts as a TCP client connecting to a remote server, or as a server waiting for a client connection*", so when you connect to HW node on some TCP port you get into domain's console. But it seems I got it in a wrong way because is didn't work in case of OpenVZ.
Yes, it doesn't work in case of OpenVZ and I can't make any assumtions if it will be in the nearest future.

On Tue, Nov 11, 2008 at 04:15:35PM +0300, Anton Protopopov wrote:
virsh # undefine 3005 libvir: OpenVZ error : Domain not found Domain 3005 has been undefined
It really removes domain from file system, but why does it throw that error message?
I think, that it is a virsh error
The problem is related to fact that OpenVZ driver uses integers as its domain name. If it looks like an integer, virsh will first do a LookupByID, and then fallback to LookupByName. Inactive domains however, do not have any meaningful ID number. virsh should not be trying to doa lookupByID for the undefine command - it should only do a lookup by name. This would remove the error message.
6) Where does libvirt store info about already created domains? I can't
create a new domain with ID 3005 after I completely destroy previous one via 'vzctl destroy 3005'.
And what does it saying?
- if i simply destroy domain via vzctl (without undefining it via virsh): [root@alt-03 ~]# vzctl destroy 3005 Destroying container private area: /var/lib/vz/private/3005 Container private area was destroyed
- and then try to create another one (this time via virsh) virsh # create ovz.xml libvir: OpenVZ error : operation failed: Already an OPENVZ VM defined with the id '3005' error: Failed to create domain from ovz.xml
This is a bug in the OpenVZ driver. It is caching information about domains in the driver, when it should really be asking OpenVZ about them directly every time, so it always has updated info & plays correctly with vzctl. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Anton Protopopov
-
Daniel P. Berrange
-
Ivan Vovk