Revision 0c37a721 snf-cyclades-app/synnefo/api/servers.py

b/snf-cyclades-app/synnefo/api/servers.py
159 159
    #                       badRequest (400),
160 160
    #                       overLimit (413)
161 161

  
162
    log.info('list_servers detail=%s', detail)
162
    log.debug('list_servers detail=%s', detail)
163 163
    user_vms = VirtualMachine.objects.filter(userid=request.user_uniq)
164 164

  
165 165
    since = util.isoparse(request.GET.get('changes-since'))
......
259 259

  
260 260
    if backend is None:
261 261
        transaction.rollback()
262
        log.error("No available backends for VM with flavor %s", flavor)
262 263
        raise Exception
263 264
    transaction.commit()
264 265

  
......
266 267
        (network, address) = util.allocate_public_address(backend)
267 268
        if address is None:
268 269
            transaction.rollback()
270
            log.error("Public networks of backend %s are full", backend)
269 271
            raise faults.OverLimit("Can not allocate IP for new machine."
270 272
                                   " Public networks are full.")
271 273
        transaction.commit()
......
282 284
        imageid=image_id,
283 285
        flavor=flavor)
284 286

  
285
    log.info("Create VM %s, with NIC %s, on Backend %s", vm, nic, backend)
286

  
287 287
    try:
288 288
        jobID = create_instance(vm, nic, flavor, image, password, personality)
289 289
    except GanetiApiError:
290 290
        vm.delete()
291 291
        raise
292 292

  
293
    log.info("User %s created VM %s, NIC %s, Backend %s, JobID %s",
294
            request.user_uniq, vm, nic, backend, str(jobID))
295

  
293 296
    vm.backendjobid = jobID
294 297
    vm.save()
295 298

  
......
299 302
            meta_value=val,
300 303
            vm=vm)
301 304

  
302
    log.info('User %s created vm with %s cpus, %s ram and %s storage',
303
             request.user_uniq, flavor.cpu, flavor.ram, flavor.disk)
304

  
305 305
    server = vm_to_dict(vm, detail=True)
306 306
    server['status'] = 'BUILD'
307 307
    server['adminPass'] = password
......
322 322
    #                       itemNotFound (404),
323 323
    #                       overLimit (413)
324 324

  
325
    log.info('get_server_details %s', server_id)
325
    log.debug('get_server_details %s', server_id)
326 326
    vm = util.get_vm(server_id, request.user_uniq)
327 327
    server = vm_to_dict(vm, detail=True)
328 328
    return render_server(request, server)
......
376 376
@util.api_method('POST')
377 377
def server_action(request, server_id):
378 378
    req = util.get_request_dict(request)
379
    log.info('server_action %s %s', server_id, req)
379
    log.debug('server_action %s %s', server_id, req)
380 380
    vm = util.get_vm(server_id, request.user_uniq)
381 381
    if len(req) != 1:
382 382
        raise faults.BadRequest("Malformed request")
......
402 402
    #                       badRequest (400),
403 403
    #                       overLimit (413)
404 404

  
405
    log.info('list_addresses %s', server_id)
405
    log.debug('list_addresses %s', server_id)
406 406
    vm = util.get_vm(server_id, request.user_uniq)
407 407
    addresses = [nic_to_dict(nic) for nic in vm.nics.all()]
408 408

  
......
424 424
    #                       itemNotFound (404),
425 425
    #                       overLimit (413)
426 426

  
427
    log.info('list_addresses_by_network %s %s', server_id, network_id)
427
    log.debug('list_addresses_by_network %s %s', server_id, network_id)
428 428
    machine = util.get_vm(server_id, request.user_uniq)
429 429
    network = util.get_network(network_id, request.user_uniq)
430 430
    nic = util.get_nic(machine, network)
......
447 447
    #                       badRequest (400),
448 448
    #                       overLimit (413)
449 449

  
450
    log.info('list_server_metadata %s', server_id)
450
    log.debug('list_server_metadata %s', server_id)
451 451
    vm = util.get_vm(server_id, request.user_uniq)
452 452
    metadata = dict((m.meta_key, m.meta_value) for m in vm.metadata.all())
453 453
    return util.render_metadata(request, metadata, use_values=True, status=200)
......
493 493
    #                       badRequest (400),
494 494
    #                       overLimit (413)
495 495

  
496
    log.info('get_server_metadata_item %s %s', server_id, key)
496
    log.debug('get_server_metadata_item %s %s', server_id, key)
497 497
    vm = util.get_vm(server_id, request.user_uniq)
498 498
    meta = util.get_vm_meta(vm, key)
499 499
    d = {meta.meta_key: meta.meta_value}
......
566 566
    #                       itemNotFound (404),
567 567
    #                       overLimit (413)
568 568

  
569
    log.info('server_stats %s', server_id)
569
    log.debug('server_stats %s', server_id)
570 570
    vm = util.get_vm(server_id, request.user_uniq)
571 571
    #secret = util.encrypt(vm.backend_vm_id)
572 572
    secret = vm.backend_vm_id      # XXX disable backend id encryption

Also available in: Unified diff