Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7404010
  • 博文数量: 1756
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16232
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1756)

文章存档

2024年(2)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2009-07-24 11:49:56

xen-cli说明
 
xen-cli是一个简单的xen的管理工具,能做到简单到boot、shutdown、rebuild等功能
安装方法:
hosts系统可以按照:
http://blog.chinaunix.net/u/249/showart_2005383.html
的方法来安装,是图型化的,应该非常简单!
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.cn
xen-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  //模版的名称


 
阅读(1049) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~