Skip to content

Commit a4a35fc

Browse files
hertrstepkr4711
authored andcommitted
feat: iscsi and other stuff to get cinder to work
On-behalf-of: SAP stefan.kober@sap.com
1 parent f6d0832 commit a4a35fc

4 files changed

Lines changed: 31 additions & 1 deletion

File tree

modules/compute/nova.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,24 @@ in
189189
user = "nova";
190190
};
191191
};
192+
"/etc/systemd/system/tgtd.service" = {
193+
"C+" = {
194+
user = "root";
195+
group = "root";
196+
mode = "0600";
197+
argument = "${pkgs.tgt}/etc/systemd/system/tgtd.service";
198+
};
199+
};
192200
};
193201
};
194202

203+
services.openiscsi = {
204+
enable = true;
205+
name = "iqn.iscsi.${config.networking.hostName}";
206+
};
207+
208+
environment.systemPackages = [ pkgs.tgt ];
209+
195210
systemd.services.nova-compute = {
196211
description = "OpenStack Nova Scheduler Daemon";
197212
after = [
@@ -205,6 +220,9 @@ in
205220
sudo
206221
nova_env
207222
qemu
223+
util-linux
224+
lvm2
225+
tgt
208226
]
209227
++ cfg.extraPkgs;
210228
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
@@ -93,6 +93,9 @@ in
9393
url = "https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img";
9494
hash = "sha256-B+RKc+VMlNmIAoUVQDwe12IFXgG4OnZ+3zwrOH94zgA=";
9595
};
96+
image_raw = pkgs.runCommand "" { } ''
97+
${pkgs.qemu-utils}/bin/qemu-img convert -O raw ${image} $out
98+
'';
9699
in
97100
{
98101
imports = [
@@ -135,8 +138,11 @@ in
135138
--dns-nameserver 8.8.4.4 --gateway 192.168.44.1 \
136139
--subnet-range 192.168.44.0/24 provider
137140
138-
openstack image create --disk-format qcow2 --container-format bare --public --file ${image} cirros
141+
openstack image create --disk-format raw --container-format bare --public --file ${image_raw} cirros
139142
openstack flavor create --public m1.nano --id auto --ram 256 --disk 0 --vcpus 1
143+
openstack volume qos create --consumer "front-end" --property "total_iops_sec=20000" iops
144+
openstack volume qos associate iops __DEFAULT__
145+
openstack volume create --image cirros --size 1 --bootable vol
140146
141147
openstack security group rule create --proto icmp default
142148
openstack security group rule create --proto tcp --dst-port 22 default

0 commit comments

Comments
 (0)