示例#1
0
    def test_create_vps0(self):
        print "create vps00"
        logger = Log("test", config=conf)
        vpsops = VPSOps(logger)
        vps = XenVPS(0)
        try:
            vps.setup(os_id=10004,
                      vcpu=1,
                      mem_m=512,
                      disk_g=7,
                      root_pw="fdfdfdsss",
                      gateway="113.11.199.1")
            vps.add_netinf_ext({"113.11.199.18": "255.255.255.0"})
            vps.add_netinf_int({"10.10.2.20": '255.255.255.0'})
            #vps.add_extra_storage (disk_id=1, size_g=1, fs_type='ext3')
            #vps.add_extra_storage (disk_id=2, size_g=0.5, fs_type='ext4')
            #vps.setup (os_id=10001, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=10002, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=30001, vcpu=1, mem_m=512, disk_g=7, root_pw="root")
            #vps.setup (os_id=1, vcpu=1, mem_m=512, disk_g=7,  root_pw="fdfdfd")
            #vps.setup (os_id=10000, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=20001, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=10003, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=20001, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")

            print vps.gen_xenpv_config()
            #vpsops.create_vps (vps, vps_image='/data/vps/images/arch-2011.08.19-i386-fs-ext3.tar.gz')
            vpsops.create_vps(vps)
        except Exception, e:
            print str(e)
            logger.exception(e)
            raise e
示例#2
0
    def test_create_vps0 (self):
        print "create vps00"
        logger = Log ("test", config=conf)
        vpsops = VPSOps (logger)
        vps = XenVPS (0)
        try:
            vps.setup (os_id=10004, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfdsss", gateway="113.11.199.1")
            vps.add_netinf_ext ({"113.11.199.18": "255.255.255.0"})
            vps.add_netinf_int ({"10.10.2.20": '255.255.255.0'})
            #vps.add_extra_storage (disk_id=1, size_g=1, fs_type='ext3')
            #vps.add_extra_storage (disk_id=2, size_g=0.5, fs_type='ext4')
            #vps.setup (os_id=10001, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=10002, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=30001, vcpu=1, mem_m=512, disk_g=7, root_pw="root")
            #vps.setup (os_id=1, vcpu=1, mem_m=512, disk_g=7,  root_pw="fdfdfd")
            #vps.setup (os_id=10000, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=20001, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=10003, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")
            #vps.setup (os_id=20001, vcpu=1, mem_m=512, disk_g=7, root_pw="fdfdfd")

            print vps.gen_xenpv_config ()
            #vpsops.create_vps (vps, vps_image='/data/vps/images/arch-2011.08.19-i386-fs-ext3.tar.gz')
            vpsops.create_vps (vps)
        except Exception, e:
            print str(e)
            logger.exception (e)
            raise e