summaryrefslogtreecommitdiffstats
path: root/src/virtual
Commit message (Collapse)AuthorAgeFilesLines
* qmp: incorrect copyright headerOpenGnSys Support Team2024-04-021-7/+5
| | | | Replace incorrect copyright header in qmp.py file.
* src: change generic exception types to be more explicitAlejandro Sirgo Rica2024-03-212-9/+9
| | | | | | | | Replace exception types to be more explicit about the nature of the error. Improve the exception raising semantics by using the 'from' keyword, this wraps an older exception into a new one so it is still considered the same object.
* virtual: add missing check=True to subprocess.run()Alejandro Sirgo Rica2024-03-211-2/+2
| | | | | Raise exception from subprocess.run() calls as previous code is trying to capture these exceptions to handle de errors.
* src: improve loggingJose M. Guisado2022-06-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adds new logging handler redirecting messages to the log file located in the Samba shared directory (applies to live mode clients, i.e: ogLive) Parses log level configuration from ogclient.json. See: { "opengnsys": { ... "log": "INFO", ... } ... } Adds --debug option to set root logger level to DEBUG when starting ogClient. Overrides log level from config file. In addition: - Replaces any occurence of print with a corresponding logging function. - Unsets log level for handlers, use root logger level instead. - Default level for root logger is INFO. - Replaces level from response log messages to debug (ogRest)
* #1059 virtual: replace qmp polling for event listeningJose M. Guisado2021-09-013-8/+322
| | | | | | | | | | | | | | Polling for a qmp port availability is undesirable, as QEMU only handles one connection to the qmp port at a time, ogClient may interfere with cloneer-manager. Check vm thread now connects to a separate qmp tcp socket, listening for a shutdown guest event. When ogClient is run just after ogVDI installation (before guest installation) it will try to connect until it's possible, ie: after an iso is specified and a qemu vm is started that exposes the appropiate qmp tcp port.
* ogClient is AGPLv3+OpenGnSys Support Team2021-05-141-3/+3
| | | | Update license header in files.
* #995 Add link speed in probe responsesJose M. Guisado2021-05-041-0/+3
| | | | | | | | Separates probe method into separate ogclient modes (virtual, vdi) so future supported OS can easily have a tailored probe responses. Link speed is retrieved using a minimal ethtool command sent using fcntl module from python.
* #1008 Adapt virtual disk setup JSON formatJavier Sánchez Parra2020-11-191-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous commits updates ogClient and ogServer to support several disks in Linux (ogLive) mode. This changes disk setup JSON format from an object to an array. ogClient in virtual mode also need to satisfy this new format, although it not support several disks. Adapt ogClient virtual mode to satisfy new disk setup JSON format. Old format: "disk_setup": { "disk": 1, "partition": 0, "code": "0", "filesystem": "", "os": "", "size": 32685957, "used_size": 6 }, New format: "disk_setup": [ { "disk": 1, "partition": 0, "code": "0", "filesystem": "", "os": "", "size": 32685957, "used_size": 6 } ],
* Refresh partitions.json after image restoreRoberto Hueso Gómez2020-05-291-0/+1
| | | | | This is necessary for cloneer-manager to start the guest OS after the next reboot.
* Move check_vm_state_loop() into OgVirtualOperationsRoberto Hueso Gómez2020-05-261-0/+12
| | | | | | Improves code encapsulation by moving check_vm_state_loop method into OgVirtualOperations class. This also fixes import error when running ogclient in 'linux' mode.
* Handle other exceptions on virtual /refreshRoberto Hueso Gómez2020-05-191-0/+3
| | | | | | | Ths patch handles different cases when a /refresh request can be made. More specifically this handles the situation in which the VM is stopped when /refresh is called but it starts during the processing of /refresh, in this case we just send the last recorded setup.
* Refactor OgQMP and adapt operationsRoberto Hueso Gómez2020-05-191-55/+54
| | | | | | | | | | | This patch: - Fixes logic errors in the communication with QMP (the order of handshake messages was not right). - Rewrite parts of OgQMP class. - Enforces better coding practices by using Python's "context managers" to avoid forgeting an open socket in case exceptions occur. - Adapt virtual operations to the use of "context managers" using the "with" statement.
* Update filesystems on /refreshRoberto Hueso Gómez2020-05-181-0/+9
| | | | This updates partitions.json filesystems.
* Use virtio-vga to run VMsRoberto Hueso Gómez2020-05-181-2/+2
| | | | | | This is the device that has the best empirical performance right now and it seems like it is where most of the qemu development is directed towards for the future.
* Rename operation 'execCMD' to 'shellrun'Roberto Hueso Gómez2020-05-131-3/+2
| | | | This patch also ignores calls to shellrun when virtual mode is activated.
* Change permissions on virtual images for /refreshRoberto Hueso Gómez2020-05-131-1/+1
| | | | | Write permission is not needed to get information about each virtual drive so this patch changes permissions to 'only read'. This can prevent race conditions.
* Add VNC support for virtual mode VMsRoberto Hueso Gómez2020-05-131-7/+33
| | | | | This patch makes possible to interact with guest OS from a remote machine using VNC.
* Extend use of OG_PARTITIONS_CFG_PATH for /setup and /refreshRoberto Hueso Gómez2020-05-111-7/+4
| | | | | This is a refactor to consolidate the use of this single variable across all virtual operations.
* Poweroff when no VM and no jobs are runningRoberto Hueso Gómez2020-05-111-0/+26
| | | | | | This patch calls poweroff in virtual mode when no VM is running and no jobs are being executed. This is useful when the guest OS shutdowns so that the host OS does not continue to run.
* Add OgVM class to abstract VMsRoberto Hueso Gómez2020-04-281-9/+36
| | | | | This patch implements OgVM class. OgVM abstracts VM emulator from its operations.
* Poweroff VM before some operationsRoberto Hueso Gómez2020-04-281-22/+20
| | | | | | This patch includes changes to: - Poweroff VM before running operations that require access to virtual disks. - Poweroff VM before host system poweroff.
* Send last stored setup if VM is runningRoberto Hueso Gómez2020-04-281-6/+21
| | | | | When virtual mode is activated, send the last stored partitions setup because it is not possible to access a running virtual drive to get its information.
* Add OgQMP recv methodRoberto Hueso Gómez2020-04-281-1/+23
| | | | | | recv method is useful for receiving information that was not previously requested (such as "events"). This patch also implements automatic handshake on OgQMP by sending an "qmp_capabilities" request.
* Fix disk used size calculationRoberto Hueso Gómez2020-04-281-1/+1
| | | | | This patch calculates correctly the percentage of disk used. This could cause an overflow on the ogAdmSever DB.
* Control errors in OgQMP for virtual modeRoberto Hueso Gómez2020-04-221-59/+78
| | | | | This patch handles possible communication errors between ogclient and Qemu when making QMP requests.
* Avoid writting /software output to a fileRoberto Hueso Gómez2020-04-171-5/+1
|
* Use samba for create and restore virtual partitionsRoberto Hueso Gómez2020-04-171-2/+15
| | | | This requires to configure user and password for samba repositories.
* Use libguestfs for virtual setupRoberto Hueso Gómez2020-04-171-11/+12
|
* Use libguestfs for virtual refreshRoberto Hueso Gómez2020-04-171-14/+30
|
* Transform absolute paths into relative paths for virtual modeRoberto Hueso Gómez2020-04-171-15/+26
|
* Add placeholder for virtual execCMDRoberto Hueso Gomez2020-04-131-0/+4
|
* Use 75% of disk space in virtual modeRoberto Hueso Gomez2020-04-081-0/+3
|
* Encapsulate operations in classesRoberto Hueso Gomez2020-04-081-317/+318
|
* Add virtual operationsRoberto Hueso Gomez2020-04-072-0/+403