def _create(self, vmware_vm, vm_properties): vm_model = VirtualMachineModel(vmware_vm, vm_properties) self._database.vmis_to_update += vm_model.vmi_models self._add_property_filter_for_vm(vm_model, vmware_vm, VM_UPDATE_FILTERS) self._update_in_vnc(vm_model.vnc_vm) logger.info('Created %s', vm_model) self._database.save(vm_model)
def test_init(vmware_vm_1, vm_properties_1): vm_model = VirtualMachineModel(vmware_vm_1, vm_properties_1) assert vmware_vm_1.config.hardware.device is vm_model.devices assert vm_model.uuid == 'vmware-vm-uuid-1' assert vm_model.name == 'VM1' assert vm_model.is_powered_on assert vm_model.tools_running
def vm_model_2(vmware_vm_2, vm_properties_2): model = VirtualMachineModel(vmware_vm_2, vm_properties_2) model.property_filter = Mock() return model