lost and found ( for me ? )

KVM : add a device with virsh attach-device

small tips.

prepare an xml file

$ cat network-add.xml
<interface type='network'>
  <source network='net-192.168.42'/>
  <model type='virtio'/>
</interface>

$ virsh dumpxml m-node03 | grep network
    <interface type='network'>
      <source network='net-192.168.40'/>
    <interface type='network'>
      <source network='net-192.168.41'/>
$
$ virsh attach-device m-node03 network-add.xml --config
Device attached successfully

$
$ virsh dumpxml m-node03 | grep network
    <interface type='network'>
      <source network='net-192.168.40'/>
    <interface type='network'>
      <source network='net-192.168.41'/>
    <interface type='network'>
      <source network='net-192.168.42'/>
$

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.