CentOS 5
Sponsored Link

Operations
[1] It's possible to move from GuestOS to HostOS with 'Ctrl' and ']' key. In case of moving HostOS to GuestOS, Input command 'xm console (ID or name of guestOS).
[root@www ~]#
# on GuestOS

[root@www ~]# [root ~]#
# Ctrl + ] key

[root@ns ~]#
xm list
# show status

Name
ID
Mem(MiB)
VCPUs
State
Time(s)

Domain-0
0
512
2
r-----
35.1

www
1
512
2
-b----
24.8


[root@ns ~]#
xm console www
# move to GuestOS

 
# push Enter key

[root@www ~]#
# just moved

[root@www ~]#
xm console 0
# move to HostOS

 
# push Enter key

[root@ns ~]#
# just moved

Others
[2] There are many commands for operation Xen. Try to execute them.
[root@ns ~]#
xm help

Usage: xm <subcommand> [args]

Control, list, and manipulate Xen guest instances.

xm full list of subcommands:

  console
Attach to <Domain>'s console.

  create
Create a domain based on <ConfigFile>.

  destroy
Terminate a domain immediately.

  domid
Convert a domain name to domain id.

  domname
Convert a domain id to domain name.

  dump-core
Dump core for a specific domain.

  list
List information about all/some domains.

  mem-max
Set the maximum amount reservation for a domain.

  mem-set
Set the current memory usage for a domain.

  migrate
Migrate a domain to another machine.

  pause
Pause execution of a domain.

  reboot
Reboot a domain.

  rename
Rename a domain.

  restore
Restore a domain from a saved state.

  save
Save a domain state to restore later.

  shutdown
Shutdown a domain.

  sysrq
Send a sysrq to a domain.

  top
Monitor a host and the domains in real time.

  unpause
Unpause a paused domain.

  uptime
Print uptime for a domain.

  vcpu-list
List the VCPUs for a domain or all domains.

  vcpu-pin
Set which CPUs a VCPU can use.

  vcpu-set
Set the number of active VCPUs for allowed for the domain.

  dmesg
Read and/or clear Xend's message buffer.

  info
Get information about Xen host.

  log
Print Xend log

  serve
Proxy Xend XMLRPC over stdio.

  sched-credit
Get/set credit scheduler parameters.

  sched-sedf
Get/set EDF parameters.

  block-attach
Create a new virtual block device.

  block-detach
Destroy a domain's virtual block device.

  block-list
List virtual block devices for a domain.

  block-configure
Change block device configuration

  network-attach
Create a new virtual network device.

  network-detach
Destroy a domain's virtual network device.

  network-list
List virtual network interfaces for a domain.

  vtpm-list
List virtual TPM devices.

  vnet-list
List Vnets.

  vnet-create
Create a vnet from ConfigFile.

  vnet-delete
Delete a Vnet.

  labels
List <type> labels for (active) policy.

  addlabel
Add security label to domain.

  rmlabel
Remove a security label from domain.

  getlabel
Show security label for domain or resource.

  dry-run
Test if a domain can access its resources.

  resources
Show info for each labeled resource.

  makepolicy
Build policy and create .bin/.map files.

  loadpolicy
Load binary policy into hypervisor.

  cfgbootpolicy
Add policy to boot configuration.

  dumppolicy
Print hypervisor ACM state information.


<Domain> can either be the Domain Name or Id.
For more help on 'xm' see the xm(1) man page.
For more help on 'xm create' see the xmdomain.cfg(5) man page.

[root@ns ~]#
xm list

Name
ID
Mem(MiB)
VCPUs
State
Time(s)

Domain-0
0
512
2
r-----
35.1

www
1
512
2
-b----
24.8


[root@ns ~]#
xm rename 0 Host
# change Host's name

[root@ns ~]#
xm list

Name
ID
Mem(MiB)
VCPUs
State
Time(s)

Host
0
512
2
r-----
35.1

www
1
512
2
-b----
24.8


[root@ns ~]#
xm vcpu-set 0 1
# change Host's CPUs

[root@ns ~]#
xm list

Name
ID
Mem(MiB)
VCPUs
State
Time(s)

Host
0
512
1
r-----
35.1

www
1
512
2
-b----
24.8


[root@ns ~]#
xm reboot www
# restart www


[root@ns ~]#
xm shutdown www
# shutdown www

[root@ns ~]#
xm list

Name
ID
Mem(MiB)
VCPUs
State
Time(s)

Host
0
512
1
r-----
35.1

Matched Content