diff --git a/Vagrantfile b/Vagrantfile index 5e3b37440..33f7d5798 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,6 +2,7 @@ # vi: set ft=ruby : require 'yaml' +require 'time' VAGRANTFILE_API_VERSION = '2' DEBUG = false @@ -31,6 +32,8 @@ USER = settings['ssh_username'] ASSIGN_STATIC_IP = !(BOX == 'openstack' or BOX == 'linode') DISABLE_SYNCED_FOLDER = settings.fetch('vagrant_disable_synced_folder', false) +DISK_UUID = Time.now.utc.to_i + ansible_provision = proc do |ansible| if DOCKER then @@ -180,7 +183,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}client#{i}" do |client| client.vm.hostname = "#{LABEL_PREFIX}ceph-client#{i}" if ASSIGN_STATIC_IP - client.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.4#{i}" + client.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.4#{i}" end # Virtualbox client.vm.provider :virtualbox do |vb| @@ -214,7 +218,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}rgw#{i}" do |rgw| rgw.vm.hostname = "#{LABEL_PREFIX}ceph-rgw#{i}" if ASSIGN_STATIC_IP - rgw.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.5#{i}" + rgw.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.5#{i}" end # Virtualbox @@ -249,7 +254,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "nfs#{i}" do |nfs| nfs.vm.hostname = "ceph-nfs#{i}" if ASSIGN_STATIC_IP - nfs.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.6#{i}" + nfs.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.6#{i}" end # Virtualbox @@ -284,7 +290,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}mds#{i}" do |mds| mds.vm.hostname = "#{LABEL_PREFIX}ceph-mds#{i}" if ASSIGN_STATIC_IP - mds.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.7#{i}" + mds.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.7#{i}" end # Virtualbox mds.vm.provider :virtualbox do |vb| @@ -317,7 +324,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}rbd_mirror#{i}" do |rbd_mirror| rbd_mirror.vm.hostname = "#{LABEL_PREFIX}ceph-rbd-mirror#{i}" if ASSIGN_STATIC_IP - rbd_mirror.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.8#{i}" + rbd_mirror.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.8#{i}" end # Virtualbox rbd_mirror.vm.provider :virtualbox do |vb| @@ -350,7 +358,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}iscsi_gw#{i}" do |iscsi_gw| iscsi_gw.vm.hostname = "#{LABEL_PREFIX}ceph-iscsi-gw#{i}" if ASSIGN_STATIC_IP - iscsi_gw.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.9#{i}" + iscsi_gw.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.9#{i}" end # Virtualbox iscsi_gw.vm.provider :virtualbox do |vb| @@ -383,7 +392,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}mon#{i}" do |mon| mon.vm.hostname = "#{LABEL_PREFIX}ceph-mon#{i}" if ASSIGN_STATIC_IP - mon.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.1#{i}" + mon.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.1#{i}" end # Virtualbox mon.vm.provider :virtualbox do |vb| @@ -417,8 +427,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "#{LABEL_PREFIX}osd#{i}" do |osd| osd.vm.hostname = "#{LABEL_PREFIX}ceph-osd#{i}" if ASSIGN_STATIC_IP - osd.vm.network :private_network, ip: "#{PUBLIC_SUBNET}.10#{i}" - osd.vm.network :private_network, ip: "#{CLUSTER_SUBNET}.20#{i}" + osd.vm.network :private_network, + ip: "#{PUBLIC_SUBNET}.10#{i}" + osd.vm.network :private_network, + ip: "#{CLUSTER_SUBNET}.20#{i}" end # Virtualbox osd.vm.provider :virtualbox do |vb| @@ -456,7 +468,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # always make /dev/sd{a/b/c} so that CI can ensure that # virtualbox and libvirt will have the same devices to use for OSDs (0..2).each do |d| - lv.storage :file, :device => "hd#{driverletters[d]}", :path => "disk-#{i}-#{d}.disk", :size => '12G', :bus => "ide" + lv.storage :file, :device => "hd#{driverletters[d]}", :path => "disk-#{i}-#{d}-#{DISK_UUID}.disk", :size => '12G', :bus => "ide" end lv.memory = MEMORY lv.random_hostname = true diff --git a/tests/functional/centos/7/mon-osd-mds-rgw/group_vars/all b/tests/functional/centos/7/mon-osd-mds-rgw/group_vars/all index 829d6b24f..73e37fe92 100644 --- a/tests/functional/centos/7/mon-osd-mds-rgw/group_vars/all +++ b/tests/functional/centos/7/mon-osd-mds-rgw/group_vars/all @@ -1,8 +1,8 @@ --- ceph_stable: True -public_network: "192.168.42.0/24" -cluster_network: "192.168.43.0/24" +public_network: "192.168.1.0/24" +cluster_network: "192.168.2.0/24" journal_size: 100 devices: - '/dev/sda' diff --git a/tests/functional/centos/7/mon-osd-mds-rgw/vagrant_variables.yml b/tests/functional/centos/7/mon-osd-mds-rgw/vagrant_variables.yml index 27249da2c..ac76f1d89 100644 --- a/tests/functional/centos/7/mon-osd-mds-rgw/vagrant_variables.yml +++ b/tests/functional/centos/7/mon-osd-mds-rgw/vagrant_variables.yml @@ -21,8 +21,8 @@ restapi: true ceph_install_source: stable # SUBNETS TO USE FOR THE VMS -public_subnet: 192.168.42 -cluster_subnet: 192.168.43 +public_subnet: 192.168.1 +cluster_subnet: 192.168.2 # MEMORY # set 1024 for CentOS diff --git a/tests/functional/centos/7/mon-osd/group_vars/all b/tests/functional/centos/7/mon-osd/group_vars/all index 04b135991..335f89670 100644 --- a/tests/functional/centos/7/mon-osd/group_vars/all +++ b/tests/functional/centos/7/mon-osd/group_vars/all @@ -1,8 +1,8 @@ --- ceph_stable: True -public_network: "192.168.42.0/24" -cluster_network: "192.168.43.0/24" +public_network: "192.168.3.0/24" +cluster_network: "192.168.4.0/24" journal_size: 100 devices: - '/dev/sda' diff --git a/tests/functional/centos/7/mon-osd/vagrant_variables.yml b/tests/functional/centos/7/mon-osd/vagrant_variables.yml index 37b06c609..ed27f6b2e 100644 --- a/tests/functional/centos/7/mon-osd/vagrant_variables.yml +++ b/tests/functional/centos/7/mon-osd/vagrant_variables.yml @@ -21,8 +21,8 @@ restapi: true ceph_install_source: stable # SUBNETS TO USE FOR THE VMS -public_subnet: 192.168.42 -cluster_subnet: 192.168.43 +public_subnet: 192.168.3 +cluster_subnet: 192.168.4 # MEMORY # set 1024 for CentOS diff --git a/tests/functional/tests/mon/test_ceph_conf.py b/tests/functional/tests/mon/test_ceph_conf.py index 6b0121c55..59b899bbd 100644 --- a/tests/functional/tests/mon/test_ceph_conf.py +++ b/tests/functional/tests/mon/test_ceph_conf.py @@ -36,4 +36,4 @@ class TestMon(object): cluster_name = scenario_config.get('ceph', {}).get('cluster_name', 'ceph') ceph_conf_path = '/etc/ceph/%s.conf' % cluster_name initial_members_line = self.get_line_from_config('mon host', ceph_conf_path) - assert initial_members_line == 'mon host = 192.168.42.10,192.168.42.11,192.168.42.12' + assert initial_members_line == 'mon host = 192.168.9.10,192.168.9.11,192.168.9.12' diff --git a/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/group_vars/all b/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/group_vars/all index 4e410c37c..da89c8993 100644 --- a/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/group_vars/all +++ b/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/group_vars/all @@ -1,8 +1,8 @@ --- ceph_stable: True -public_network: "192.168.42.0/24" -cluster_network: "192.168.43.0/24" +public_network: "192.168.5.0/24" +cluster_network: "192.168.6.0/24" journal_size: 100 devices: - '/dev/sdb' diff --git a/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/vagrant_variables.yml b/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/vagrant_variables.yml index 2d6ec1039..15e4c038f 100644 --- a/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/vagrant_variables.yml +++ b/tests/functional/ubuntu/16.04/mon-osd-mds-rgw/vagrant_variables.yml @@ -21,8 +21,8 @@ restapi: true ceph_install_source: stable # SUBNETS TO USE FOR THE VMS -public_subnet: 192.168.42 -cluster_subnet: 192.168.43 +public_subnet: 192.168.5 +cluster_subnet: 192.168.6 # MEMORY # set 1024 for CentOS diff --git a/tests/functional/ubuntu/16.04/mon-osd/group_vars/all b/tests/functional/ubuntu/16.04/mon-osd/group_vars/all index b7b27a24c..64626c5bb 100644 --- a/tests/functional/ubuntu/16.04/mon-osd/group_vars/all +++ b/tests/functional/ubuntu/16.04/mon-osd/group_vars/all @@ -1,8 +1,8 @@ --- ceph_stable: True -public_network: "192.168.42.0/24" -cluster_network: "192.168.43.0/24" +public_network: "192.168.7.0/24" +cluster_network: "192.168.8.0/24" journal_size: 100 devices: - '/dev/sdb' diff --git a/tests/functional/ubuntu/16.04/mon-osd/vagrant_variables.yml b/tests/functional/ubuntu/16.04/mon-osd/vagrant_variables.yml index 75870de85..84363f453 100644 --- a/tests/functional/ubuntu/16.04/mon-osd/vagrant_variables.yml +++ b/tests/functional/ubuntu/16.04/mon-osd/vagrant_variables.yml @@ -21,8 +21,8 @@ restapi: true ceph_install_source: stable # SUBNETS TO USE FOR THE VMS -public_subnet: 192.168.42 -cluster_subnet: 192.168.43 +public_subnet: 192.168.7 +cluster_subnet: 192.168.8 # MEMORY # set 1024 for CentOS diff --git a/tests/functional/ubuntu/16.04/mon/group_vars/all b/tests/functional/ubuntu/16.04/mon/group_vars/all index 4e410c37c..a45a73af8 100644 --- a/tests/functional/ubuntu/16.04/mon/group_vars/all +++ b/tests/functional/ubuntu/16.04/mon/group_vars/all @@ -1,8 +1,8 @@ --- ceph_stable: True -public_network: "192.168.42.0/24" -cluster_network: "192.168.43.0/24" +public_network: "192.168.9.0/24" +cluster_network: "192.168.10.0/24" journal_size: 100 devices: - '/dev/sdb' diff --git a/tests/functional/ubuntu/16.04/mon/hosts b/tests/functional/ubuntu/16.04/mon/hosts index 9dfcc8b99..b988ffef6 100644 --- a/tests/functional/ubuntu/16.04/mon/hosts +++ b/tests/functional/ubuntu/16.04/mon/hosts @@ -1,4 +1,4 @@ [mons] -mon0 monitor_address=192.168.42.10 -mon1 monitor_address=192.168.42.11 +mon0 monitor_address=192.168.9.10 +mon1 monitor_address=192.168.9.11 mon2 monitor_interface=eth1 diff --git a/tests/functional/ubuntu/16.04/mon/vagrant_variables.yml b/tests/functional/ubuntu/16.04/mon/vagrant_variables.yml index 8d3fb6e7d..dea17e161 100644 --- a/tests/functional/ubuntu/16.04/mon/vagrant_variables.yml +++ b/tests/functional/ubuntu/16.04/mon/vagrant_variables.yml @@ -21,8 +21,8 @@ restapi: true ceph_install_source: stable # SUBNETS TO USE FOR THE VMS -public_subnet: 192.168.42 -cluster_subnet: 192.168.43 +public_subnet: 192.168.9 +cluster_subnet: 192.168.10 # MEMORY # set 1024 for CentOS diff --git a/tox.ini b/tox.ini index 448c98149..64f98be88 100644 --- a/tox.ini +++ b/tox.ini @@ -30,7 +30,7 @@ commands= vagrant up --no-provision {posargs:--provider=virtualbox} bash {toxinidir}/tests/scripts/generate_ssh_config.sh {changedir} - timeout 1200 ansible-playbook -vv -i {changedir}/hosts {toxinidir}/site.yml.sample + ansible-playbook -vv -i {changedir}/hosts {toxinidir}/site.yml.sample --extra-vars="fetch_directory={changedir}/fetch" py.test -v vagrant destroy --force