从客户端中分离设备,使用同样的 XML 描述作为命令attach-device。
detach-disk
从客户端中分离磁盘设备。
detach-interface
从客户端中分离网络接口。
表 15.2. 资源管理选项
这些是其它
virsh 选项:
命令
Description
version
显示 virsh 版本
nodeinfo
有关管理程序的输出信息
表 15.3. 其它选项
连接至管理程序
使用
virsh 连接到管理程序会话:
# virsh connect {hostname OR URL}
Where
is the machine name of the hypervisor. To initiate a read-only connection, append the above command with
-readonly.
创建虚拟机 XML 转储(配置文件)
使用
virsh 输出客户端 XML 配置文件:
# virsh dumpxml {domain-id, domain-name or domain-uuid}
This command outputs the guest's XML configuration file to standard out (
stdout). You can save the data by piping the output to a file. An example of piping the output to a file called
guest.xml:
# virsh dumpxml GuestID > guest.xml
This file
guest.xml can recreate the guest (refer to 编辑客户端配置文件. You can edit this XML configuration file to configure additional devices or to deploy additional guests. Refer to 第 18.1 节 “使用带 virsh 的 XML 配置文件” for more information on modifying files created with
virsh dumpxml.
Guests can be created from XML configuration files. You can copy existing XML from previously created guests or use the
dumpxml option (refer to 创建虚拟机 XML 转储(配置文件)). To create a guest with
virsh from an XML file:
# virsh create configuration_file.xml
编辑客户端配置文件
Instead of using the
dumpxml option (refer to 创建虚拟机 XML 转储(配置文件)) guests can be edited either while they run or while they are offline. The
virsh edit command provides this functionality. For example, to edit the guest named
softwaretesting:
# virsh suspend {domain-id, domain-name or domain-uuid}
When a guest is in a suspended state, it consumes system RAM but not processor resources. Disk and network I/O does not occur while the guest is suspended. This operation is immediate and the guest can be restarted with the
resume ( 恢复客户端) option.
恢复客户端
使用
virsh 的
resume 选项恢复客户端:
# virsh resume {domain-id, domain-name or domain-uuid}
# virsh save {domain-name, domain-id or domain-uuid} filename
This stops the guest you specify and saves the data to a file, which may take some time given the amount of memory in use by your guest. You can restore the state of the guest with the
restore ( 恢复客户端) option. Save is similar to pause, instead of just pausing a guest the present state of the guest is saved.
恢复客户端
Restore a guest previously saved with the
virsh save command ( 保存客户端) using
virsh:
# virsh destroy {domain-id, domain-name or domain-uuid}
This command does an immediate ungraceful shutdown and stops the specified guest. Using
virsh destroy can corrupt guest file systems . Use the
destroy option only when the guest is unresponsive. For para-virtualized guests, use the
shutdown option( 关闭客户端) instead.
# virsh dominfo {domain-id, domain-name or domain-uuid}
以下是
virsh dominfo 命令的输出示例:
# virsh dominfo r5b2-mySQL01
id: 13
name: r5b2-mysql01
uuid: 4a4c59a7-ee3f-c781-96e4-288f2862f011
os type: linux
state: blocked
cpu(s): 1
cpu time: 11.0s
max memory: 512000 kb
used memory: 512000 kb
显示主机信息
要显示主机信息:
# virsh nodeinfo
virsh nodeinfo 命令输出示例:
# virsh nodeinfo
CPU model x86_64
CPU (s) 8
CPU frequency 2895 Mhz
CPU socket(s) 2
Core(s) per socket 2
Threads per core: 2
Numa cell(s) 1
Memory size: 1046528 kb
The
GuestName parameter represents the name of the guest which you want to migrate.
The
DestinationURL parameter is the URL or hostname of the destination system. The destination system must run the same version of Fedora, be using the same hypervisor and have
libvirt running.
Once the command is entered you will be prompted for the root password of the destination system.
1. If语句作为表达式
val properties = if (jobIdToActiveJob.contains(jobId)) {
jobIdToActiveJob(stage.jobId).properties
} else {
// this stage will be assigned to "default" po
基础测试题
卷面上不能出现任何的涂写文字,所有的答案要求写在答题纸上,考卷不得带走。
选择题
1、 What will happen when you attempt to compile and run the following code? (3)
public class Static {
static {
int x = 5; // 在static内有效
}
st
表里的一行对于一个数据块太大的情况有二种(一行在一个数据块里放不下)
第一种情况:
INSERT的时候,INSERT时候行的大小就超一个块的大小。Oracle把这行的数据存储在一连串的数据块里(Oracle Stores the data for the row in a chain of data blocks),这种情况称为行链接(Row Chain),一般不可避免(除非使用更大的数据
Follow up for "Remove Duplicates":What if duplicates are allowed at most twice?
For example,Given sorted array nums = [1,1,1,2,2,3],
Your function should return length