File tree Expand file tree Collapse file tree 2 files changed +0
-5
lines changed Expand file tree Collapse file tree 2 files changed +0
-5
lines changed Original file line number Diff line number Diff line change 99MAC_ADDRESS=$( virsh --connect=qemu:///system dumpxml $INSTANCE_NAME  |  xmllint --xpath " string(/domain/devices/interface/source[@network=\" $NETWORK_NAME \" ]/../mac/@address)" ) 
1010if  [ -n  " ${MAC_ADDRESS} " ;  then 
1111    virsh --connect=qemu:///system detach-interface $INSTANCE_NAME  network --mac $MAC_ADDRESS 
12-     #  First try to remove the DHCP static IP entry by MAC, if it fails try by hostname
13-     if  !  virsh --connect=qemu:///system net-update $NETWORK_NAME  delete ip-dhcp-host " <host mac='$MAC_ADDRESS '/>" ;  then 
14-         virsh --connect=qemu:///system net-update $NETWORK_NAME  delete ip-dhcp-host " <host name='$INSTANCE_NAME '/>" 
15-     fi 
1612    sleep 5
1713fi 
1814
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ if [[ -z "${MAC_ADDRESS}" ]]; then
5050else 
5151    VM_ID_SECTION=" mac='$MAC_ADDRESS '" 
5252fi 
53- virsh --connect=qemu:///system net-update $NETWORK_NAME  add-last ip-dhcp-host --xml " <host $VM_ID_SECTION  ip='$IP_ADDRESS '/>" 
5453virsh --connect=qemu:///system attach-interface $INSTANCE_NAME  --source $NETWORK_NAME  --type network --model virtio --mac $MAC_ADDRESS  --config --persistent
5554
5655sleep 5
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments