[ovirt-users] Ovirt 4.2 SDK - Way to add files with CloudInit()

2018-06-10 Thread atripathi
Hi.

I am using Ovirt 4.2 Java SDK. 

Quick query, can we add additional files to ~openstack/content  and modify 
meta_data.json to point these files. I can see we can add files to 
.cloudInit(cloudInit().files(files))

But API ignores it .. I checked it on /var/log/ovirt-engine/engine.log as well 
as the img created and attached with VM 

Reference - Cloudinit version support such files 
cat meta_data.json
{"files": [{"path": "/etc/injected_files", "content_path": "/content/"}, 
{"path": "/etc/trove/conf.d/guest_info.conf", "content_path": "/content/0001"}, 
{"path": "/etc/trove/conf.d/trove-guestagent.conf", "content_path": 
"/content/0002"}],

reference https://bugs.launchpad.net/cloud-init/+bug/1602373
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/GEHXSLBWHJXVHPUPGQTBQBEVNTHGYBFV/


[ovirt-users] Ovirt 4.2.1 Java SDK ~Payload above Size: [8931] throws HTTP 404

2018-06-07 Thread atripathi
Using Ovirt Java SDK for VM automation .. I have to use payload mechanism as I 
am trying to using same user_data for all VM customization (Centos, Ubuntu and 
Windows) 

As push user_data content of size 8931 (String length) is it throwing 400

final_message: "The system is finally up, after $UPTIME seconds"] Size: [8931]
org.ovirt.engine.sdk4.Error: HTTP response code is "400". HTTP response message 
is "Bad Request".
at 
org.ovirt.engine.sdk4.internal.services.ServiceImpl.throwError(ServiceImpl.java:113)
at 
org.ovirt.engine.sdk4.internal.services.ServiceImpl.checkFault(ServiceImpl.java:40)
at 
org.ovirt.engine.sdk4.internal.services.VmServiceImpl$UpdateRequestImpl.send(VmServiceImpl.java:1543)
at 
org.ovirt.engine.sdk4.internal.services.VmServiceImpl$UpdateRequestImpl.send(VmServiceImpl.java:1464)

Sample code --

List files = new 
ArrayList();
String metadata =  cloudinit.cloudInitMetaFile(map, vmname, vm.id());
String userdata = cloudinit.cloudInitUserData( map, vmname, pkglist);

logger.info("Cloud-Init Script - user data [{}] Size: [{}]", userdata, 
userdata.length());
files.add(file().name("openstack/latest/meta_data.json").content(metadata).build());
files.add(file().name("openstack/latest/user_data").content(userdata).build());
if (networkdatafile != null && !networkdatafile.isEmpty()) {

files.add(file().name("openstack/latest/network_data.json").content(networkdatafile).build());
contentnetworkdatafile = cloudinit.cloudNetworkConfigMetaData(map, "eth0" );

files.add(file().name("openstack/content/network-config").content(contentnetworkdatafile).build());

files.add(file().name("openstack/content/network-config").content(contentnetworkdatafile).build());
}

vmService.update().vm(vm().payloads(payload().type(VmDeviceType.CDROM).files(files))).send();
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/6HHUJNZ2STS4NX3HU42HN3GIBTYATDXP/