Skip to content

Commit cd921cb

Browse files
committed
XXX: iscsi and other stuff to get cinder to work
1 parent 0fca497 commit cd921cb

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

modules/compute/nova.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,24 @@ in
184184
user = "nova";
185185
};
186186
};
187+
"/etc/systemd/system/tgtd.service" = {
188+
"C+" = {
189+
user = "root";
190+
group = "root";
191+
mode = "0600";
192+
argument = "${pkgs.tgt}/etc/systemd/system/tgtd.service";
193+
};
194+
};
187195
};
188196
};
189197

198+
services.openiscsi = {
199+
enable = true;
200+
name = "iqn.iscsi.${config.networking.hostName}";
201+
};
202+
203+
environment.systemPackages = [ pkgs.tgt ];
204+
190205
systemd.services.nova-compute = {
191206
description = "OpenStack Nova Scheduler Daemon";
192207
after = [
@@ -200,6 +215,9 @@ in
200215
sudo
201216
nova_env
202217
qemu
218+
util-linux
219+
lvm2
220+
tgt
203221
]
204222
++ cfg.extraPkgs;
205223
environment.PYTHONPATH = "${nova_env}/${pkgs.python3.sitePackages}";

modules/controller/cinder.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ let
1616
transport_url = rabbit://openstack:openstack@controller
1717
auth_strategy = keystone
1818
my_ip = controller
19+
verify_glance_signatures = disabled
1920
2021
[database]
2122
connection = mysql+pymysql://cinder:cinder@controller/cinder

modules/storage/cinder-storage-node.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ let
5151
state_path = /var/lib/cinder
5252
rootwrap_config = ${rootwrapConf}
5353
glance_api_servers = http://controller:9292
54+
verify_glance_signatures = disabled
5455
5556
[database]
5657
connection = mysql+pymysql://cinder:cinder@controller/cinder
@@ -74,6 +75,7 @@ let
7475
volume_group = cinder-volumes
7576
volume_backend_name = lvm
7677
lvm_type = default
78+
target_protocol = iscsi
7779
'';
7880
in
7981
{
@@ -181,10 +183,13 @@ in
181183
path = with pkgs; [
182184
cinder_env
183185
lvm2
186+
tgt
187+
qemu-utils
184188
# sudo must be in the path and only sudo in /run/wrappers has the
185189
# correct owner and rights
186190
"/run/wrappers"
187191
];
192+
environment.PYTHONPATH = "${cinder_env}/${pkgs.python3.sitePackages}";
188193
wantedBy = [ "multi-user.target" ];
189194
serviceConfig = {
190195
User = "cinder";

modules/testing/default.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ in
4747
url = "https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img";
4848
hash = "sha256-B+RKc+VMlNmIAoUVQDwe12IFXgG4OnZ+3zwrOH94zgA=";
4949
};
50+
image_raw = pkgs.runCommand "" { } ''
51+
${pkgs.qemu-utils}/bin/qemu-img convert -O raw ${image} $out
52+
'';
5053
in
5154
{
5255
imports = [ common ];
@@ -86,8 +89,11 @@ in
8689
--dns-nameserver 8.8.4.4 --gateway 192.168.44.1 \
8790
--subnet-range 192.168.44.0/24 provider
8891
89-
openstack image create --disk-format qcow2 --container-format bare --public --file ${image} cirros
92+
openstack image create --disk-format raw --container-format bare --public --file ${image_raw} cirros
9093
openstack flavor create --public m1.nano --id auto --ram 256 --disk 0 --vcpus 1
94+
openstack volume qos create --consumer "front-end" --property "total_iops_sec=20000" iops
95+
openstack volume qos associate iops __DEFAULT__
96+
openstack volume create --image cirros --size 1 --bootable vol
9197
9298
openstack security group rule create --proto icmp default
9399
openstack security group rule create --proto tcp --dst-port 22 default

0 commit comments

Comments
 (0)