Attaching or Detaching an fGPU
You can attach a flexible GPU (fGPU) to a virtual machine (VM), and detach it at any time.
You can attach fGPUs only to VMs with the |
To be able to attach an fGPU, you must first allocate it to your account. For more information, see Allocating or Releasing an fGPU.
Linking or Unlinking an fGPU Using Cockpit v2
Linking an fGPU
-
In the Flexible GPUs dashboard, check the box of the fGPU you want to link to a VM.
The fGPU is selected. -
Click Link to a VM.
The LINK TO A VM dialog box appears. -
In the VM list, select the VM you want to link the fGPU to.
-
Click Link.
The fGPU is scheduled to be linked to the VM.To complete the linking of the fGPU, you need to do a stop/start of the VM. A simple restart is not sufficient, as the linking of the fGPU is done when the VM goes through the
stopped
state.For the difference between stop/start and restart, see About VM Lifecycle.
Unlinking a fGPU
-
In the Flexible GPUs dashboard, check the box of the fGPU you want to unlink from a VM.
The fGPU is selected. -
Click Unlink VM.
A confirmation dialog box appears. -
Click Unlink.
The fGPU is scheduled to be unlinked from its VM.To complete the unlinking of the fGPU, you need to do a stop/start of the VM. A simple restart is not sufficient, as the unlinking of the fGPU is done when the VM goes through the
stopped
state.For the difference between stop/start and restart, see About VM Lifecycle.
Linking or Unlinking an fGPU Using OSC CLI
Linking an fGPU
The LinkFlexibleGpu command attaches one of your allocated flexible GPUs (fGPUs) to one of your virtual machines (VMs).
To complete the linking of the fGPU, you need to do a stop/start of the VM. A simple restart is not sufficient, as the linking of the fGPU is done when the VM goes through the stopped
state. For the difference between stop/start and restart, see About VM Lifecycle.
You can attach fGPUs only to VMs with the |
$ osc-cli api LinkFlexibleGpu --profile "default" \
--FlexibleGpuId "fgpu-12345678" \
--VmId "i-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
FlexibleGpuId
: The ID of the fGPU you want to attach. -
VmId
: The ID of the VM you want to attach the fGPU to.
The LinkFlexibleGpu command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Unlinking an fGPU
The UnlinkFlexibleGpu command detaches a flexible GPU (fGPU) from a virtual machine (VM).
The fGPU is in the detaching
state until the VM is stopped, after which it becomes allocated
. It is then available again for attachment to a VM.
$ osc-cli api UnlinkFlexibleGpu --profile "default" \
--FlexibleGpuId "fgpu-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
FlexibleGpuId
: The ID of the fGPU you want to detach from your VM.
The UnlinkFlexibleGpu command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Linking or Unlinking an fGPU Using oapi-cli
Linking an fGPU
The LinkFlexibleGpu command attaches one of your allocated flexible GPUs (fGPUs) to one of your virtual machines (VMs).
To complete the linking of the fGPU, you need to do a stop/start of the VM. A simple restart is not sufficient, as the linking of the fGPU is done when the VM goes through the stopped
state. For the difference between stop/start and restart, see About VM Lifecycle.
You can attach fGPUs only to VMs with the |
$ oapi-cli --profile "default" LinkFlexibleGpu \
--FlexibleGpuId "fgpu-12345678" \
--VmId "i-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
FlexibleGpuId
: The ID of the fGPU you want to attach. -
VmId
: The ID of the VM you want to attach the fGPU to.
The LinkFlexibleGpu command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Unlinking an fGPU
The UnlinkFlexibleGpu command detaches a flexible GPU (fGPU) from a virtual machine (VM).
The fGPU is in the detaching
state until the VM is stopped, after which it becomes allocated
. It is then available again for attachment to a VM.
$ oapi-cli --profile "default" UnlinkFlexibleGpu \
--FlexibleGpuId "fgpu-12345678"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
FlexibleGpuId
: The ID of the fGPU you want to detach from your VM.
The UnlinkFlexibleGpu command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Related Pages
Corresponding API Methods