Reviewed-by: Daniel Barboza <dhbarboza82(a)gmail.com>
Minor comments to be looked at in the case you end up sending a v2
(not worth sending a v2 because of them alone):
- copyright format is wrong in new file xmlutils/bootorder.py. It must
be 'Copyright IBM Corp, 2016'. This copyright will be fixed by WoK's
copyright script when it is deployed in Kimchi, so don't need to rush.
- I am not fond of comments when the code is clear enough. This is
the case in your code below:
+ # Add information of CD-ROM device only if not setup to netboot.
+ # Also, setup the correct boot order
+ if params['cdrom'] == 'netboot':
+ params['boot_order'] = get_bootorder_xml(network=True)
The thing about this kind of comment is that it doesn't add up anything
(the code is easy to understand) but then we'll need to keep the comment
updated if the code logic changes for some reason.
Daniel
On 02/16/2016 07:40 PM, pvital(a)linux.vnet.ibm.com wrote:
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
This patchset adds support in backend to create templates and guests to netboot
without setting a cdrom path or URL as image to install. Once created a guest
to boot via network, the guest will request DHCP/TFTP/(NFS/HTTP/FTP) network
installation servers to download the configured images and start the install.
To test, use the curl commands:
curl -k -u test -H "Content-Type: application/json" -H \
"Accept: application/json"
'https://localhost:8001/plugins/kimchi/templates' \
-X POST -d '{"name": "test-netboot"}'
Enter host password for user 'test':
{
"cpu_info":{
"maxvcpus":1,
"vcpus":1
},
"graphics":{
"type":"vnc",
"listen":"127.0.0.1"
},
"cdrom":"netboot",
"networks":[
"default"
],
"icon":"plugins/kimchi/images/icon-vm.png",
"os_distro":"unknown",
"name":"test-netboot",
"disks":[
{
"index":0,
"format":"qcow2",
"pool":{
"type":"dir",
"name":"/plugins/kimchi/storagepools/default"
},
"size":10
}
],
"invalid":{},
"os_version":"unknown",
"memory":1024,
"folder":[]
}
curl -k -u test -H "Content-Type: application/json" -H \
"Accept: application/json" 'https://localhost:8001/plugins/kimchi/vms'
-X POST \
-d
'{"name":"1netboot-test","template":"/plugins/kimchi/templates/test-netboot"}'
Enter host password for user 'test':
{
"status":"running",
"message":"OK",
"id":"1",
"target_uri":"/plugins/kimchi/vms/1netboot-test"
}
Paulo Vital (3):
Add support to create templates without ISO image.
Add support to create guests without ISO image.
Update test cases to support netboot.
model/templates.py | 35 ++++++++++++++++++++++-------------
tests/test_template.py | 18 ++++++++++++++----
tests/test_vmtemplate.py | 16 ++++++++++++++++
vmtemplate.py | 29 ++++++++++++++++++-----------
xmlutils/bootorder.py | 44 ++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 114 insertions(+), 28 deletions(-)
create mode 100644 xmlutils/bootorder.py
--
2.5.0
_______________________________________________
Kimchi-devel mailing list
Kimchi-devel(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel