免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3033 | 回复: 0
打印 上一主题 下一主题

Xen server 5.5日常工作备忘---NFS的使用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-28 14:19 |只看该作者 |倒序浏览
Xen server 5.5日常工作备忘---NFS的使用
        by Wang Xiantong,xiantong@gmail.com
date:2009.12.24
1、安装配置NFS服务器
#apt-get install nfs-kernel-server nfs-common portmap
#lvcreate -L90G -n xenstorage vg1
#mkfs.ext3 /dev/vg1/xenstorage
#mkdir -m 1777 /xenstorage
#mount /dev/vg1/xenstorage /xenstorage
#mkdir -m 1777 /nfs4
#mkdir -m 1777 /nfs4/xenstorage
#mount --bind /xenstorage /nfs4/xenstorage
#vi /etc/fstab
# /etc/fstab: static file system information.
#
#               
proc            /proc           proc    defaults        0       0
/dev/mapper/vg1-root /               ext3    errors=remount-ro 0       1
/dev/mapper/vg1-xenstorage /xenstorage  ext3    defaults        0       1
/dev/md0        /boot           ext3    defaults        0       2
/dev/mapper/vg1-swap none            swap    sw              0       0
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
/xenstorage     /nfs4/xenstorage        none    rw,bind         0       0
#vi /etc/exports
/nfs4/xenstorage 192.168.0.0/24(rw,sync,insecure,root_squash,no_subtree_check,fsid=0)
/nfs4/xenstorage 192.168.1.0/24(rw,sync,insecure,root_squash,no_subtree_check,fsid=0)
#exportfs -rv
2、把xen从本地LVM复制到NFS上
# xe host-list
uuid ( RO)                : 3747e8a7-fdb7-45dd-806f-dfd25bc47fca
          name-label ( RW): xbox4
    name-description ( RO): Default install of XenServer
# xe sr-create host-uuid=3747e8a7-fdb7-45dd-806f-dfd25bc47fca content-type=user name-label="IBMx346NFS" shared=true device-config:server=192.168.1.7 device-config:serverpath=/nfs4/xenstorage type=nfs
# xe vm-list
uuid ( RO)           : f7a9fa99-ee30-ce98-f886-096682a478d0
     name-label ( RW): erpserver
    power-state ( RO): running
uuid ( RO)           : b07a1098-b401-44d1-8dbc-301c30ea3493
     name-label ( RW): Control domain on host: xbox4
    power-state ( RO): running
# xe sr-list
uuid ( RO)                : 4e9f5231-36a2-6445-30c9-a7cc9b7fbeb7
          name-label ( RW): Local storage
    name-description ( RW):
                host ( RO): xbox4
                type ( RO): lvm
        content-type ( RO): user
uuid ( RO)                : 6e2b8877-3838-0501-599d-c5b63e156604
          name-label ( RW): Removable storage
    name-description ( RW):
                host ( RO): xbox4
                type ( RO): udev
        content-type ( RO): disk
uuid ( RO)                : 53b68821-1dbd-7857-03a8-a289016e6678
          name-label ( RW): DVD drives
    name-description ( RW): Physical DVD drives
                host ( RO): xbox4
                type ( RO): udev
        content-type ( RO): iso
uuid ( RO)                : 5c4e0707-6821-9901-07c6-c58f0634131b
          name-label ( RW): CIFS ISO library
    name-description ( RW): CIFS ISO Library [\192.168.1.101wxtiso]
                host ( RO): xbox4
                type ( RO): iso
        content-type ( RO): iso
uuid ( RO)                : 335ccca2-6ba2-b5a1-66a1-c848cdab8f0e
          name-label ( RW): XenServer Tools
    name-description ( RW): XenServer Tools ISOs
                host ( RO): xbox4
                type ( RO): iso
        content-type ( RO): iso
uuid ( RO)                : b4cf6bd5-68a2-ed45-d3df-1a8c531fed54
          name-label ( RW): IBMx346NFS
    name-description ( RW):
                host ( RO): xbox4
                type ( RO): nfs
        content-type ( RO): user
#nohup xe vm-copy new-name-label="erpserverback" sr-uuid=b4cf6bd5-68a2-ed45-d3df-1a8c531fed54 vm=erpserver &
完成这后注意修改新虚拟机的mac地址和原来的一样,就可以启动这个新机器了。
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12199/showart_2132931.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP