Пример #1
0
 def test_create_node3(self):
     environment = Environment.create('test_env3')
     internal = Network.network_create(environment=environment,
                                       name='internal',
                                       pool=None)
     external = Network.network_create(environment=environment,
                                       name='external',
                                       pool=None)
     private = Network.network_create(environment=environment,
                                      name='private',
                                      pool=None)
     node = Node.node_create(name='test_node', environment=environment)
     Interface.interface_create(node=node, network=internal)
     Interface.interface_create(node=node, network=external)
     Interface.interface_create(node=node, network=private)
     volume = Volume.volume_get_predefined(
         '/var/lib/libvirt/images/disk-135824657433.qcow2')
     v3 = Volume.volume_create_child('test_vp892',
                                     backing_store=volume,
                                     environment=environment)
     v4 = Volume.volume_create_child('test_vp891',
                                     backing_store=volume,
                                     environment=environment)
     DiskDevice.node_attach_volume(node=node, volume=v3)
     DiskDevice.node_attach_volume(node, v4)
     environment.define()
Пример #2
0
def one():
    environment = Environment.create('cdrom')
    internal_pool = Network.create_network_pool(
        networks=[IPNetwork('10.108.0.0/16')], prefix=24)
    private_pool = Network.create_network_pool(
        networks=[IPNetwork('10.108.0.0/16')], prefix=24)
    external_pool = Network.create_network_pool(
        networks=[IPNetwork('172.18.95.0/24')], prefix=27)
    internal = Network.network_create(environment=environment,
                                      name='internal',
                                      pool=internal_pool)
    external = Network.network_create(environment=environment,
                                      name='external',
                                      pool=external_pool,
                                      forward='nat')
    private = Network.network_create(environment=environment,
                                     name='private',
                                     pool=private_pool)
    for i in range(1, 2):
        node = Node.node_create(name='test_node' + str(i),
                                environment=environment)
        Interface.interface_create(node=node, network=internal)
        Interface.interface_create(node=node, network=external)
        Interface.interface_create(node=node, network=private)
        volume = Volume.volume_get_predefined(
            '/var/lib/libvirt/images/centos63-cobbler-base.qcow2')
        v3 = Volume.volume_create_child('test_vp895' + str(i),
                                        backing_store=volume,
                                        environment=environment)
        v4 = Volume.volume_create_child('test_vp896' + str(i),
                                        backing_store=volume,
                                        environment=environment)
        DiskDevice.node_attach_volume(node=node, volume=v3)
        DiskDevice.node_attach_volume(node, v4)
        DiskDevice.node_attach_volume(
            node,
            Volume.volume_get_predefined(
                '/var/lib/libvirt/images/fuel-centos-6.3-x86_64.iso'),
            device='cdrom',
            bus='sata')
    environment.define()
    environment.start()
    remotes = []
    for node in environment.get_nodes():
        node. await ('internal')
        node.remote('internal', 'root', 'r00tme').check_stderr('ls -la',
                                                               verbose=True)
        remotes.append(node.remote('internal', 'root', 'r00tme'))
    SSHClient.execute_together(remotes, 'ls -la')
Пример #3
0
def one():
    environment = Environment.create('cdrom')
    internal_pool = Network.create_network_pool(
        networks=[IPNetwork('10.108.0.0/16')], prefix=24
    )
    private_pool = Network.create_network_pool(
        networks=[IPNetwork('10.108.0.0/16')], prefix=24
    )
    external_pool = Network.create_network_pool(
        networks=[IPNetwork('172.18.95.0/24')], prefix=27
    )
    internal = Network.network_create(
        environment=environment, name='internal', pool=internal_pool)
    external = Network.network_create(
        environment=environment, name='external', pool=external_pool,
        forward='nat')
    private = Network.network_create(
        environment=environment, name='private', pool=private_pool)
    for i in range(1, 2):
        node = Node.node_create(
            name='test_node' + str(i), environment=environment)
        Interface.interface_create(node=node, network=internal)
        Interface.interface_create(node=node, network=external)
        Interface.interface_create(node=node, network=private)
        volume = Volume.volume_get_predefined(
            '/var/lib/libvirt/images/centos63-cobbler-base.qcow2')
        v3 = Volume.volume_create_child(
            'test_vp895' + str(i), backing_store=volume,
            environment=environment)
        v4 = Volume.volume_create_child(
            'test_vp896' + str(i), backing_store=volume,
            environment=environment)
        DiskDevice.node_attach_volume(node=node, volume=v3)
        DiskDevice.node_attach_volume(node, v4)
        DiskDevice.node_attach_volume(
            node,
            Volume.volume_get_predefined(
                '/var/lib/libvirt/images/fuel-centos-6.3-x86_64.iso'),
            device='cdrom', bus='sata')
    environment.define()
    environment.start()
    remotes = []
    for node in environment.get_nodes():
        node.await('internal')
        node.remote('internal', 'root', 'r00tme').check_stderr(
            'ls -la', verbose=True)
        remotes.append(node.remote('internal', 'root', 'r00tme'))
    SSHClient.execute_together(remotes, 'ls -la')
Пример #4
0
 def test_create_volume(self):
     environment = Environment.create('test_env3')
     volume = Volume.volume_get_predefined(
         '/var/lib/libvirt/images/disk-135824657433.qcow2')
     v3 = Volume.volume_create_child(
         'test_vp89', backing_store=volume, environment=environment)
     v3.define()
Пример #5
0
 def test_create_volume(self):
     environment = Environment.create('test_env3')
     volume = Volume.volume_get_predefined(
         '/var/lib/libvirt/images/disk-135824657433.qcow2')
     v3 = Volume.volume_create_child(
         'test_vp89', backing_store=volume, environment=environment)
     v3.define()
Пример #6
0
 def test_create_node3(self):
     environment = Environment.create('test_env3')
     internal = Network.network_create(
         environment=environment, name='internal', pool=None)
     external = Network.network_create(
         environment=environment, name='external', pool=None)
     private = Network.network_create(
         environment=environment, name='private', pool=None)
     node = Node.node_create(name='test_node', environment=environment)
     Interface.interface_create(node=node, network=internal)
     Interface.interface_create(node=node, network=external)
     Interface.interface_create(node=node, network=private)
     volume = Volume.volume_get_predefined(
         '/var/lib/libvirt/images/disk-135824657433.qcow2')
     v3 = Volume.volume_create_child(
         'test_vp892', backing_store=volume, environment=environment)
     v4 = Volume.volume_create_child(
         'test_vp891', backing_store=volume, environment=environment)
     DiskDevice.node_attach_volume(node=node, volume=v3)
     DiskDevice.node_attach_volume(node, v4)
     environment.define()