Thank you!
Posts made by davide1611
-
RE: How to understand if host is up or down using API?
@Tom-Elliott Thanks for your feedback. Everything very clear.
Last thing, I receive from GET: /fog/host the field pingstatus as an HTML tag:"pingstatus": "<i class=\\"icon-ping-fos fa fa-cogs green\\" data-toggle=\\"tooltip\\" data-placement=\\"right\\" title=\\"FOS\\"><\\/i>",
Do you know why it is HTML tag rather than an error code? Thanks.
-
RE: How to understand if host is up or down using API?
@george1421 Yes it should be easier but I prefer to work through FOG APIs.
Make use of ping from my script directly to VM would result to get access to VM from two different point: the script and the FOG server and it may be complicated to manage.When I call GET on /fog/host I receive a JSON with a key-value field “ip”:“” but it’s always empty. Resolving this (understanding why it is always empty), I would only receive the IP when the host is up. Or another field?
-
How to understand if host is up or down using API?
I’m using VirtualBox 6.0.14 where there is an ubuntu 18:04 machine with FOG server, DHCP server and DNS.
I need to know when a VM is up or down using API. I see in the host management panel when the host is up a green indicator icon and when I step over it the word FOS appears. It appears after the configuration of DNS.
I would like to query FOG server and receive an information about its status but if I do this using python:r = requests.get(ip_address+'/fog/host', headers=headers) print('RESPONSE: ',r.content)
I cannot see difference between when the host is down or up.
Does anyone know how can I do, please? -
RE: Turn on/off VM on VirtualBox using APIs
@george1421 ok, could be a way to solve the problem! Thank you!
-
Turn on/off VM on VirtualBox using APIs
Hi everyone!
I have installed on windows10, VirtualBox 6.0.14 where there are VMs:
- Ubuntu 18:04 with FOG server and DHCP server --> server
- Ubuntu 18:04 --> client
I installed on the client the OS through NFS and everything works.
My goal is to turn on/off the client through APIs using WOL.
First, a question that’s not properly of this forum but maybe someone has already encountered this difficulty: Is it possible to do that? I mean, can I turn on/off VM on VBox from FOG server? Reading the forum the function is not enabled by Virtualbox but maybe there is a way to circumvent it.
-
If it’s not possible: should someone advise me a solution to test the turn on/off machine? LXC? I could move on from VBox because I need just to test this solution and in the future move to physical machines. Nevertheless, I prefer to use VBox if it’s possible.
-
If it’s possible: I think to create an “empty” snapin using WOL:true (to turn on) or shutdown:true (to turn off). Does it make sense?
I posted a similar question but it had some gaps so I preferred to post it more detailed.
Thanks to the community!
-
RE: Get HTML response instead JSON using API
Solved! Remember to check the checkbox: API enabled
-
RE: Get HTML response instead JSON using API
I’m running the latest stable version: 1.5.8
-
Get HTML response instead JSON using API
Hi everyone,
I’m implementing a script to query my FOG server looking the documentation at https://news.fogproject.org/simplified-api-documentation/When I make a GET request:
curl -H 'fog-api-token: my_api_token' -H 'fog-user-token: my_fog_user' -X GET http://192.168.1.1/fog/task/current -o list.json
List.json remain empty and on console get:
Using postman I found out that the result is an HTML file.
Using python
import requests usertoken='my_user_token' apitoken='my_api_token' headers = {'fog-user-token': usertoken, 'fog-api-token':apitoken } r = requests.get('http://192.168.1.1/fog/task/current', params=headers) print(r.url)
The script print
http://192.168.1.1/fog/management/index.php
Need I to modify something on FOG server configuration? I would like to get my current task via JSON file.
Thanks! -
RE: Turn VM on and off from FOG server
Yes! I solved moving to physical machine rather than using VBox, thanks for your help Eduardo.
-
RE: Turn VM on and off from FOG server
@EduardoTSeoane It doesn’t work, probably because I’m using windows10 and it’s not supported. Nevertheless, my focus is another. I need to control remotely the VM and turn on/off them using a particular software created by me. My goal is to find a way to turn on/off VM using some kind of APIs.
I’m quite struggling to find a way to interface my software. Especially if it’s not possible through FOG… I think that should be a way -
RE: Turn VM on and off from FOG server
@EduardoTSeoane Thanks.
I also found Wake-up task but when I launch it nothing happen. I think that I should see that the VM turn on from the VBox panel, do I?
Probably something goes wrong, What can I do to check where is the error?
Sorry but I’m quite inexperienced -
Turn VM on and off from FOG server
Hi everyone,
I’m using virtualbox 6.0.14. I created an internal network with a ubuntu 18:04 machine where FOG server run. I also added a new host where I deployed an ubuntu image. Unfortunately, I didn’t understand if it is possible to turn on/off the host directly from FOG dashboard. To try, I created a debug task but I need to switch on the machine to get in the control panel of debug mode and execute command. could anyone help me, please?
If it’s possible, are there any APIs to do that? I need to implement my custom software to turn on/off VM.
Thanks!
-
RE: No configuration methods succeeded: DHCP failed
@Sebastian-Roth Yes, it was that! Thanks Sebastian and sorry for asking something already resolved
-
No configuration methods succeeded: DHCP failed
On my windows 10 PC, I installed Virtualbox with two machines:
- ubuntu 18:04
- minimal distribution (SLAX)
My goal is to deploy SLAX image and manage the machine.
I’m not able to shutdown my local DHCP so, what I did is to set two different interfaces on ubuntu: one via NAT and the second using internal network. In UBUNTU I also assigned a static ip to internal network (192.168.1.1). Now, I install FOG server with DHCP, this are the option that I’ve choosen:
Should the installer try to disable the local firewall for you now? (y/N) N
What type of installation would you like to do? [N/s (Normal/Storage)] N
We found the following interfaces on your system:
* enp0s3 - 10.0.2.15/24
* enp0s8 - 192.168.1.1/24Would you like to change the default network interface from enp0s3?
If you are not sure, select No. [y/N] Y
What network interface would you like to use? enp0s8Would you like to setup a router address for the DHCP server? [Y/n] Y
What is the IP address to be used for the router on
the DHCP server? [10.0.2.2]192.168.1.1Would you like DHCP to handle DNS? [Y/n] N
Would you like to use the FOG server for DHCP service? [y/N] Y
This version of FOG has internationalization support, would
you like to install the additional language packs? [y/N] nWould you like to enable secure HTTPS on your FOG server? [y/N] n
Would you like to change it? If you are not sure, select No. [y/N] n
Here are the settings FOG will use:
- Base Linux: Debian
- Detected Linux Distribution: Ubuntu
- Interface: enp0s8
- Server IP Address: 192.168.1.1
- Server Subnet Mask: 255.255.255.0
- Server Hostname: davide-VirtualBox
- Installation Type: Normal Server
- Internationalization: 0
- Image Storage Location: /images
- Using FOG DHCP: Yes
- DHCP router Address: 192.168.1.1
Now, the installation works and I’m able to connect to FOG dashboard via http://192.168.1.1/fog/management
Now, I manage the SLAX virtual machine configuration through Virtualbox. I set in the network section internal network as I defined before and in the System part I set Network as the unique starting point. It’s time to start the machine. The DHCP works, in fact it gets an IP andress and then in the FOG project panel. I choose perform full host registration and inventory
I’ve choosen the hostname and no image. No groups, No snapins, No product key, No domain, set a username, first tag=1, second tag=2, deploy image now Y, insert credential and then automatically reboot.
It seems everything works, but after reboot:I tried to be as precise as possible.
Maybe a DHCP problem? I’m not sure about that.
Thanks to everyone!