xen-cli说明
xen-cli是一个简单的xen的管理工具,能做到简单到boot、shutdown、rebuild等功能
安装方法:
wget
tar -zxvf xen-cli-0.0.1.tar.gz
cp xen-cli.sh /bin/
PS:如查没有执行权限的话,请用chmod 755 /bin/xen-cli.sh
修改/etc/sudoers文件,在后面加入如下命令
vi /etc/sudoers
User_Alias CLIUSERS = akin //用户名,用来登录的
Cmnd_Alias VIRSH = /usr/bin/virsh
Cmnd_Alias CLONE = /usr/bin/virt-clone
Cmnd_Alias RM = /bin/rm
CLIUSERS ALL = NOPASSWD: VIRSH,CLONE,RM
添加xen用户及修改shell
useradd akin
passwd akin
chsh -s /bin/xen-cli.sh akin
好了,现在就可以用akin来登录了,因为用户刚开的,所以先rebuild,建系统!
akin用户登录后:
---------------------------------------
xen-cli v0.0.1 Written by badb0y
Blog
http://badb0y.cublog.cnxen-cli v0.01 - type 'help' for help
---------------------------------------
xen-cli >help
xen-cli v0.01
boot - boot the xen guest.
console - Xen guest via the serial console.
exit - Exit the shell.
help - Show command.
quit - Exit the shell.
reboot - Reboot the xen guest.
shutdown - Shutdown the xen guest.
status - Show the status of xen guest.
version - Show the version of this shell.
chpw - Change CLI password.
rebuild - rebuild OS!
xen-cli >rebuild 重建系统
Rebulid is runing undergroud, please wit for a few minutes to be finish!
start clone files from template ......
files are cloned from the template.
Your new root password is aiying (这个为我系统模版的密码,可以在SHELL改)
Rebuild is finished!
xen-cli >boot
Domain akin started
更多功能,请关注以后的版本!
shell中要设置的地方:
#!/bin/bash
CLI=/usr/bin/virsh
CLONE=/usr/bin/virt-clone
//上两行不用设置,是命令的路径
XM=$USER //为当然登录的系统用户
XMPATH=/vm //img个的路径
TEMPLATE=template //模版的名称
阅读(1093) | 评论(0) | 转发(0) |