XM AddLabel label Dom ConfigFile [policy]
XM AddLabel Label RES resource [policy]
Added a security label called label, label name can be customized
XM Getlabel Dom ConfigFile
XM Getlabel Res Resource
Display standard from DOM configuration file or resource
XM labels [policy] [Type=dom|res|any]
Lists the policies defined in all types of labels, except for the special, default policy is the currently implemented access control policy. The default type is DOM, and these labels are arranged in alphabetical order.
XM Rmlabel Dom ConfigFile
XM Rmlabel Res Resource
Delete a tag from a DOM configuration file or res resource
XM Block-attach <Domain> be-dev fe-dev mode [Bedomain-id] Creates a new virtual block device.
Be-dev
The export of domain's back-end devices (typically domain 0). You can specify either a physical partition (PHY:SDA7) or a loopback (File://path/to/loop.iso) as a file.
Fe-dev
Name of the device in guest domain such as/DEV/HDC, 0x1400 (/DEV/HDC device hex ID
Mode
The way that guest domain accesses the device, with a supported mode of W (read/write) or R (read-only).
Bedomain-id
Domain back-end managed device, default is Domain0
For example
Mount an ISO as disk
XM Block-attach guestdomain file://path/to/dsl-2.0RC2.iso/dev/hdc ro
You can also modify the configuration file
disk=[' file:/var/cache/convirt/vm_disks/test.disk.xm,hda,w ', ' File://path/to/dsl-2.0RC2.iso,hdc,ro ']
XM Block-detach <Domain> devid Delete Domain's virtual block devices. Devid must be a device ID
XM Block-list <Domain> List all block devices used by a domain
XM create <ConfigFile> [options] [VARs]: Start an unmanaged virtual machine
The-c parameter is to import the kernel output to Virtual Console when booting
XM Console: Open the console to manage virtual machines
Configuration files (config file).
The Xen configuration file includes standard variables. The prefabricated content should be enclosed in (parentheses), see the example in the/etc/xen/directory.
Kernel specifying the path of the kernel
RAMDISK Specifies the image path of the RAMDisk (optional)
memory specifies the size, in units of M
VCPUS Specifies the number of CPUs that are virtual systems
console specifies the port of Domain (default is 9600+domain ID)
VIF Network port configuration. A predetermined port can be a null value, or specify more variable settings, such as
Vif = [' Mac=00:16:3e:00:00:11, Bridge=xen-br0 ', ' BRIDGE=XEN-BR1 ']
First set the domain's network card MAC address, then bridge the first network interface to a different network interface, let xend to select the MAC address. These settings include Type,mac,bridge,ip, Script,backend, and Vifname, among others;
Disk sets the hard drive used by domain, such as disk=[' phy:hda1,sda1,r ', which means that the hard disk used by domain is a physical partition/dev/hda1, which is then mapped to/DEV/SDA1 and is read-only. If you want to turn on read and write, change R to W, but this is a bit risky.
DHCP sets the way that domain obtains IP from a DHCP server
netmask Setting the network mask for domain
Gateway to set up domain
Hostname setting the hostname of a virtual machine
root specifies the hard disk partition where domain is located by root, where the hard disk to be imaged is specified;
NFS_SERVER Specifies the IP address of the NFS server
Nfs_root Specifying Server for NFS
The root file system provided
Extra
Additional fields have been written to the sample configuration file (for example, configuring the virtual TPM feature)
XM Debug-keys Keys
The command is sent to the hypervisor for debugging. Key is as follows:
% (ASCII) Trap to xendbg.
C (ASCII) Trigger a crash dump.
H (ASCII) Dump heap info.
N (ASCII 4e) NMI statistics.
O (ASCII 4f) Toggle shadow audits.
R (ASCII) Reboot machine.
S (ASCII) Reset Shadow page tables.
A (ASCII) Dump timer queues.
D (ASCII) Dump registers.
H (ASCII) Display list of debug keys.
I (ASCII) Dump interrupt bindings.
M (ASCII 6d) Memory info.
N (ASCII 6e) Trigger an NMI.
Q (ASCII) Dump domain (and guest debug) info.
R (ASCII) Dump run queues.
T (ASCII) Display multi-cpu clock Info.
U (ASCII) Dump non-uniform Memory Access (NUMA) info.
V (ASCII) Dump Intel ' s VMCS.
Z (ASCII 7a) Print ioapic info.
XM Destroy <domain>: Shut down the virtual machine like power off
XM DMESG [-c|--clear] Check Xen kernel buffering information
XM Dry-run ConfigFile
Test whether domain resources can be accessed
XM dumppolicy Print hypervisor ACM status information
XM Dump-core [-l|--live] [-c|--crash] [-r|--reset] <Domain>
[Filename]xm Dump-core is similar to a Linux system kdump or Windows
Kernel memory dump, which is the most important feature is to be able to crash the system dump is now
In-memory content and recorded as an archive
XM GetPolicy Get current system Policy
XM setpolicy <policytype> <policyfile> [options] set policy for the system
<policytype> Unique value ACM
<policyfile> policy filename + '-security_policy.xml ', the location of the file can be in the current directory or/etc/xen/acm-security/policies
The current policy for the XM Resetpolicy settings system is the default policy
XM Help: Overview of all available XM commands
XM Info Prints host information for the current Xen environment
XM list: Lists of all known virtual machines
Each field represents the following meaning:
Name of the virtual machine is the name of a descriptive type
Domid the domain ID of the running virtual machine, which is a numeric value
Memory size, in units of M
Vcpus Domain has the number of virtual CPUs, which is a numeric
State Domain status, there are five kinds of States;
R Running is running
B blocked Block
P Paused Pause
s shutdown off
C Crashed crashes
CPUTime CPU run time, unit is seconds
The XM list also supports long format output, with the-l option. The long format can output the running domain
XM Log Print Xen logs
XM migrate <Domain> [destination Domain] offline migration Guest OS
XM migrate <Domain> l [destination Domain] online migration guest OS
XM Mem-set <Domain> <Mem> Adjusts the size of the running virtual platform (Domain-0) and the amount of memory occupied by the virtual operating system, which can be dynamically modified if error occurs:
Memory_dynamic_max must is less than or equal to Memory_static_max
Describes the maximum limit beyond memory that can be used with XM Mem-max <DomId>/<Domname> <Mem>
XM Network-attach <Domain> [Script=scriptname] [ip=ipaddr] [mac=macaddr] [bridge=bridge-name] [backend= Bedomain-id]
Create a new network setting (Specify the device ID) in the specified domain
Script=scriptname
Using the name of the specified script, the default setting is Vif-script in Xend-config.sxp
Ip=ipaddr
Mac=macaddr
Bridge=bridge-name
Backend=bedomain-id
XM Network-detach <Domain> Devid
Removes the network device for the specified domain ID from domain. Devid is a virtual interface in domain device number
XM network-list <Domain> lists all the network interfaces used by a domain
XM new <domain>: Add virtual machine to xenbase Managed Environment
XM pause <domain>: Pause the activity of the virtual machine without releasing the memory resources used
XM Pci-attach <Domain> <PciDev> build a new PCI device
XM Pci-detach <Domain> <domain:bus:slot.func> remove a PCI device from Domain
XM pci-list <Domain> show PCI settings for Domain
XM reboot <domain>: Restart the virtual machine
XM Restore: Wake-up virtual operating system
XM Restore \path\file-p
XM Resources
Lists all the resources in the global resource standard file, listing the relevant tags and policy names in each resource
XM Save: Store the state of a running virtual operating system
XM save-c <Domain> \path\file
XM sched-credit-d Domain [-w weight|-ccap]
The parameters to the SCHED-CREDIT subcommand is as follows:
-C caps,--cap=cap
Set the maximum amount of CPU that a domain can consume, with a default of 0 (No limit). This value represents the percentage of the physical CPU, for example: set to 50 for half of the physical CPU upper limit
-d domain,--domain=domain set domain scheduling parameters
-W weight,--weight=weight sets the relative weighting of domain, valid range is 1-65536, default value is 256
XM SCHED-SEDF Setting EDF parameters
The parameters to the SCHED-SEDF subcommand is as follows:
Domain set Domain schedule parameters
Period EDF Normal dispatch, Unit nanosecond
Slice worst case Execution Time (MS).
Latency-hint Domain performs a large amount of I/O time-proportional cycles
Extratime flags that allow domain to run in overtime
Weight another way to set up CPU allocation
XM Scsi-attach <Domain> <PhysDevice> <VirtDevice> [Backdomain] Add a new SCSI device
XM Scsi-detach <Domain> <VirtDevice> Removal of a specified SCSI device
XM scsi-list <Domain> [--long] lists all currently connected SCSI devices.
XM suspend <Domain> suspend a domain
XM Resume <Domain> resume a pending domain
XM shutdown <domain>: Shut down the virtual machine normally
XM start <domain>: Starting a virtual machine from a xenbase managed environment
XM top <domain>: Provides an overview of the status of all virtual machines
XM Unpause <domain>: Activating a virtual machine paused using the XM Pause command
XM uptime <Domain> shows the uptime of all domains in your Xen environment
XM Usb-add <Domain> <[host:bus.addr] [host:vendor_id:product_id]> add a USB device to the FV VM
XM Usb-del <Domain> <[host:bus.addr] [host:vendor_id:product_id]> Remove the FV VM USB device
XM Vcpu-list lists CPU correspondence for all domains
XM Vcpu-pin <Domain> vcpus CPU fixed Vcpus to physical CPU
For example, XM Vcpu-pin domname all fixed vcpus to all physical CPUs
XM Vcpu-pin domname all 2,3,4,5 fixed Vcpus to 2-5 of physical CPUs
XM Vcpu-set <Domain> Vcpu-num Modifying the number of CPUs for a virtual machine
XM Vncviewer [--autopass/--vncviewer-autopass] <Domain> using VNC to connect guest OS
XM vnet-create <ConfigFile> Create a vnet from a configuration file
XM vnet-delete <VnetId> Delete a vnet
List of XM Vnet-list vnets
XM vtpm-list [-l|--long] <Domain> displays the device for the virtual TPM in Domain.
Create an image file;
DD If=/dev/zero of=fedora50.img bs=2k seek=2048k count=1
LS-LH fedora50.img
-rw-r--r--1 root root 4G Jan 5 16:05 fedora50.img
Format the image as a Linux file system
Mkfs.ext3 fedora50.img
Mount-o Loop fedora50.img/mnt
Df-lh
This article from "Nicol Lock Silk Sorrow" blog, please make sure to keep this source http://smoke520.blog.51cto.com/9256117/1835175
The XM command is detailed