Ldom本身没有提供重命名的命令,所以要实现的话,就需要绕个路。思路就是按照原来ldm的配置,重新生成一个除了名字和uuid不一样,其他都一样的域。
1. 停止原有domain
-
bash-3.2# ldm list old_name
-
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
-
old_name active -t—- 5000 16 8G 6.2% 23h 17m
-
-
#ldm stop-domain old_name
-
LDom old_name stopped
-
-
bash-3.2# ldm list old_name
-
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
-
old_name bound —— 5000 16 8G
-
-
-
unbind 是域进入inactive
-
-
bash-3.2# ldm unbind old_name
-
bash-3.2# ldm list old_name
-
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
-
old_name inactive —— 16 8G
2. 保存并更改配置
-
bash-3.2# ldm list-constraints -x old_name > /var/tmp/old_name.xml
-
bash-3.2# cp -p /var/tmp/old_name.xml /var/tmp/new_name.xml
改动配置文件里面的一行
-
<Content xsi:type="ovf:VirtualSystem_Type" ovf:id="更改这个名字">
3. 删除旧域并添加新域
-
bash-3.2# ldm destroy old_name
-
-
bash-3.2# ldm add-domain -i /var/tmp/new_name.xml
-
-
bash-3.2# ldm list
-
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
-
primary active -n-cv- UART 8 1G 1.1% 1d 3h 24m
-
new_name inactive —— 16 8G
-
-
bash-3.2# ldm bind new_name
-
-
bash-3.2# ldm start new_name
-
LDom new_name started
-
bash-3.2# ldm list
-
NAME STATE FLAGS CONS VCPU MEMORY UTIL UPTIME
-
primary active -n-cv- UART 8 1G 4.8% 1d 3h 25m
-
new_name active -t—- 5000 16 8G 3.5% 2s
-
-
-
Verify connecting to new guest domain console:
如果添加新ldm之前不想删掉旧的domain,添加时候会报UUID冲突的错误,这时就需要把配置文件里面的uuid字段也改一下
阅读(2932) | 评论(0) | 转发(0) |