Chinaunix首页 | 论坛 | 博客
  • 博客访问: 101556
  • 博文数量: 14
  • 博客积分: 85
  • 博客等级: 民兵
  • 技术积分: 273
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-30 22:55
文章分类
文章存档

2013年(13)

2012年(1)

我的朋友

分类: LINUX

2013-03-04 16:26:57



今天想到了想将虚拟机从 workstation A 复制到workstation B, 于是尝试写了一下脚本:

#!/bin/bash

echo "this script will clone XP-VM,press Enter key continue or Ctrl+c quit."
read null
read -p "input a remote machine ip address": IP
read -p "input the local machine ip address": LOCALIP
read -p "input the storage file of VM": RVM
read -p "input the XP-VM name": XPVM
scp -p ${IP}:/etc/libvirt/qemu/${XPVM}  ${LOCALIP}:/etc/libvirt/qemu/ && scp -p ${IP}:/var/lib/libvirt/images/${RVM} ${LOCALIP}:/var/lib/libvirt/images/
virsh define /etc/libvirt/qemu/${XPVM}



因为KVM上面的虚拟机有两部分组成,一部分是configuration 设置文件, 一般的文件名为  xxxx.xml

第二部分就是storage文件,一般是用xxx.raw


所以我小试牛刀,写了这么一个简单的脚本,希望有什么意见都给我说说。谢谢


=======================我是分割线了啦=========================

2.

关于KVM的技术贴

Mark一个回家看看   http://www.cnblogs.com/BloodAndBone/archive/2010/11/11/1874603.html















============to be continue===========================


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