Correct provisioning convertation

This commit is contained in:
Vladimir Kuklin 2013-08-02 00:54:57 +04:00 committed by Evgeniy L
parent 91412332e9
commit 8cb5dca300
2 changed files with 52 additions and 38 deletions

View File

@ -74,9 +74,9 @@ nodes.each do |node,macaddr|
system_disk=json_node['meta']['disks'].select {|disk| disk['name'] == 'vda'}.first
cinder_disk=json_node['meta']['disks'].select {|disk| disk['name'] == 'vdb'}.first
system_disk_path = system_disk['path']
system_disk_path = system_disk['disk']
system_disk_size = (system_disk['size']/1048756.0).floor
cinder_disk_path = cinder_disk['path']
cinder_disk_path = cinder_disk['disk']
cinder_disk_size = (cinder_disk['size']/1048756.0).floor
system_pv_size = system_disk_size - 201
@ -85,16 +85,30 @@ nodes.each do |node,macaddr|
free_extents = (free_vg_size/32.0).floor
system_disk_size = 32 * free_extents
ks_spaces = "\'[{\"type\": \"disk\", \"id\": \"#{system_disk_path}\",\"volumes\":
[{\"mount\": \"/boot\", \"type\": \"partition\", \"size\": 200}, {\"type\":
\"mbr\"}, {\"size\": #{system_pv_size}, \"type\": \"pv\", \"vg\": \"os\"}],\"size\":
#{system_disk_size} },{\"type\": \"vg\", \"id\": \"os\", \"volumes\": [{\"mount\":
\"/\", \"type\": \"lv\", \"name\": \"root\", \"size\": #{system_disk_size} }, {\"mount\":
\"swap\", \"type\": \"lv\", \"name\": \"swap\", \"size\": #{swap_size}}]}, {\"type\":
\"disk\", \"id\": \"#{cinder_disk_path}\", \"volumes\": [{\"type\": \"mbr\"},
{\"size\": #{cinder_disk_size}, \"type\": \"pv\", \"vg\": \"cinder-volumes\"}], \"size\":
#{cinder_disk_size}]\'"
# ks_spaces: '"[{\"type\": \"disk\", \"id\": \"disk/by-path/pci-0000:00:06.0-virtio-pci-virtio3\",
# \"volumes\": [{\"mount\": \"/boot\", \"type\": \"partition\", \"size\": 200},
# {\"type\": \"mbr\"}, {\"size\": 20000, \"type\": \"pv\", \"vg\": \"os\"}],
# \"size\": 20480}, {\"type\": \"vg\", \"id\": \"os\", \"volumes\": [{\"mount\":
# \"/\", \"type\": \"lv\", \"name\": \"root\", \"size\": 10240 }, {\"mount\":
# \"swap\", \"type\": \"lv\", \"name\": \"swap\", \"size\": 2048}]}]"'
ks_spaces = '"[{\"type\": \"disk\", \"id\": \"' +
system_disk_path.to_s +
'\",\"volumes\": [{\"mount\": \"/boot\", \"type\": \"partition\", \"size\": 200}, {\"type\": \"mbr\"}, {\"size\": ' +
system_pv_size.to_s +
', \"type\": \"pv\", \"vg\": \"os\"}],\"size\": ' +
system_disk_size.to_s +
'},{\"type\": \"vg\", \"id\": \"os\", \"volumes\": [{\"mount\": \"/\", \"type\": \"lv\", \"name\": \"root\", \"size\": ' +
system_disk_size.to_s +
'}, {\"mount\": \"swap\", \"type\": \"lv\", \"name\": \"swap\", \"size\": '+
swap_size.to_s +
'}]}, {\"type\": \"disk\", \"id\": \"' + cinder_disk_path + '\", \"volumes\": [{\"type\": \"mbr\"}, {\"size\": ' +
cinder_disk_size.to_s +
', \"type\": \"pv\", \"vg\": \"cinder-volumes\"}], \"size\": ' +
cinder_disk_size.to_s + '}]"'
cobbler_ks_meta={"ks_spaces"=>ks_spaces,"mco_host"=>master_ip}

View File

@ -32,15 +32,15 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: &13235360
ks_spaces: ! "'[{\"type\": \"disk\", \"id\": \"\",\"volumes\":\n [{\"mount\":
\"/boot\", \"type\": \"partition\", \"size\": 200}, {\"type\":\n \"mbr\"},
{\"size\": 20275, \"type\": \"pv\", \"vg\": \"os\"}],\"size\":\n 19232
},{\"type\": \"vg\", \"id\": \"os\", \"volumes\": [{\"mount\":\n \"/\",
\"type\": \"lv\", \"name\": \"root\", \"size\": 19232 }, {\"mount\":\n \"swap\",
\"type\": \"lv\", \"name\": \"swap\", \"size\": 1024}]}, {\"type\":\n \"disk\",
\"id\": \"\", \"volumes\": [{\"type\": \"mbr\"},\n {\"size\": 20476, \"type\":
\"pv\", \"vg\": \"cinder-volumes\"}], \"size\":\n 20476]'"
ks_meta: &8640500
ks_spaces: ! '"[{\"type\": \"disk\", \"id\": \"disk/by-path/pci-0000:00:06.0-virtio-pci-virtio3\",\"volumes\":
[{\"mount\": \"/boot\", \"type\": \"partition\", \"size\": 200}, {\"type\":
\"mbr\"}, {\"size\": 20275, \"type\": \"pv\", \"vg\": \"os\"}],\"size\": 19232},{\"type\":
\"vg\", \"id\": \"os\", \"volumes\": [{\"mount\": \"/\", \"type\": \"lv\", \"name\":
\"root\", \"size\": 19232}, {\"mount\": \"swap\", \"type\": \"lv\", \"name\":
\"swap\", \"size\": 1024}]}, {\"type\": \"disk\", \"id\": \"disk/by-path/pci-0000:00:07.0-virtio-pci-virtio4\",
\"volumes\": [{\"type\": \"mbr\"}, {\"size\": 20476, \"type\": \"pv\", \"vg\":
\"cinder-volumes\"}], \"size\": 20476}]"'
mco_enable: 1
mco_vhost: mcollective
mco_pskey: unset
@ -72,7 +72,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: &13253720
meta: &8663000
memory:
total: 778694656
interfaces:
@ -152,7 +152,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.41
@ -170,7 +170,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: controller
network_data:
@ -204,7 +204,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.42
@ -222,7 +222,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: controller
network_data:
@ -256,7 +256,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.36
@ -274,7 +274,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: storage
network_data:
@ -308,7 +308,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.43
@ -326,7 +326,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: storage
network_data:
@ -360,7 +360,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.47
@ -378,7 +378,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: storage
network_data:
@ -412,7 +412,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.44
@ -430,7 +430,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: primary-swift-proxy
network_data:
@ -464,7 +464,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.40
@ -482,7 +482,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
- role: swift-proxy
network_data:
@ -516,7 +516,7 @@ nodes:
netboot_enabled: '1'
name_servers: 172.18.94.34
puppet_master: fuel.domain.tld
ks_meta: *13235360
ks_meta: *8640500
interfaces:
eth0:
ip_address: 172.18.94.45
@ -534,7 +534,7 @@ nodes:
eth2:
onboot: 'no'
peerdns: 'no'
meta: *13253720
meta: *8663000
error_type:
attributes:
use_cow_images: true