Revision 55ffacfa

b/Makefile.am
715 715
	test/data/htools/hail-change-group.json \
716 716
	test/data/htools/hail-node-evac.json \
717 717
	test/data/htools/hail-reloc-drbd.json \
718
	test/data/htools/rapi/groups.json \
719
	test/data/htools/rapi/info.json \
720
	test/data/htools/rapi/instances.json \
721
	test/data/htools/rapi/nodes.json \
718 722
	test/data/ovfdata/compr_disk.vmdk.gz \
719 723
	test/data/ovfdata/config.ini \
720 724
	test/data/ovfdata/corrupted_resources.ovf \
b/htools/offline-test.sh
173 173
  grep -q '"success":true,'
174 174
echo OK
175 175

  
176
echo Checking file-based RAPI
177
mkdir -p $T/hscan
178
URL="file://$TESTDATA_DIR/rapi"
179
hinfo -v -v -p --print-instances -m $URL >/dev/null 2>&1
180
hbal -v -v -p --print-instances -m $URL >/dev/null 2>&1
181
hscan -d $T/hscan/ -p -v -v $URL >/dev/null 2>&1
182
# check that we file parsing is correct, i.e. hscan saves correct text
183
# files, and is idempotent (rapi+text == rapi)
184
HS="$(ls $T/hscan/*.data|head -n1)"
185
hinfo -p --print-instances -m $URL > $T/hscan/direct.hinfo 2>&1
186
hinfo -p --print-instances -t $HS  > $T/hscan/fromtext.hinfo 2>&1
187
cmp -s $T/hscan/direct.hinfo $T/hscan/fromtext.hinfo
188
echo OK
189

  
176 190
echo All OK
b/test/data/htools/rapi/groups.json
1
[
2
  {
3
    "uuid": "uuid-group-1",
4
    "tags": [],
5
    "ipolicy": {
6
      "std": {
7
        "cpu-count": 1,
8
        "nic-count": 1,
9
        "disk-size": 1024,
10
        "memory-size": 128,
11
        "disk-count": 1,
12
        "spindle-use": 1
13
      },
14
      "min": {
15
        "cpu-count": 1,
16
        "nic-count": 1,
17
        "disk-size": 1024,
18
        "memory-size": 128,
19
        "disk-count": 1,
20
        "spindle-use": 1
21
      },
22
      "max": {
23
        "cpu-count": 8,
24
        "nic-count": 8,
25
        "disk-size": 1048576,
26
        "memory-size": 32768,
27
        "disk-count": 16,
28
        "spindle-use": 8
29
      },
30
      "vcpu-ratio": 4.0,
31
      "disk-templates": [
32
        "sharedfile",
33
        "diskless",
34
        "plain",
35
        "blockdev",
36
        "drbd",
37
        "file",
38
        "rbd"
39
      ],
40
      "spindle-ratio": 32.0
41
    },
42
    "node_cnt": 4,
43
    "serial_no": 15,
44
    "node_list": [
45
      "node1",
46
      "node2",
47
      "node3",
48
      "node4"
49
    ],
50
    "ctime": null,
51
    "mtime": 1325251614.671967,
52
    "alloc_policy": "preferred",
53
    "name": "default"
54
  }
55
]
b/test/data/htools/rapi/info.json
1
{
2
  "maintain_node_health": true,
3
  "hvparams": {
4
    "xen-pvm": {
5
      "use_bootloader": false,
6
      "migration_mode": "live",
7
      "kernel_args": "ro",
8
      "migration_port": 8002,
9
      "bootloader_args": "",
10
      "root_path": "/dev/sda1",
11
      "blockdev_prefix": "sd",
12
      "bootloader_path": "",
13
      "cpu_mask": "all",
14
      "kernel_path": "/boot/vmlinuz-2.6-xenU",
15
      "initrd_path": "",
16
      "reboot_behavior": "reboot"
17
    },
18
    "xen-hvm": {
19
      "nic_type": "rtl8139",
20
      "use_localtime": false,
21
      "migration_mode": "non-live",
22
      "boot_order": "cd",
23
      "migration_port": 8002,
24
      "cpu_mask": "all",
25
      "vnc_bind_address": "0.0.0.0",
26
      "reboot_behavior": "reboot",
27
      "blockdev_prefix": "hd",
28
      "cdrom_image_path": "",
29
      "device_model": "/usr/lib/xen/bin/qemu-dm",
30
      "pae": true,
31
      "vnc_password_file": "/etc/ganeti/vnc-cluster-password",
32
      "disk_type": "paravirtual",
33
      "kernel_path": "/usr/lib/xen/boot/hvmloader",
34
      "acpi": true
35
    }
36
  },
37
  "default_hypervisor": "xen-pvm",
38
  "uid_pool": [],
39
  "prealloc_wipe_disks": false,
40
  "primary_ip_version": 4,
41
  "mtime": 1331075221.432734,
42
  "os_hvp": {
43
    "instance-debootstrap": {
44
      "xen-pvm": {
45
        "root_path": "/dev/xvda1",
46
        "kernel_path": "/boot/vmlinuz-2.6.38"
47
      }
48
    }
49
  },
50
  "osparams": {
51
    "debootstrap": {
52
      "dhcp": "no",
53
      "partition_style": "none",
54
      "packages": "ssh"
55
    }
56
  },
57
  "shared_file_storage_dir": "",
58
  "master_netmask": 32,
59
  "uuid": "1616c1cc-f793-499c-b1c5-48264c2d2976",
60
  "use_external_mip_script": false,
61
  "export_version": 0,
62
  "hidden_os": [
63
    "lenny"
64
  ],
65
  "os_api_version": 20,
66
  "master": "node4",
67
  "nicparams": {
68
    "default": {
69
      "link": "xen-br0",
70
      "mode": "bridged"
71
    }
72
  },
73
  "protocol_version": 2050000,
74
  "config_version": 2050000,
75
  "software_version": "2.5.0~rc5",
76
  "tags": [
77
    "htools:iextags:test",
78
    "htools:iextags:service-group"
79
  ],
80
  "ipolicy": {
81
    "std": {
82
      "nic-count": 1,
83
      "disk-size": 1024,
84
      "disk-count": 1,
85
      "memory-size": 128,
86
      "cpu-count": 1,
87
      "spindle-use": 1
88
    },
89
    "min": {
90
      "nic-count": 1,
91
      "disk-size": 128,
92
      "disk-count": 1,
93
      "memory-size": 128,
94
      "cpu-count": 1,
95
      "spindle-use": 1
96
    },
97
    "max": {
98
      "nic-count": 8,
99
      "disk-size": 1048576,
100
      "disk-count": 16,
101
      "memory-size": 32768,
102
      "cpu-count": 8,
103
      "spindle-use": 8
104
    },
105
    "vcpu-ratio": 4.0,
106
    "disk-templates": [
107
      "sharedfile",
108
      "diskless",
109
      "plain",
110
      "blockdev",
111
      "drbd",
112
      "file",
113
      "rbd"
114
    ],
115
    "spindle-ratio": 32.0
116
  },
117
  "candidate_pool_size": 3,
118
  "file_storage_dir": "/srv/ganeti/file-storage",
119
  "blacklisted_os": [],
120
  "enabled_hypervisors": [
121
    "xen-pvm",
122
    "xen-hvm"
123
  ],
124
  "reserved_lvs": [
125
    "xenvg/test"
126
  ],
127
  "drbd_usermode_helper": "/bin/true",
128
  "default_iallocator": "hail",
129
  "ctime": 1271079848.3199999,
130
  "name": "cluster",
131
  "master_netdev": "xen-br0",
132
  "ndparams": {
133
    "spindle_count": 1,
134
    "oob_program": null
135
  },
136
  "architecture": [
137
    "64bit",
138
    "x86_64"
139
  ],
140
  "volume_group_name": "xenvg",
141
  "beparams": {
142
    "default": {
143
      "auto_balance": true,
144
      "minmem": 128,
145
      "vcpus": 1,
146
      "always_failover": false,
147
      "maxmem": 128
148
    }
149
  }
150
}
b/test/data/htools/rapi/instances.json
1
[
2
  {
3
    "disk_usage": 256,
4
    "oper_vcpus": 1,
5
    "serial_no": 7,
6
    "hvparams": {
7
      "root_path": "/dev/xvda1",
8
      "kernel_args": "ro",
9
      "blockdev_prefix": "sd",
10
      "use_bootloader": false,
11
      "bootloader_args": "",
12
      "bootloader_path": "",
13
      "cpu_mask": "all",
14
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
15
      "initrd_path": "",
16
      "reboot_behavior": "reboot"
17
    },
18
    "oper_state": true,
19
    "disk_template": "drbd",
20
    "mtime": 1330349951.511833,
21
    "nic.modes": [
22
      "bridged"
23
    ],
24
    "oper_ram": 128,
25
    "pnode": "node3",
26
    "nic.bridges": [
27
      "xen-br0"
28
    ],
29
    "status": "running",
30
    "custom_hvparams": {},
31
    "tags": [],
32
    "nic.ips": [
33
      null
34
    ],
35
    "snodes": [
36
      "node4"
37
    ],
38
    "nic.macs": [
39
      "aa:00:00:73:20:3e"
40
    ],
41
    "name": "instance2",
42
    "network_port": null,
43
    "ctime": 1327334413.084552,
44
    "custom_beparams": {},
45
    "custom_nicparams": [
46
      {}
47
    ],
48
    "uuid": "4b9ff2a2-3399-4141-b4e1-cde418b1dfec",
49
    "disk.sizes": [
50
      128
51
    ],
52
    "admin_state": "up",
53
    "nic.links": [
54
      "xen-br0"
55
    ],
56
    "os": "debian-image",
57
    "beparams": {
58
      "auto_balance": true,
59
      "minmem": 128,
60
      "vcpus": 1,
61
      "always_failover": false,
62
      "maxmem": 128,
63
      "spindle_use": 1
64
    }
65
  },
66
  {
67
    "disk_usage": 384,
68
    "oper_vcpus": null,
69
    "serial_no": 6,
70
    "hvparams": {
71
      "root_path": "/dev/xvda1",
72
      "kernel_args": "ro",
73
      "blockdev_prefix": "sd",
74
      "use_bootloader": false,
75
      "bootloader_args": "",
76
      "bootloader_path": "",
77
      "cpu_mask": "all",
78
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
79
      "initrd_path": "",
80
      "reboot_behavior": "reboot"
81
    },
82
    "oper_state": false,
83
    "disk_template": "plain",
84
    "mtime": 1325681489.4059889,
85
    "nic.modes": [
86
      "bridged"
87
    ],
88
    "oper_ram": null,
89
    "pnode": "node4",
90
    "nic.bridges": [
91
      "xen-br0"
92
    ],
93
    "status": "ADMIN_down",
94
    "custom_hvparams": {
95
      "root_path": "/dev/xvda1",
96
      "kernel_args": "ro",
97
      "blockdev_prefix": "sd",
98
      "use_bootloader": false,
99
      "bootloader_args": "",
100
      "bootloader_path": "",
101
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
102
      "initrd_path": ""
103
    },
104
    "tags": [],
105
    "nic.ips": [
106
      null
107
    ],
108
    "snodes": [],
109
    "nic.macs": [
110
      "aa:00:00:ec:e8:a2"
111
    ],
112
    "name": "instance3",
113
    "network_port": null,
114
    "ctime": 1312272250.96,
115
    "custom_beparams": {
116
      "auto_balance": true,
117
      "minmem": 128,
118
      "vcpus": 1,
119
      "maxmem": 128,
120
      "spindle_use": 1
121
    },
122
    "custom_nicparams": [
123
      {
124
        "link": "xen-br0",
125
        "mode": "bridged"
126
      }
127
    ],
128
    "uuid": "3cecca87-eae7-476c-847c-818a28764989",
129
    "disk.sizes": [
130
      256,
131
      128
132
    ],
133
    "admin_state": "down",
134
    "nic.links": [
135
      "xen-br0"
136
    ],
137
    "os": "debian-image",
138
    "beparams": {
139
      "auto_balance": true,
140
      "minmem": 128,
141
      "vcpus": 1,
142
      "always_failover": false,
143
      "maxmem": 128,
144
      "spindle_use": 1
145
    }
146
  },
147
  {
148
    "disk_usage": 2176,
149
    "oper_vcpus": null,
150
    "serial_no": 23,
151
    "hvparams": {
152
      "root_path": "/dev/xvda1",
153
      "kernel_args": "ro",
154
      "blockdev_prefix": "sd",
155
      "use_bootloader": false,
156
      "bootloader_args": "",
157
      "bootloader_path": "",
158
      "cpu_mask": "all",
159
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
160
      "initrd_path": "",
161
      "reboot_behavior": "reboot"
162
    },
163
    "oper_state": false,
164
    "disk_template": "drbd",
165
    "mtime": 1325681487.384176,
166
    "nic.modes": [
167
      "bridged"
168
    ],
169
    "oper_ram": null,
170
    "pnode": "node4",
171
    "nic.bridges": [
172
      "xen-br0"
173
    ],
174
    "status": "ADMIN_down",
175
    "custom_hvparams": {},
176
    "tags": [
177
      "service-group:dns"
178
    ],
179
    "nic.ips": [
180
      null
181
    ],
182
    "snodes": [
183
      "node3"
184
    ],
185
    "nic.macs": [
186
      "aa:00:00:62:b0:76"
187
    ],
188
    "name": "instance4",
189
    "network_port": null,
190
    "ctime": 1274885795.4000001,
191
    "custom_beparams": {},
192
    "custom_nicparams": [
193
      {}
194
    ],
195
    "uuid": "33f4c063-bb65-41b2-af29-d8a631201bd7",
196
    "disk.sizes": [
197
      2048
198
    ],
199
    "admin_state": "down",
200
    "nic.links": [
201
      "xen-br0"
202
    ],
203
    "os": "lenny-image",
204
    "beparams": {
205
      "auto_balance": true,
206
      "minmem": 128,
207
      "vcpus": 1,
208
      "always_failover": false,
209
      "maxmem": 128,
210
      "spindle_use": 1
211
    }
212
  },
213
  {
214
    "disk_usage": 256,
215
    "oper_vcpus": null,
216
    "serial_no": 9,
217
    "hvparams": {
218
      "spice_password_file": "",
219
      "spice_use_tls": false,
220
      "spice_use_vdagent": true,
221
      "nic_type": "paravirtual",
222
      "vnc_bind_address": "0.0.0.0",
223
      "cdrom2_image_path": "",
224
      "usb_mouse": "",
225
      "spice_streaming_video": "",
226
      "use_chroot": false,
227
      "spice_tls_ciphers": "HIGH:-DES:-3DES:-EXPORT:-ADH",
228
      "migration_downtime": 30,
229
      "floppy_image_path": "",
230
      "security_model": "none",
231
      "cdrom_image_path": "",
232
      "spice_ip_version": 0,
233
      "vhost_net": false,
234
      "cpu_mask": "all",
235
      "disk_cache": "default",
236
      "kernel_path": "/boot/vmlinuz-2.6.38-gg426-generic",
237
      "initrd_path": "/boot/initrd.img-2.6.38-gg426-generic",
238
      "spice_jpeg_wan_compression": "",
239
      "vnc_tls": false,
240
      "cdrom_disk_type": "",
241
      "use_localtime": false,
242
      "security_domain": "",
243
      "serial_console": false,
244
      "spice_bind": "",
245
      "spice_zlib_glz_wan_compression": "",
246
      "kvm_flag": "",
247
      "vnc_password_file": "",
248
      "disk_type": "paravirtual",
249
      "vnc_x509_verify": false,
250
      "spice_image_compression": "",
251
      "spice_playback_compression": true,
252
      "kernel_args": "ro",
253
      "root_path": "/dev/vda1",
254
      "vnc_x509_path": "",
255
      "acpi": true,
256
      "keymap": "",
257
      "boot_order": "disk",
258
      "mem_path": "",
259
      "reboot_behavior": "reboot"
260
    },
261
    "oper_state": false,
262
    "disk_template": "plain",
263
    "mtime": 1325681492.191576,
264
    "nic.modes": [
265
      "bridged"
266
    ],
267
    "oper_ram": null,
268
    "pnode": "node4",
269
    "nic.bridges": [
270
      "xen-br0"
271
    ],
272
    "status": "ADMIN_down",
273
    "custom_hvparams": {},
274
    "tags": [],
275
    "nic.ips": [
276
      null
277
    ],
278
    "snodes": [],
279
    "nic.macs": [
280
      "aa:00:00:3f:6d:e3"
281
    ],
282
    "name": "instance8",
283
    "network_port": 12111,
284
    "ctime": 1311771325.6600001,
285
    "custom_beparams": {},
286
    "custom_nicparams": [
287
      {}
288
    ],
289
    "uuid": "1ea53cc3-cc69-43da-b261-f22ac47896ea",
290
    "disk.sizes": [
291
      256
292
    ],
293
    "admin_state": "down",
294
    "nic.links": [
295
      "xen-br0"
296
    ],
297
    "os": "debian-image",
298
    "beparams": {
299
      "auto_balance": true,
300
      "minmem": 128,
301
      "vcpus": 1,
302
      "always_failover": false,
303
      "maxmem": 128,
304
      "spindle_use": 1
305
    }
306
  },
307
  {
308
    "disk_usage": 256,
309
    "oper_vcpus": null,
310
    "serial_no": 31,
311
    "hvparams": {
312
      "root_path": "/dev/sda1",
313
      "kernel_args": "ro",
314
      "blockdev_prefix": "sd",
315
      "use_bootloader": false,
316
      "bootloader_args": "",
317
      "bootloader_path": "",
318
      "cpu_mask": "all",
319
      "kernel_path": "/boot/vmlinuz-2.6-xenU",
320
      "initrd_path": "",
321
      "reboot_behavior": "reboot"
322
    },
323
    "oper_state": false,
324
    "disk_template": "drbd",
325
    "mtime": 1325681490.685926,
326
    "nic.modes": [
327
      "bridged"
328
    ],
329
    "oper_ram": null,
330
    "pnode": "node3",
331
    "nic.bridges": [
332
      "xen-br0"
333
    ],
334
    "status": "ADMIN_down",
335
    "custom_hvparams": {
336
      "root_path": "/dev/sda1",
337
      "kernel_args": "ro",
338
      "use_bootloader": false,
339
      "bootloader_args": "",
340
      "bootloader_path": "",
341
      "kernel_path": "/boot/vmlinuz-2.6-xenU",
342
      "initrd_path": ""
343
    },
344
    "tags": [
345
      "gogu:test"
346
    ],
347
    "nic.ips": [
348
      null
349
    ],
350
    "snodes": [
351
      "node4"
352
    ],
353
    "nic.macs": [
354
      "aa:00:00:10:d2:01"
355
    ],
356
    "name": "instance9",
357
    "network_port": null,
358
    "ctime": 1271937489.76,
359
    "custom_beparams": {
360
      "auto_balance": true,
361
      "minmem": 128,
362
      "vcpus": 1,
363
      "maxmem": 128,
364
      "spindle_use": 1
365
    },
366
    "custom_nicparams": [
367
      {}
368
    ],
369
    "uuid": "4927ac66-a3c5-45c6-be39-97e2b119557e",
370
    "disk.sizes": [
371
      128
372
    ],
373
    "admin_state": "down",
374
    "nic.links": [
375
      "xen-br0"
376
    ],
377
    "os": "lenny-image",
378
    "beparams": {
379
      "auto_balance": true,
380
      "minmem": 128,
381
      "vcpus": 1,
382
      "always_failover": false,
383
      "maxmem": 128,
384
      "spindle_use": 1
385
    }
386
  },
387
  {
388
    "disk_usage": 512,
389
    "oper_vcpus": null,
390
    "serial_no": 11,
391
    "hvparams": {
392
      "root_path": "/dev/sda1",
393
      "kernel_args": "ro",
394
      "blockdev_prefix": "sd",
395
      "use_bootloader": false,
396
      "bootloader_args": "",
397
      "bootloader_path": "",
398
      "cpu_mask": "all",
399
      "kernel_path": "/boot/vmlinuz-2.6-xenU",
400
      "initrd_path": "",
401
      "reboot_behavior": "reboot"
402
    },
403
    "oper_state": false,
404
    "disk_template": "plain",
405
    "mtime": 1325681493.0002201,
406
    "nic.modes": [
407
      "bridged"
408
    ],
409
    "oper_ram": null,
410
    "pnode": "node4",
411
    "nic.bridges": [
412
      "xen-br1"
413
    ],
414
    "status": "ADMIN_down",
415
    "custom_hvparams": {},
416
    "tags": [],
417
    "nic.ips": [
418
      null
419
    ],
420
    "snodes": [],
421
    "nic.macs": [
422
      "aa:00:00:7f:8c:9c"
423
    ],
424
    "name": "instance13",
425
    "network_port": null,
426
    "ctime": 1305129727.7,
427
    "custom_beparams": {},
428
    "custom_nicparams": [
429
      {
430
        "link": "xen-br1"
431
      }
432
    ],
433
    "uuid": "b864e453-f072-41fe-9973-7673c2161e34",
434
    "disk.sizes": [
435
      512
436
    ],
437
    "admin_state": "down",
438
    "nic.links": [
439
      "xen-br1"
440
    ],
441
    "os": "busybox",
442
    "beparams": {
443
      "auto_balance": true,
444
      "minmem": 128,
445
      "vcpus": 1,
446
      "always_failover": false,
447
      "maxmem": 128,
448
      "spindle_use": 1
449
    }
450
  },
451
  {
452
    "disk_usage": 256,
453
    "oper_vcpus": null,
454
    "serial_no": 11,
455
    "hvparams": {
456
      "root_path": "/dev/xvda1",
457
      "kernel_args": "ro",
458
      "blockdev_prefix": "sd",
459
      "use_bootloader": false,
460
      "bootloader_args": "",
461
      "bootloader_path": "",
462
      "cpu_mask": "all",
463
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
464
      "initrd_path": "",
465
      "reboot_behavior": "reboot"
466
    },
467
    "oper_state": false,
468
    "disk_template": "drbd",
469
    "mtime": 1325681493.8268771,
470
    "nic.modes": [
471
      "bridged"
472
    ],
473
    "oper_ram": null,
474
    "pnode": "node3",
475
    "nic.bridges": [
476
      "xen-br0"
477
    ],
478
    "status": "ADMIN_down",
479
    "custom_hvparams": {},
480
    "tags": [],
481
    "nic.ips": [
482
      null
483
    ],
484
    "snodes": [
485
      "node4"
486
    ],
487
    "nic.macs": [
488
      "aa:00:00:eb:0b:a5"
489
    ],
490
    "name": "instance14",
491
    "network_port": null,
492
    "ctime": 1312285580.27,
493
    "custom_beparams": {},
494
    "custom_nicparams": [
495
      {}
496
    ],
497
    "uuid": "e9dae1c9-b4cb-4f11-b0e9-65931a6b3524",
498
    "disk.sizes": [
499
      128
500
    ],
501
    "admin_state": "down",
502
    "nic.links": [
503
      "xen-br0"
504
    ],
505
    "os": "debian-image",
506
    "beparams": {
507
      "auto_balance": true,
508
      "minmem": 128,
509
      "vcpus": 1,
510
      "always_failover": false,
511
      "maxmem": 128,
512
      "spindle_use": 1
513
    }
514
  },
515
  {
516
    "disk_usage": 128,
517
    "oper_vcpus": null,
518
    "serial_no": 9,
519
    "hvparams": {
520
      "root_path": "/dev/sda1",
521
      "kernel_args": "ro",
522
      "blockdev_prefix": "sd",
523
      "use_bootloader": false,
524
      "bootloader_args": "",
525
      "bootloader_path": "",
526
      "cpu_mask": "all",
527
      "kernel_path": "/boot/vmlinuz-2.6-xenU",
528
      "initrd_path": "",
529
      "reboot_behavior": "reboot"
530
    },
531
    "oper_state": false,
532
    "disk_template": "plain",
533
    "mtime": 1325681491.0986331,
534
    "nic.modes": [
535
      "bridged"
536
    ],
537
    "oper_ram": null,
538
    "pnode": "node4",
539
    "nic.bridges": [
540
      "xen-br0"
541
    ],
542
    "status": "ADMIN_down",
543
    "custom_hvparams": {},
544
    "tags": [],
545
    "nic.ips": [
546
      null
547
    ],
548
    "snodes": [],
549
    "nic.macs": [
550
      "aa:00:00:55:94:93"
551
    ],
552
    "name": "instance18",
553
    "network_port": null,
554
    "ctime": 1297176343.1700001,
555
    "custom_beparams": {
556
      "minmem": 8192,
557
      "maxmem": 8192
558
    },
559
    "custom_nicparams": [
560
      {}
561
    ],
562
    "uuid": "2f14bc3b-8448-4b2f-a592-d7a216244b22",
563
    "disk.sizes": [
564
      128
565
    ],
566
    "admin_state": "down",
567
    "nic.links": [
568
      "xen-br0"
569
    ],
570
    "os": "busybox",
571
    "beparams": {
572
      "auto_balance": true,
573
      "minmem": 8192,
574
      "vcpus": 1,
575
      "always_failover": false,
576
      "maxmem": 8192,
577
      "spindle_use": 1
578
    }
579
  },
580
  {
581
    "disk_usage": 256,
582
    "oper_vcpus": null,
583
    "serial_no": 10,
584
    "hvparams": {
585
      "root_path": "/dev/xvda1",
586
      "kernel_args": "ro",
587
      "blockdev_prefix": "sd",
588
      "use_bootloader": false,
589
      "bootloader_args": "",
590
      "bootloader_path": "",
591
      "cpu_mask": "all",
592
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
593
      "initrd_path": "",
594
      "reboot_behavior": "reboot"
595
    },
596
    "oper_state": false,
597
    "disk_template": "drbd",
598
    "mtime": 1325681491.5785329,
599
    "nic.modes": [
600
      "bridged"
601
    ],
602
    "oper_ram": null,
603
    "pnode": "node3",
604
    "nic.bridges": [
605
      "xen-br0"
606
    ],
607
    "status": "ADMIN_down",
608
    "custom_hvparams": {},
609
    "tags": [],
610
    "nic.ips": [
611
      null
612
    ],
613
    "snodes": [
614
      "node4"
615
    ],
616
    "nic.macs": [
617
      "aa:00:00:15:92:6f"
618
    ],
619
    "name": "instance19",
620
    "network_port": null,
621
    "ctime": 1312464490.7,
622
    "custom_beparams": {},
623
    "custom_nicparams": [
624
      {}
625
    ],
626
    "uuid": "624c1844-82a2-474e-bdaf-1bafa820fdcf",
627
    "disk.sizes": [
628
      128
629
    ],
630
    "admin_state": "down",
631
    "nic.links": [
632
      "xen-br0"
633
    ],
634
    "os": "debian-image",
635
    "beparams": {
636
      "auto_balance": true,
637
      "minmem": 128,
638
      "vcpus": 1,
639
      "always_failover": false,
640
      "maxmem": 128,
641
      "spindle_use": 1
642
    }
643
  },
644
  {
645
    "disk_usage": 512,
646
    "oper_vcpus": null,
647
    "serial_no": 14,
648
    "hvparams": {
649
      "spice_password_file": "",
650
      "spice_use_tls": false,
651
      "spice_use_vdagent": true,
652
      "nic_type": "paravirtual",
653
      "vnc_bind_address": "0.0.0.0",
654
      "cdrom2_image_path": "",
655
      "usb_mouse": "",
656
      "spice_streaming_video": "",
657
      "use_chroot": false,
658
      "spice_tls_ciphers": "HIGH:-DES:-3DES:-EXPORT:-ADH",
659
      "migration_downtime": 30,
660
      "floppy_image_path": "",
661
      "security_model": "none",
662
      "cdrom_image_path": "",
663
      "spice_ip_version": 0,
664
      "vhost_net": false,
665
      "cpu_mask": "all",
666
      "disk_cache": "default",
667
      "kernel_path": "/boot/vmlinuz-2.6.38-gg426-generic",
668
      "initrd_path": "/boot/initrd.img-2.6.38-gg426-generic",
669
      "spice_jpeg_wan_compression": "",
670
      "vnc_tls": false,
671
      "cdrom_disk_type": "",
672
      "use_localtime": false,
673
      "security_domain": "",
674
      "serial_console": false,
675
      "spice_bind": "",
676
      "spice_zlib_glz_wan_compression": "",
677
      "kvm_flag": "",
678
      "vnc_password_file": "",
679
      "disk_type": "paravirtual",
680
      "vnc_x509_verify": false,
681
      "spice_image_compression": "",
682
      "spice_playback_compression": true,
683
      "kernel_args": "ro",
684
      "root_path": "/dev/vda1",
685
      "vnc_x509_path": "",
686
      "acpi": true,
687
      "keymap": "",
688
      "boot_order": "disk",
689
      "mem_path": "",
690
      "reboot_behavior": "reboot"
691
    },
692
    "oper_state": false,
693
    "disk_template": "plain",
694
    "mtime": 1325681494.699162,
695
    "nic.modes": [
696
      "bridged"
697
    ],
698
    "oper_ram": null,
699
    "pnode": "node4",
700
    "nic.bridges": [
701
      "xen-br0"
702
    ],
703
    "status": "ADMIN_down",
704
    "custom_hvparams": {},
705
    "tags": [],
706
    "nic.ips": [
707
      null
708
    ],
709
    "snodes": [],
710
    "nic.macs": [
711
      "aa:00:00:db:2a:6d"
712
    ],
713
    "name": "instance20",
714
    "network_port": 12107,
715
    "ctime": 1305208955.75,
716
    "custom_beparams": {},
717
    "custom_nicparams": [
718
      {
719
        "link": "xen-br0"
720
      }
721
    ],
722
    "uuid": "4f65c14d-be87-4303-a8dc-ba1b86e2a3b3",
723
    "disk.sizes": [
724
      512
725
    ],
726
    "admin_state": "down",
727
    "nic.links": [
728
      "xen-br0"
729
    ],
730
    "os": "lenny-image+default",
731
    "beparams": {
732
      "auto_balance": true,
733
      "minmem": 128,
734
      "vcpus": 1,
735
      "always_failover": false,
736
      "maxmem": 128,
737
      "spindle_use": 1
738
    }
739
  },
740
  {
741
    "disk_usage": 256,
742
    "oper_vcpus": null,
743
    "serial_no": 10,
744
    "hvparams": {
745
      "root_path": "/dev/xvda1",
746
      "kernel_args": "ro",
747
      "blockdev_prefix": "sd",
748
      "use_bootloader": false,
749
      "bootloader_args": "",
750
      "bootloader_path": "",
751
      "cpu_mask": "all",
752
      "kernel_path": "/boot/vmlinuz-ganetixenu-2.6.38",
753
      "initrd_path": "",
754
      "reboot_behavior": "reboot"
755
    },
756
    "oper_state": false,
757
    "disk_template": "drbd",
758
    "mtime": 1325681489.0591741,
759
    "nic.modes": [
760
      "bridged"
761
    ],
762
    "oper_ram": null,
763
    "pnode": "node3",
764
    "nic.bridges": [
765
      "xen-br0"
766
    ],
767
    "status": "ADMIN_down",
768
    "custom_hvparams": {},
769
    "tags": [],
770
    "nic.ips": [
771
      null
772
    ],
773
    "snodes": [
774
      "node4"
775
    ],
776
    "nic.macs": [
777
      "aa:00:00:cb:96:c1"
778
    ],
779
    "name": "instance21",
780
    "network_port": null,
781
    "ctime": 1312552008.1199999,
782
    "custom_beparams": {},
783
    "custom_nicparams": [
784
      {}
785
    ],
786
    "uuid": "6f2f7824-8392-408e-ac54-c938f4fb0638",
787
    "disk.sizes": [
788
      128
789
    ],
790
    "admin_state": "down",
791
    "nic.links": [
792
      "xen-br0"
793
    ],
794
    "os": "debian-image",
795
    "beparams": {
796
      "auto_balance": true,
797
      "minmem": 128,
798
      "vcpus": 1,
799
      "always_failover": false,
800
      "maxmem": 128,
801
      "spindle_use": 1
802
    }
803
  }
804
]
b/test/data/htools/rapi/nodes.json
1
[
2
  {
3
    "cnodes": 2,
4
    "csockets": 2,
5
    "ctime": 1324472016.2968869,
6
    "ctotal": 4,
7
    "dfree": 1377280,
8
    "drained": false,
9
    "dtotal": 1377280,
10
    "group.uuid": "uuid-group-1",
11
    "master_candidate": true,
12
    "master_capable": true,
13
    "mfree": 31389,
14
    "mnode": 1017,
15
    "mtime": 1331075221.432734,
16
    "mtotal": 32763,
17
    "name": "node1",
18
    "offline": false,
19
    "pinst_cnt": 0,
20
    "pinst_list": [],
21
    "pip": "192.168.1.1",
22
    "role": "C",
23
    "serial_no": 3,
24
    "sinst_cnt": 0,
25
    "sinst_list": [],
26
    "sip": "192.168.1.2",
27
    "tags": [],
28
    "uuid": "7750ef3d-450f-4724-9d3d-8726d6335417",
29
    "vm_capable": true,
30
    "ndparams": {
31
      "spindle_count": 1,
32
      "oob_program": null
33
    }
34
  },
35
  {
36
    "cnodes": 2,
37
    "csockets": 2,
38
    "ctime": 1324472016.2968869,
39
    "ctotal": 4,
40
    "dfree": 1376640,
41
    "drained": false,
42
    "dtotal": 1377280,
43
    "group.uuid": "uuid-group-1",
44
    "master_candidate": true,
45
    "master_capable": true,
46
    "mfree": 31746,
47
    "mnode": 1017,
48
    "mtime": 1331075221.432734,
49
    "mtotal": 32763,
50
    "name": "node2",
51
    "offline": false,
52
    "pinst_cnt": 0,
53
    "pinst_list": [],
54
    "pip": "192.168.1.2",
55
    "role": "C",
56
    "serial_no": 3,
57
    "sinst_cnt": 0,
58
    "sinst_list": [],
59
    "sip": "192.168.2.2",
60
    "tags": [],
61
    "uuid": "7750ef3d-450f-4724-9d3d-8726d6335417",
62
    "vm_capable": true,
63
    "ndparams": {
64
      "spindle_count": 1,
65
      "oob_program": null
66
    }
67
  },
68
  {
69
    "cnodes": 2,
70
    "dfree": 1373336,
71
    "drained": false,
72
    "dtotal": 1377304,
73
    "mfree": 31234,
74
    "mtime": 1331075172.0123219,
75
    "pip": "192.168.1.3",
76
    "serial_no": 129,
77
    "sinst_cnt": 1,
78
    "sip": "192.168.2.3",
79
    "uuid": "2c7acf04-599d-4707-aba4-bf07a2685f63",
80
    "sinst_list": [
81
      "instance4"
82
    ],
83
    "csockets": 2,
84
    "role": "C",
85
    "ctotal": 4,
86
    "offline": false,
87
    "vm_capable": true,
88
    "pinst_cnt": 5,
89
    "mtotal": 32763,
90
    "tags": [],
91
    "group.uuid": "uuid-group-1",
92
    "master_capable": true,
93
    "name": "node3",
94
    "master_candidate": true,
95
    "ctime": 1271425438.5,
96
    "mnode": 1017,
97
    "pinst_list": [
98
      "instance14",
99
      "instance19",
100
      "instance2",
101
      "instance21",
102
      "instance9"
103
    ],
104
    "ndparams": {
105
      "spindle_count": 1,
106
      "oob_program": null
107
    }
108
  },
109
  {
110
    "cnodes": 2,
111
    "dfree": 1371520,
112
    "drained": false,
113
    "dtotal": 1377280,
114
    "mfree": 31746,
115
    "mtime": 1318339824.54,
116
    "pip": "192.168.1.4",
117
    "serial_no": 8,
118
    "sinst_cnt": 5,
119
    "sip": "192.168.2.4",
120
    "uuid": "f25357c1-7fee-4471-b8a9-c7f28669e439",
121
    "sinst_list": [
122
      "instance2",
123
      "instance21",
124
      "instance14",
125
      "instance9",
126
      "instance19"
127
    ],
128
    "csockets": 2,
129
    "role": "M",
130
    "ctotal": 4,
131
    "offline": false,
132
    "vm_capable": true,
133
    "pinst_cnt": 7,
134
    "mtotal": 32763,
135
    "tags": [],
136
    "group.uuid": "uuid-group-1",
137
    "master_capable": true,
138
    "name": "node4",
139
    "master_candidate": true,
140
    "ctime": 1309185898.51,
141
    "mnode": 1017,
142
    "pinst_list": [
143
      "instance20",
144
      "instance3",
145
      "instance15",
146
      "instance4",
147
      "instance13",
148
      "instance8",
149
      "instance18"
150
    ],
151
    "ndparams": {
152
      "spindle_count": 1,
153
      "oob_program": null
154
    }
155
  }
156
]

Also available in: Unified diff