Remote access
Last modified by Hostkey Admin on 2022/07/14 11:33
Bare-metal servers
If the server is equipped with IPMI, we could provide direct access there. All our servers have IPMI in the gray IP range. We provide NAT on-demand to external IPs for 2 hours to perform necessary operations.
Async keys for all NAT operations should be checked with nat_callback.php, i.e.
https://invapi.hostkey.com/nat_callback.php?action=check&key=XXXX
Remote access actions for bare-metal:
Resource | Action | Description |
---|---|---|
nat.php | add_static_nat | Create static DNAT pass-through rule to server's IPMI (public IP to access IPMI of the server) |
nat.php | remove_static_nat | Remove static DNAT pass-through to server's IPMI |
eq.php | add_ipmi_user | Create temp IPMI user for IPMI web access |
eq.php | remove_ipmi_user | Remove temp IPMI user for IPMI web access |
eq.php | unit_reset | Reset IPMI module |
Nat/Add_static_nat
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | add_static_nat | Main action - create static DNAT pass-through rule to server's IPMI (public IP to access IPMI of the server) |
token | * | string | Your session token | |
id | * | int | Your server ID | |
pin | * | int | Your PIN code |
curl -s "https://invapi.hostkey.com/nat.php" -X POST \
--data "action=add_static_nat" \
--data "token=" \
--data "id=" \
--data "pin="
--data "action=add_static_nat" \
--data "token=" \
--data "id=" \
--data "pin="
Nat/Remove_static_nat
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | remove_static_nat | Main action - remove static DNAT pass-through to server's IPMI |
token | * | string | Your session token | |
id | * | int | Your server ID |
curl -s "https://invapi.hostkey.com/nat.php" -X POST \
--data "action=remove_static_nat" \
--data "token=" \
--data "id="
--data "action=remove_static_nat" \
--data "token=" \
--data "id="
Eq/Add_ipmi_user
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | add_ipmi_user | Main action - create temp IPMI user for IPMI web access |
token | * | string | Your session token | |
id | * | int | Your server ID |
curl -s "https://invapi.hostkey.com/eq.php" -X POST \
--data "action=add_ipmi_user" \
--data "token=" \
--data "id="
--data "action=add_ipmi_user" \
--data "token=" \
--data "id="
Eq/Remove_ipmi_user
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | remove_ipmi_user | Main action - remove temp IPMI user for IPMI web access |
token | * | string | Your session token | |
id | * | int | Your server ID |
curl -s "https://invapi.hostkey.com/eq.php" -X POST \
--data "action=remove_ipmi_user" \
--data "token=" \
--data "id= "
--data "action=remove_ipmi_user" \
--data "token=" \
--data "id= "
Eq/Unit_reset
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | unit_reset | Main action - reset IPMI module. In some cases it's necessary to reset the IPMI module, it may fall unresponsive or failed to perform some operations. Cold reset may help |
token | * | string | Your session token | |
id | * | int | Your server ID | |
pin | * | int | Your PIN code |
curl -s "https://invapi.hostkey.com/eq.php" -X POST \
--data "action=unit_reset" \
--data "token=" \
--data "id=" \
--data "pin="
--data "action=unit_reset" \
--data "token=" \
--data "id=" \
--data "pin="
Virtual servers
Remote access actions for Virtual Machines:
Resource | Action | Description |
---|---|---|
eq.php | console | Get access to VM console |
Eq/Console
HTTP Method - POST
Parameter | Required | Type | Value/default | Description |
---|---|---|---|---|
action | * | string | console | Main action - get access to VM console |
token | * | string | Your session token | |
id | * | int | Your server ID | |
pin | * | int | Your PIN code |
curl -s "https://invapi.hostkey.com/eq.php" -X POST \
--data "action=console" \
--data "token=" \
--data "id=" \
--data "pin="
--data "action=console" \
--data "token=" \
--data "id=" \
--data "pin="
Data from scope should be stored in console.vv file for virtual machine viewer or accessed other way via VNC
Following JS code do this action:
var blob = new Blob([result.scope], {
type: 'text/octet-stream'
});
var filename = "console.vv";
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, "console.vv");
} else {
var elem = document.createElement('a');
elem.href = window.URL.createObjectURL(blob);
elem.download = filename;
document.body.appendChild(elem);
elem.click();
document.body.removeChild(elem);
}
type: 'text/octet-stream'
});
var filename = "console.vv";
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveBlob(blob, "console.vv");
} else {
var elem = document.createElement('a');
elem.href = window.URL.createObjectURL(blob);
elem.download = filename;
document.body.appendChild(elem);
elem.click();
document.body.removeChild(elem);
}