template convert vm[編輯]
xe template-param-set is-a-template=false uuid=$(xe template-list name-label=guac01 --minimal) xe vm-start uuid=UUID xe vm-shutdown force=true uuid=UUID
vm export/import[編輯]
xe vm-export vm=win10-test filename=/opt/win10-test.xva vm= 指定需要導出vm的名稱 xe vm-import filename=win10-test.xva sr-uuid=bd71899b-7a50-d271-996e-9b90bf58ec38a
template export/import[編輯]
xe template-export template-uuid=ced655e0-e1ba-d5da-34fa-8f386f026418 filename=/opt/centos7.xva template-uuid= 模板的uuid filename= 導出位置 xe vm-import filename=/opt/centos7.xva sr-uuid=85695343-379e-fab3-ce3a-2eecf7f6ee82 sr-uuid=指定存放位置 xe sr-list獲取sr-uuid
restart xapi service[編輯]
xapi啓動不起來
1、磁盤空間滿了;清除/var/log下以gz結尾的文件,/etc/init.d/xapi restart 啓動 2、使用命令,xe-toolstack-restart 來重啓xapi
remove master in pool[編輯]
xe pool-param-set name-label=”” uuid=<uuid of the pool>
add disk[編輯]
xe sr-create type=lvm content-type=user device-config:device=/dev/disk/by-id/edd-int13_dev81-part1 name-label="Local storage 2" raid存儲 -config:device=/dev/disk/by-id/後面跟的是剛纔記下的SCSI name-label="Local storage 2"是你需要創建的名字.可以任意更改 安裝系統時,如果選擇多個硬盤,會把多個硬盤空間合成一個空間。 xe sr-create host-uuid=29b8a9d6-0860-4e92-aebc-f71d81343471 content-type=user name-label="Local storage 1" dice-config:device=/dev/disk/by-id/ata-ST500DM002-1BD142_S2AR4PSS-part3 type=ext 系統盤剩餘空間/dev/sda3
del SR[編輯]
1.查找要刪除的SR的UUID xe sr-list
2.通過SR的uuid,查找物理存儲塊PBD的UUID xe pbd-list sr-uuid=""
3.斷開PBD連接 xe pbd-unplug uuid=""
4.最後刪除SR記錄 xe sr-forget uuid=""
host update[編輯]
上傳補丁
xe patch-upload file-name=<updatefilepath>XS55EU2012.xsupdate 生成一個uuid,下一步中使用
pool中執行補丁
xe patch-pool-apply uuid=d632016d-352d-4fd9-8829-5a74ef0625db
查看已安裝補丁
xe patch-list name-label=XS55EU2012
Change Physical Machine memory[編輯]
/opt/xensource/libexec/xen-cmdline --set-xen dom0_mem=8192M,max:8192M 內存設置爲8G
Change Pool Master[編輯]
xe pool-designate-new-master host-uuid=<uuid>
xenserver設置虛擬機啓動[編輯]
當物理機啓動時,虛擬機也自動啓動。先設置pool,再設置vm。
xe pool-param-set uuid=<Pool_UUID> other-config:auto_poweron=true xe vm-param-set uuid=2b3cf25a-4b18-a2e9-9b8c-55e68a20e8b6 other-config:auto_poweron=true
PXE installation[編輯]
1.From the XenServer installation media, copy the files install.img (from the root directory), vmlinuz
and xen.gz (from the /boot directory) to the new /tftpboot/xenserver directory on the TFTP server and copy the mboot.c32 to /tftpboot/ directory
2. edit default from /tftpboot/pxelinux.cfg/ directory i.e. :
label xenserver kernel mboot.c32 append /tftpboot/xenserver/xen.gz dom0_max_vcpus=1-2 dom0_mem=1024M,max:1024M com1=115200,8n1 console=com1,vga --- /tftpboot/xenserver/vmlinuz \ xencons=hvc console=hvc0 console=tty0 \ --- /tftpboot/xenserver/install.img