User Tools

Site Tools


unix:virtualization:virtlib:importxen

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
unix:virtualization:virtlib:importxen [2022/05/08 22:30] rodolicounix:virtualization:virtlib:importxen [2022/05/19 23:13] rodolico
Line 15: Line 15:
 name='server.example.com'# change this to the name displayed on xm list name='server.example.com'# change this to the name displayed on xm list
  
-# change the MAC address to be unique. There is a list of MAC's we use in shared/Tech/DailyData/ips.ods+# change the MAC address to be unique.
 # change the vifname so it shows up well on ifconfig output # change the vifname so it shows up well on ifconfig output
 vif= [ vif= [
Line 39: Line 39:
 </code> </code>
  
-To do this, will run virt-install+To do this, will run virt-install with the --print-xml flag, which will simply show the configuration. In this case, I'm writing it to a file so it can be edited, then used to test, then define the virtual.
  
 <code bash> <code bash>
-virt-install \+ virt-install 
 +   --print-xml \
    --hvm \    --hvm \
    --connect    qemu:///system \    --connect    qemu:///system \
-   --import \+   --name       **CHANGEME** \ 
 +   --memory     **CHANGEME** \ 
 +   --vcpus      **CHANGEME** \ 
 +   --disk       path=**CHANGEME**,bus=virtio,target=sda \ 
 +   --graphics vnc,port=**CHANGEME** \
    --noautoconsole \    --noautoconsole \
 +   --os-variant debian9 \
 +   --metadata uuid=**CHANGEME**,name=**CHANGEME**t,title=**CHANGEME**,description='**CHANGEME**' \
    --boot     hd,cdrom,menu=on \    --boot     hd,cdrom,menu=on \
-   --name       server.example.com \ +   --network  bridge=**CHANGEME**,mac=**CHANGEME**,model=virtio \ 
-   --os-variant debian10 \ +   --network  bridge=**CHANGEME**,mac=**CHANGEME**,model=virtio 
-   --metadata uuid=44f33f93-f606-4513-8dc0-7e1eac977025 \ +   > test.xml
-   --memory     4096 \ +
-   --vcpus      4 \ +
-   --disk       path=/dev/disk/by-path/ip-10.22.209.32:3260-iscsi-iqn.2019-09.com.nas:server.disk0-lun-0,bus=virtio,target=sda \ +
-   --cdrom     /mnt/devuan_beowulf_3.1.1_amd64_netinstall.iso \ +
-   --graphics vnc,port=5904 +
-   --network  bridge=br_dmz,mac=00:16:3f:97:db:f3,model=virtio+
 </code> </code>
  
-The items after //name// in the above command are all populated from a Xen configuration file. **NOTE**: it is very important to place the boot drive first in the list, before any other drives or cdrom's+The items marked **CHANGEME** in the above command are all populated from a Xen configuration file. **NOTE**: it is very important to place the boot drive first in the list, before any other drives or cdrom's
  
 +Once you have this done, edit the resulting file with any changes you may need. I change the CPU as per [[unix:virtualization:virtlib:migrate|]] so I can migrate easily.
  
 +Now, shut down the virtual on its Xen hypervisor and test it with the following command: <code bash>virsh create test.xml --console</code>. This will start the new definition, putting you in the console so you can watch it boot. **Be very sure to shut down the virtual in its origin first**.
 +
 +If all works well, shut down the virtual, then make the definition permanent with <code bash>virsh define test.xml</code>
 +
 +You are done.
unix/virtualization/virtlib/importxen.txt · Last modified: 2022/05/19 23:28 by rodolico