Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
kvm:kvm [2020/02/03 08:27] – [clone domain/ vm] tmadekvm:kvm [2020/02/04 21:46] – [clone domain/ vm] tmade
Line 68: Line 68:
 Simple Guest Clone Simple Guest Clone
  
-<code> +<code  sh clone-vm.sh
-VM_TO_CLONE=ubuntu1604 +#!/bin/bash 
-NEW_VM_NAME=mgmt+ 
 +echo "" 
 +echo "Overview VM´s:" 
 +echo "" 
 +virsh list --all 
 +echo "" 
 +read -p "Please enter the name of the vm you want to clone: " SOURCEVM 
 +echo "" 
 +read -p "Please enter the name of the cloned vm: " DESTVM 
 +echo ""
  
 virt-clone \ virt-clone \
---original $VM_TO_CLONE \+--original $SOURCEVM \
 --auto-clone \ --auto-clone \
---name $NEW_VM_NAME+--name $DESTVM 
 + 
 +STATUS=$(echo $?) 
 + 
 +echo "" 
 + 
 +if [ $STATUS -eq 0 ] 
 +then 
 +        echo "VM \"$DESTVM\" cloned." 
 +else 
 +        echo "Problem! VM not cloned" 
 +fi
 </code>   </code>  
  
kvm/kvm.txt · Last modified: 2022/03/12 09:13 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki