C. L. Martinez
2015-Feb-18 08:10 UTC
[CentOS-virt] Disable/stop nic in a virtual guest with virsh
On Tue, Feb 17, 2015 at 1:43 PM, Sven Kieske <s.kieske at mittwald.de> wrote:> > > On 17/02/15 09:18, C. L. Martinez wrote: >> Hi all, >> >> How can I stop/disable a nic in a virtual guest using a virsh >> command?? I am searching the same effect like if I unplug network >> cable ... Is it possible?? I have tried with "detach-interface" >> command without luck. I don't want to remove the nic from guest >> configuration, only to stop the nic ... > > Depending on your network architecture you could just ifdown > the vmnet, but this just works if you don't have multiple > vms on one vmnet (which you shouldn't). > > HTH > > --Ok, to do a ifdown of virtual bridge it seems the only option. Many thanks to all for your answers.
Juerg Haefliger
2015-Feb-18 13:32 UTC
[CentOS-virt] Disable/stop nic in a virtual guest with virsh
On Wed, Feb 18, 2015 at 9:10 AM, C. L. Martinez <carlopmart at gmail.com> wrote:> On Tue, Feb 17, 2015 at 1:43 PM, Sven Kieske <s.kieske at mittwald.de> wrote: >> >> >> On 17/02/15 09:18, C. L. Martinez wrote: >>> Hi all, >>> >>> How can I stop/disable a nic in a virtual guest using a virsh >>> command?? I am searching the same effect like if I unplug network >>> cable ... Is it possible?? I have tried with "detach-interface" >>> command without luck. I don't want to remove the nic from guest >>> configuration, only to stop the nic ...There's a qemu monitor command for that. You can pass it in through virsh: $ virsh qemu-monitor-command --hmp <instance name> 'set_link <nic name> off' Example: # virsh list Id Name State ---------------------------------------------------- 3 dwarf-00000039 running # virsh qemu-monitor-command --hmp dwarf-00000039 'info network' net0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:a8:85:ea \ hostnet0: index=0,type=tap,fd=24 # virsh qemu-monitor-command --hmp dwarf-00000039 'set_link net0 off' ...Juerg>> Depending on your network architecture you could just ifdown >> the vmnet, but this just works if you don't have multiple >> vms on one vmnet (which you shouldn't). >> >> HTH >> >> -- > > Ok, to do a ifdown of virtual bridge it seems the only option. > > Many thanks to all for your answers. > _______________________________________________ > CentOS-virt mailing list > CentOS-virt at centos.org > http://lists.centos.org/mailman/listinfo/centos-virt
SilverTip257
2015-Feb-18 16:59 UTC
[CentOS-virt] Disable/stop nic in a virtual guest with virsh
On Wed, Feb 18, 2015 at 3:10 AM, C. L. Martinez <carlopmart at gmail.com> wrote:> On Tue, Feb 17, 2015 at 1:43 PM, Sven Kieske <s.kieske at mittwald.de> wrote: > > > > > > On 17/02/15 09:18, C. L. Martinez wrote: > >> Hi all, > >> > >> How can I stop/disable a nic in a virtual guest using a virsh > >> command?? I am searching the same effect like if I unplug network > >> cable ... Is it possible?? I have tried with "detach-interface" > >> command without luck. I don't want to remove the nic from guest > >> configuration, only to stop the nic ... > > > > Depending on your network architecture you could just ifdown > > the vmnet, but this just works if you don't have multiple > > vms on one vmnet (which you shouldn't). > > > > HTH > > > > -- > > Ok, to do a ifdown of virtual bridge it seems the only option. > > Many thanks to all for your answers. >* Definitely look to Juerg Haefliger's solution. It's exactly what you want since you requested a method that can be done from the virsh interface. Thanks Juerg! 1) down the vnetX interface from the host node ip link show dev vnetX ip link set down vnetX ip link show dev vnetX And if using bridged networking, you have one more option. 2) remove the vnetX interface from the bridge brctl delif <bridge_int> vnetX Certainly downing the interface using either Juerg's solution via virsh or mine via iproute2 tools is most ideal since it's easier/simpler to reinstate. You can use ifconfig if you prefer it over ip tools, but enjoy those tools and syntax while it remains! [0] ;-) [0] https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/ -- ---~~.~~--- Mike // SilverTip257 // -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20150218/68d16ec4/attachment.html>
Nico Kadel-Garcia
2015-Feb-20 14:56 UTC
[CentOS-virt] Upgrading Xen 3 on SL 5 server with CentOS 5 and SL 5
I'm dealing with an old Xen 3 server, and badly need to update it and all the vm's on it to more contemporary operating systems. So far, so good! Can the Xen server on CentOS 5 para-virtualized CentOS 6? And if not, I'm having real trouble getting a live cd or installation media to boot in full virtualization to do the update of the guests. I'd normally start by updating the Xen server first, but that's not workable right now. Nico Kadel-Garcia Email: nkadel at gmail.com Sent from iPhone> On Feb 18, 2015, at 11:59, SilverTip257 <silvertip257 at gmail.com> wrote: > >> On Wed, Feb 18, 2015 at 3:10 AM, C. L. Martinez <carlopmart at gmail.com> wrote: >> On Tue, Feb 17, 2015 at 1:43 PM, Sven Kieske <s.kieske at mittwald.de> wrote: >> > >> > >> > On 17/02/15 09:18, C. L. Martinez wrote: >> >> Hi all, >> >> >> >> How can I stop/disable a nic in a virtual guest using a virsh >> >> command?? I am searching the same effect like if I unplug network >> >> cable ... Is it possible?? I have tried with "detach-interface" >> >> command without luck. I don't want to remove the nic from guest >> >> configuration, only to stop the nic ... >> > >> > Depending on your network architecture you could just ifdown >> > the vmnet, but this just works if you don't have multiple >> > vms on one vmnet (which you shouldn't). >> > >> > HTH >> > >> > -- >> >> Ok, to do a ifdown of virtual bridge it seems the only option. >> >> Many thanks to all for your answers. > > > * Definitely look to Juerg Haefliger's solution. It's exactly what you want since you requested a method that can be done from the virsh interface. Thanks Juerg! > > 1) down the vnetX interface from the host node > ip link show dev vnetX > ip link set down vnetX > ip link show dev vnetX > > And if using bridged networking, you have one more option. > 2) remove the vnetX interface from the bridge > brctl delif <bridge_int> vnetX > > Certainly downing the interface using either Juerg's solution via virsh or mine via iproute2 tools is most ideal since it's easier/simpler to reinstate. You can use ifconfig if you prefer it over ip tools, but enjoy those tools and syntax while it remains! [0] ;-) > > [0] https://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/ > > -- > ---~~.~~--- > Mike > // SilverTip257 // > _______________________________________________ > CentOS-virt mailing list > CentOS-virt at centos.org > http://lists.centos.org/mailman/listinfo/centos-virt-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos-virt/attachments/20150220/e5d27099/attachment-0002.html>