3.16. Starting a Virtual Machine with Specific Boot Devices and Boot Order
Ce contenu n'est pas disponible dans la langue sélectionnée.
3.16. Starting a Virtual Machine with Specific Boot Devices and Boot Order
This Ruby example starts a virtual machine specifying the boot devices and boot order.
Find the root of the tree of services:
Find the virtual machine:
Find the service that manages the virtual machine:
Start the virtual machine explicitly indicating the boot devices and order:
Wait until the virtual machine is up:
# Find the root of the tree of services:
system_service = connection.system_service
# Find the virtual machine:
vms_service = system_service.vms_service
vm = vms_service.list(search: 'name=myvm').first
# Find the service that manages the virtual machine:
vm_service = vms_service.vm_service(vm.id)
# Start the virtual machine explicitly indicating the boot devices and order:
vm_service.start(
vm: {
os: {
boot: {
devices: [
OvirtSDK4::BootDevice::NETWORK,
OvirtSDK4::BootDevice::CDROM
]
}
}
}
)
# Wait until the virtual machine is up:
loop do
sleep(5)
vm = vm_service.get
break if vm.status == OvirtSDK4::VmStatus::UP
end
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.
Rendre l’open source plus inclusif
Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.
À propos de Red Hat
Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.