From a14dc05986fc4ddf25d62810da0163cfda080fe7 Mon Sep 17 00:00:00 2001 From: jfankam Date: Wed, 21 May 2025 13:18:49 -0400 Subject: [PATCH 1/3] python warning and guide restructuring --- .../using-vsphere-sdk/guide.de-de.md | 76 ++++++++------- .../using-vsphere-sdk/guide.en-asia.md | 72 +++++++------- .../using-vsphere-sdk/guide.en-au.md | 70 +++++++------ .../using-vsphere-sdk/guide.en-ca.md | 70 +++++++------ .../using-vsphere-sdk/guide.en-gb.md | 70 +++++++------ .../using-vsphere-sdk/guide.en-ie.md | 70 +++++++------ .../using-vsphere-sdk/guide.en-sg.md | 70 +++++++------ .../using-vsphere-sdk/guide.en-us.md | 70 +++++++------ .../using-vsphere-sdk/guide.es-es.md | 88 ++++++++--------- .../using-vsphere-sdk/guide.es-us.md | 88 ++++++++--------- .../using-vsphere-sdk/guide.fr-ca.md | 93 +++++++++--------- .../using-vsphere-sdk/guide.fr-fr.md | 93 +++++++++--------- .../using-vsphere-sdk/guide.it-it.md | 80 +++++++-------- .../using-vsphere-sdk/guide.pl-pl.md | 77 +++++++-------- .../using-vsphere-sdk/guide.pt-pt.md | 72 +++++++------- .../vmware_installation_api/guide.de-de.md | 86 ++++++++-------- .../vmware_installation_api/guide.en-asia.md | 78 ++++++++------- .../vmware_installation_api/guide.en-au.md | 78 ++++++++------- .../vmware_installation_api/guide.en-ca.md | 78 ++++++++------- .../vmware_installation_api/guide.en-gb.md | 78 ++++++++------- .../vmware_installation_api/guide.en-ie.md | 78 ++++++++------- .../vmware_installation_api/guide.en-sg.md | 78 ++++++++------- .../vmware_installation_api/guide.en-us.md | 78 ++++++++------- .../vmware_installation_api/guide.es-es.md | 97 ++++++++++--------- .../vmware_installation_api/guide.es-us.md | 97 ++++++++++--------- .../vmware_installation_api/guide.fr-ca.md | 96 +++++++++--------- .../vmware_installation_api/guide.fr-fr.md | 96 +++++++++--------- .../vmware_installation_api/guide.it-it.md | 89 +++++++++-------- .../vmware_installation_api/guide.pl-pl.md | 90 ++++++++--------- .../vmware_installation_api/guide.pt-pt.md | 81 ++++++++-------- 30 files changed, 1222 insertions(+), 1215 deletions(-) diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md index 03da5325946..87cf856995c 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md @@ -1,7 +1,7 @@ --- title: vSphere SDK verwenden excerpt: Erfahren Sie hier, wie Sie das vSphere SDK einrichten und verwenden -updated: 2020-11-18 +updated: 2025-05-21 --- ## Ziel @@ -10,47 +10,55 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w **Diese Anleitung erklärt, wie Sie das vSphere SDK in verschiedenen Programmiersprachen einrichten und verwenden.** +## Voraussetzungen + +- Sie sind in Ihrem [OVHcloud Kundencenter](/links/manager) angemeldet. +- Eine virtuelle Maschine, die mit einem unserer [OVF-Templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) erstellt wurde. + + +> [!warning] +> Die folgenden Codebeispiele wurden mit Python 2.7 erstellt. Bitte beachten Sie, dass Sie Ihre Bestellungen möglicherweise anpassen müssen, wenn Ihre Umgebung Debian 12 verwendet. In diesem Fall empfehlen wir Ihnen, die neueste Version von Python 3 herunterzuladen. +> + ## In der praktischen Anwendung ### Python #### Umgebung einrichten -##### Betriebssystem - -Dieses Beispiel verwendet eine auf Debian 9 installierte VM, die mithilfe der [für Ihre Managed Bare Metal bereitgestellten Templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) deployt wurde. - -##### Voraussetzungen +Dieses Beispiel verwendet eine mit Debian 9 installierte VM, die aus [Templates für Ihre Managed Bare Metal Infrastruktur verfügbar](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) bereitgestellt wird. Folgende Pakete müssen installiert werden: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK + +#### vSphere SDK Laden Sie das vSphere SDK mit folgendem Befehl herunter: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Das Verzeichnis “/vsphere-automation-sdk-python” wird erstellt. Gehen Sie in diesen Ordner, um den Installationsbefehl auszuführen: -``` +Das Verzeichnis `/vsphere-automation-sdk-python` wird erstellt. Wechseln Sie zu diesem Ordner, um den Installationsbefehl auszuführen: + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -Im vorliegenden Beispiel handelt es sich um folgenden Befehl: +In diesem Beispiel ist dies der folgende Befehl: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Sobald das SDK installiert ist, können Sie Skripte verwenden. -#### Skriptbeispiel +### Beispielskript -##### Verbindung +#### Verbindung Dieses Beispiel testet Login und Logout von vCenter. Hierbei können Sie auch überprüfen, ob alles korrekt installiert ist: @@ -83,7 +91,7 @@ print("Disconnecting..") vconnect() ``` -##### VMs einer Managed Bare Metal auflisten +#### Auflisten der in Managed Bare Metal vorhandenen VMs In diesem Beispiel werden alle VMs in der Managed Bare Metal aufgelistet: @@ -132,27 +140,23 @@ vconnect() #### Umgebung einrichten -##### Betriebssystem - -Wir verwenden hier eine auf Ubuntu 18.04 installierte VM, die mithilfe der [für Ihre Managed Bare Metal bereitgestellten Templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) deployt wurde. - -##### Voraussetzungen +Dieses Beispiel verwendet eine mit Ubuntu 18.04 installierte VM, die aus [Templates für Ihre Managed Bare Metal Infrastruktur verfügbar](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) bereitgestellt wird. Folgende Pakete müssen installiert werden: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils ``` -##### vSphere SDK +#### vSphere SDK Laden Sie das vSphere SDK über folgenden Link herunter: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Stellen Sie sicher, dass es sich um die mit Ihrem Betriebssystem kompatible Version handelt. @@ -160,17 +164,17 @@ In diesem Beispiel ist die heruntergeladene Datei: “VMware-vSphere-Perl-SDK-6. Extrahieren Sie die soeben heruntergeladene Datei mit folgendem Befehl: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Starten Sie den Installer mit den folgenden Befehlen: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -180,9 +184,9 @@ Nach der Installation werden weitere Module installiert. Drücken Sie auf `Enter Um die Installation abzuschließen, muss ein Verzeichnis ausgewählt werden, in dem das SDK installiert wird. Standardmäßig ist dieses Verzeichnis “/usr/bin”. -#### Skriptbeispiel +### Beispielskript -##### Verbindung +#### Verbindung Dieses Beispiel testet Login und Logout von vCenter. Hierbei können Sie auch überprüfen, ob alles korrekt installiert ist: @@ -205,7 +209,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### VMs einer Managed Bare Metal auflisten +#### Auflisten der in Managed Bare Metal vorhandenen VMs Dieses Beispiel listet alle VMs einer Managed Bare Metal Infrastruktur auf: @@ -237,23 +241,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Samples verwenden +#### Samples verwenden -Im vorliegenden Beispiel wird ein bereits erstelltes Skript aus dem Verzeichnis “vmware-vsphere-cli-distrib/apps/vm/” aufgerufen. +Im vorliegenden Beispiel wird ein bereits erstelltes Skript aus dem Verzeichnis `vmware-vsphere-cli-distrib/apps/vm/` aufgerufen. Hier ist die Liste der Skripte, die bereits in diesem Verzeichnis verfügbar sind: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` Um einen Snapshot "test" der VM "Debian1" zu erstellen, verwenden Sie diesen Befehl (vorher die Platzhalter mit Ihren Anmeldeinformationen ersetzen): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Weiterführende Informationen -Für den Austausch mit unserer User Community gehen Sie auf . +Für den Austausch mit unserer [User Community](/links/community). diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-asia.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-asia.md index c9767fcce16..dafc580609f 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-asia.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-asia.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -10,49 +10,55 @@ Actions within your infrastructure can be automated using the vSphere SDK. **This guide explains the implementation and usage in various programming languages.** +## Requirements + +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ## Instructions ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +91,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +140,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +164,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +184,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +209,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +241,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-au.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-au.md index c9767fcce16..07a8558a604 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-au.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-au.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +89,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +207,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ca.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ca.md index c9767fcce16..07a8558a604 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ca.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ca.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +89,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +207,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-gb.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-gb.md index c9767fcce16..07a8558a604 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-gb.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-gb.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +89,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +207,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ie.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ie.md index c9767fcce16..07a8558a604 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ie.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-ie.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +89,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +207,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-sg.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-sg.md index c9767fcce16..07a8558a604 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-sg.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-sg.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +89,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +207,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-us.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-us.md index c9767fcce16..07a8558a604 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-us.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.en-us.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> The code examples below were created using Python 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -85,7 +89,7 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Managed Bare Metal infrastructure](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,7 +207,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Managed Bare Metal infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure This example lists all VMs of a Managed Bare Metal infrastructure. @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-es.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-es.md index 1c3e1d0eb55..d34a3d02968 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-es.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-es.md @@ -1,14 +1,23 @@ --- title: Usar el conjunto de librerías vSphere SDK -excerpt: Instrumentación y uso del conjunto de librerías vSphere SDK -updated: 2020-11-18 +excerpt: Cómo implementar y utilizar vSphere SDK +updated: 2025-05-21 --- ## Objetivo -Es posible automatizar las acciones en su infraestructura utilizando el conjunto de librerías vSphere SDK. +Las acciones en su infraestructura pueden automatizarse gracias al SDK vSphere. -**En esta guía, se explica la instrumentación y el uso en varios idiomas.** +**Esta guía explica la implementación y el uso en diferentes lenguajes de programación.** + +## Requisitos + +- Estar conectado a su [área de cliente de OVHcloud](/links/manager). +- Una máquina virtual creada con uno de nuestros [templates OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + +> [!warning] +> Los ejemplos de código siguientes se crearon utilizando Python 2.7. Tenga en cuenta que, si su entorno utiliza Debian 12, es posible que tenga que ajustar sus pedidos en consecuencia. En ese caso, le recomendamos que descargue la última versión de Python 3. +> ## Procedimiento @@ -16,45 +25,41 @@ Es posible automatizar las acciones en su infraestructura utilizando el conjunto #### Instrumentación del entorno -##### S. O. - En esta guía, utilizaremos una máquina virtual instalada en Debian 9, instrumentada a partir de [las plantillas disponibles en su Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requisitos - Se deben instalar los siguientes paquetes: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK con el siguiente comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Se creará el directorio «/vsphere-automation-sdk-python». Acceda a la carpeta correspondiente para ejecutar el comando de instalación: +Se creará el directorio `/vsphere-automation-sdk-python`. Acceda a la carpeta correspondiente para ejecutar el comando de instalación: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` En este ejemplo, el comando es el siguiente: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -El kit de desarrollo de software (SDK) ya está instalado. Ahora podemos ejecutar algunas secuencias de comandos. +Una vez instalado el SDK, puede utilizar scripts. -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión -En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. +En este primer ejemplo, probamos la conexión y la desconexión al vCenter. También podrá comprobar si todo se ha instalado correctamente: ```python #!/usr/bin/env python @@ -85,7 +90,7 @@ print("Disconnecting..") vconnect() ``` -##### Ver un listado de las máquinas virtuales en un Managed Bare Metal +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: @@ -134,29 +139,23 @@ vconnect() #### Instrumentación del entorno -##### S. O. - -En esta guía, utilizaremos una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +En este ejemplo se utiliza una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requisitos +En primer lugar, deberá instalar los siguientes paquetes: -Se deben instalar los siguientes paquetes: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK en este enlace: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Descargue la versión compatible con su sistema operativo. @@ -164,31 +163,31 @@ En este ejemplo, vamos a descargar «VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_6 Utilice el siguiente comando para descomprimir el archivo que acaba de descargar: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Utilice el siguiente comando para iniciar el instalador: -``` +```bash cd vmware-vsphere-cli-distrib ``` Y luego: -``` +```bash ./vmware-install.pl ``` -Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `«Aceptar»`{.action}. +Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `Enter`{.action}. -Al final de la instalación, se instalarán otros módulos. Haga clic en `«Aceptar»`{.action} para continuar con la instalación. +Al final de la instalación, se instalarán otros módulos. Haga clic en `Enter`{.action} para continuar con la instalación. Para completar la instalación, debe seleccionar un directorio en el que se instalará el kit de desarrollo de software (SDK). El directorio por defecto es «/usr/bin». -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. @@ -211,7 +210,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Ver un listado de las máquinas virtuales en un Managed Bare Metal +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: @@ -243,24 +242,25 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Uso de muestras +#### Uso de muestras -En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio «vmware-vsphere-cli-distrib/apps/vm/». +En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio `vmware-vsphere-cli-distrib/apps/vm/`. Esta es la lista de secuencias de comandos disponibles en este directorio: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` + Vamos a crear la instantánea «test» en la máquina virtual «Debian 1» Para ello, escriba el siguiente comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Más información -Interactúe con nuestra comunidad de usuarios en . +Interactúe con nuestra [comunidad de usuarios](/links/community). diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-us.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-us.md index 1c3e1d0eb55..3093f53f088 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-us.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.es-us.md @@ -1,14 +1,23 @@ --- title: Usar el conjunto de librerías vSphere SDK -excerpt: Instrumentación y uso del conjunto de librerías vSphere SDK -updated: 2020-11-18 +excerpt: Cómo implementar y utilizar vSphere SDK +updated: 2025-05-21 --- ## Objetivo -Es posible automatizar las acciones en su infraestructura utilizando el conjunto de librerías vSphere SDK. +Las acciones en su infraestructura pueden automatizarse gracias al SDK vSphere. -**En esta guía, se explica la instrumentación y el uso en varios idiomas.** +**Esta guía explica la implementación y el uso en diferentes lenguajes de programación.** + +## Requisitos + +- Estar conectado a su [área de cliente de OVHcloud](/links/manager). +- Una máquina virtual creada con uno de nuestros [templates OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + +> [!warning] +> Los ejemplos de código siguientes se crearon utilizando Python 2.7. Tenga en cuenta que, si su entorno utiliza Debian 12, es posible que tenga que ajustar sus pedidos en consecuencia. En ese caso, le recomendamos que descargue la última versión de Python 3. +> ## Procedimiento @@ -16,45 +25,41 @@ Es posible automatizar las acciones en su infraestructura utilizando el conjunto #### Instrumentación del entorno -##### S. O. - En esta guía, utilizaremos una máquina virtual instalada en Debian 9, instrumentada a partir de [las plantillas disponibles en su Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requisitos - Se deben instalar los siguientes paquetes: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK con el siguiente comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Se creará el directorio «/vsphere-automation-sdk-python». Acceda a la carpeta correspondiente para ejecutar el comando de instalación: +Se creará el directorio `/vsphere-automation-sdk-python`. Acceda a la carpeta correspondiente para ejecutar el comando de instalación: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` En este ejemplo, el comando es el siguiente: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -El kit de desarrollo de software (SDK) ya está instalado. Ahora podemos ejecutar algunas secuencias de comandos. +Una vez instalado el SDK, puede utilizar scripts. -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión -En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. +En este primer ejemplo, probamos la conexión y la desconexión al vCenter. También podrá comprobar si todo se ha instalado correctamente: ```python #!/usr/bin/env python @@ -85,7 +90,7 @@ print("Disconnecting..") vconnect() ``` -##### Ver un listado de las máquinas virtuales en un Managed Bare Metal +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: @@ -134,29 +139,23 @@ vconnect() #### Instrumentación del entorno -##### S. O. - -En esta guía, utilizaremos una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +En este ejemplo se utiliza una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Requisitos +En primer lugar, deberá instalar los siguientes paquetes: -Se deben instalar los siguientes paquetes: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK en este enlace: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Descargue la versión compatible con su sistema operativo. @@ -164,31 +163,31 @@ En este ejemplo, vamos a descargar «VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_6 Utilice el siguiente comando para descomprimir el archivo que acaba de descargar: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Utilice el siguiente comando para iniciar el instalador: -``` +```bash cd vmware-vsphere-cli-distrib ``` Y luego: -``` +```bash ./vmware-install.pl ``` -Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `«Aceptar»`{.action}. +Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `Enter`{.action}. -Al final de la instalación, se instalarán otros módulos. Haga clic en `«Aceptar»`{.action} para continuar con la instalación. +Al final de la instalación, se instalarán otros módulos. Haga clic en `Enter`{.action} para continuar con la instalación. Para completar la instalación, debe seleccionar un directorio en el que se instalará el kit de desarrollo de software (SDK). El directorio por defecto es «/usr/bin». -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. @@ -211,7 +210,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Ver un listado de las máquinas virtuales en un Managed Bare Metal +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: @@ -243,24 +242,25 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Uso de muestras +#### Uso de muestras -En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio «vmware-vsphere-cli-distrib/apps/vm/». +En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio `vmware-vsphere-cli-distrib/apps/vm/`. Esta es la lista de secuencias de comandos disponibles en este directorio: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` + Vamos a crear la instantánea «test» en la máquina virtual «Debian 1» Para ello, escriba el siguiente comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Más información -Interactúe con nuestra comunidad de usuarios en . +Interactúe con nuestra [comunidad de usuarios](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-ca.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-ca.md index ba2d6c83f98..b551d11eef9 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-ca.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-ca.md @@ -1,14 +1,24 @@ --- title: Utilisation SDK vSphere -excerpt: Utilisation et mise en place du SDK vSphere -updated: 2020-11-18 +excerpt: Découvrez comment implémenter et utiliser le SDK vSphere +updated: 2025-05-21 --- ## Objectif -Il est possible d'automatiser les actions au sein de votre infrastructure en utilisant le SDK vSphere. +Les actions au sein de votre infrastructure peuvent être automatisées grâce au SDK vSphere. -**Ce guide explique la mise en place et l'utilisation dans différents langages.** +**Ce guide explique la mise en œuvre et l'utilisation dans différents langages de programmation.** + +## Prérequis + +- Être connecté à votre [espace client OVHcloud](/links/manager). +- Une machine virtuelle créée avec l’un de nos [templates OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> Les exemples de code ci-dessous ont été créés en utilisant Python 2.7. Veuillez noter que vous devrez peut-être ajuster vos commandes en conséquence si votre environnement utilise Debian 12. Dans ce cas, nous vous recommandons de télécharger la dernière version de Python 3. +> ## En pratique @@ -16,41 +26,38 @@ Il est possible d'automatiser les actions au sein de votre infrastructure en uti #### Mise en place de l'environnement -##### OS - -Ici nous utilisons une VM installée sur Debian 9, déployée depuis [les templates mis à disposition sur votre Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +Cet exemple utilise une VM installée avec Debian 9, déployée à partir de [templates disponibles pour votre infrastructure Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Prérequis +Pour commencer, il est nécessaire d'installer ces packages : -Il est nécessaire d'installer les paquets suivants : - -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere avec la commande suivante : -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Le répertoire « /vsphere-automation-sdk-python » sera créé, rendez vous dans ce dossier pour effectuer la commande d'installation : -``` +Le répertoire `/vsphere-automation-sdk-python` sera créé. Basculez vers ce dossier pour exécuter la commande d'installation : + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -Dans cet exemple, il s'agira de la commande suivante : +Dans cet exemple, il s'agit de la commande suivante : -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -Le SDK est à présent installé, nous pouvons maintenant réaliser quelques scripts. +Une fois le SDK installé, vous pouvez utiliser des scripts. -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -83,7 +90,7 @@ print("Disconnecting..") vconnect() ``` -##### Lister les VM présentes dans un Managed Bare Metal +#### Lister les VM présentes dans un Managed Bare Metal Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : @@ -132,49 +139,45 @@ vconnect() #### Mise en place de l'environnement -##### OS - -Ici nous utilisons une VM installée sur Ubuntu 18.04, déployée depuis [les templates mis à disposition sur votre Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +Cet exemple utilise une VM installée avec Ubuntu 18.04, déployée à partir de [templates disponibles pour votre infrastructure Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Prérequis -Il est nécessaire d'installer les paquets suivants : +Pour commencer, il est nécessaire d'installer ces packages : -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere disponible sur ce lien : -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Téléchargez la version compatible avec votre système d'exploitation. -Dans cet exemple, nous téléchargerons "VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz" +Dans cet exemple, le fichier téléchargé est : « VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz » Décompressez le ficher que vous venez de télécharger en utilisant la commande : -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` -Et démarrez l'installeur en utilisant la commande suivante : +Lancez le programme d'installation à l'aide des commandes suivantes : -``` +```bash cd vmware-vsphere-cli-distrib ``` Puis : -``` +```bash ./vmware-install.pl ``` @@ -182,11 +185,11 @@ Après avoir lu les conditions, acceptez-les et continuez en cliquant sur `Entr A la suite de l'installation, d'autres modules vont être installés, cliquez sur `Entrée`{.action} pour continuer l'installation. -Afin de terminer l'installation, vous devez choisir un répertoire dans lequel le SDK s'installera. Par défaut, le répertoire est « /usr/bin ». +Afin de terminer l'installation, vous devrez sélectionner un répertoire dans lequel le SDK va s'installer. Par défaut, le répertoire est « /usr/bin » -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -209,7 +212,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Lister les VM présentes dans un Managed Bare Metal +#### Lister les VM présentes dans un Managed Bare Metal Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : @@ -241,13 +244,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilisation des samples +#### Utilisation des samples -Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire « vmware-vsphere-cli-distrib/apps/vm/ ». +Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire `vmware-vsphere-cli-distrib/apps/vm/`. Voici la liste des scripts déjà disponibles dans ce répertoire : -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -255,10 +258,10 @@ Nous allons créer un snapshot « test » sur la VM « Debian1 » Pour cela, tapez la commande suivante : -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Aller plus loin -Échangez avec notre [communauté d'utilisateurs](/links/community). +Échangez avec notre [communauté d'utilisateurs](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-fr.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-fr.md index ba2d6c83f98..b551d11eef9 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-fr.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.fr-fr.md @@ -1,14 +1,24 @@ --- title: Utilisation SDK vSphere -excerpt: Utilisation et mise en place du SDK vSphere -updated: 2020-11-18 +excerpt: Découvrez comment implémenter et utiliser le SDK vSphere +updated: 2025-05-21 --- ## Objectif -Il est possible d'automatiser les actions au sein de votre infrastructure en utilisant le SDK vSphere. +Les actions au sein de votre infrastructure peuvent être automatisées grâce au SDK vSphere. -**Ce guide explique la mise en place et l'utilisation dans différents langages.** +**Ce guide explique la mise en œuvre et l'utilisation dans différents langages de programmation.** + +## Prérequis + +- Être connecté à votre [espace client OVHcloud](/links/manager). +- Une machine virtuelle créée avec l’un de nos [templates OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> Les exemples de code ci-dessous ont été créés en utilisant Python 2.7. Veuillez noter que vous devrez peut-être ajuster vos commandes en conséquence si votre environnement utilise Debian 12. Dans ce cas, nous vous recommandons de télécharger la dernière version de Python 3. +> ## En pratique @@ -16,41 +26,38 @@ Il est possible d'automatiser les actions au sein de votre infrastructure en uti #### Mise en place de l'environnement -##### OS - -Ici nous utilisons une VM installée sur Debian 9, déployée depuis [les templates mis à disposition sur votre Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +Cet exemple utilise une VM installée avec Debian 9, déployée à partir de [templates disponibles pour votre infrastructure Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Prérequis +Pour commencer, il est nécessaire d'installer ces packages : -Il est nécessaire d'installer les paquets suivants : - -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere avec la commande suivante : -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Le répertoire « /vsphere-automation-sdk-python » sera créé, rendez vous dans ce dossier pour effectuer la commande d'installation : -``` +Le répertoire `/vsphere-automation-sdk-python` sera créé. Basculez vers ce dossier pour exécuter la commande d'installation : + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -Dans cet exemple, il s'agira de la commande suivante : +Dans cet exemple, il s'agit de la commande suivante : -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -Le SDK est à présent installé, nous pouvons maintenant réaliser quelques scripts. +Une fois le SDK installé, vous pouvez utiliser des scripts. -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -83,7 +90,7 @@ print("Disconnecting..") vconnect() ``` -##### Lister les VM présentes dans un Managed Bare Metal +#### Lister les VM présentes dans un Managed Bare Metal Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : @@ -132,49 +139,45 @@ vconnect() #### Mise en place de l'environnement -##### OS - -Ici nous utilisons une VM installée sur Ubuntu 18.04, déployée depuis [les templates mis à disposition sur votre Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +Cet exemple utilise une VM installée avec Ubuntu 18.04, déployée à partir de [templates disponibles pour votre infrastructure Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Prérequis -Il est nécessaire d'installer les paquets suivants : +Pour commencer, il est nécessaire d'installer ces packages : -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere disponible sur ce lien : -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Téléchargez la version compatible avec votre système d'exploitation. -Dans cet exemple, nous téléchargerons "VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz" +Dans cet exemple, le fichier téléchargé est : « VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz » Décompressez le ficher que vous venez de télécharger en utilisant la commande : -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` -Et démarrez l'installeur en utilisant la commande suivante : +Lancez le programme d'installation à l'aide des commandes suivantes : -``` +```bash cd vmware-vsphere-cli-distrib ``` Puis : -``` +```bash ./vmware-install.pl ``` @@ -182,11 +185,11 @@ Après avoir lu les conditions, acceptez-les et continuez en cliquant sur `Entr A la suite de l'installation, d'autres modules vont être installés, cliquez sur `Entrée`{.action} pour continuer l'installation. -Afin de terminer l'installation, vous devez choisir un répertoire dans lequel le SDK s'installera. Par défaut, le répertoire est « /usr/bin ». +Afin de terminer l'installation, vous devrez sélectionner un répertoire dans lequel le SDK va s'installer. Par défaut, le répertoire est « /usr/bin » -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -209,7 +212,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Lister les VM présentes dans un Managed Bare Metal +#### Lister les VM présentes dans un Managed Bare Metal Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : @@ -241,13 +244,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilisation des samples +#### Utilisation des samples -Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire « vmware-vsphere-cli-distrib/apps/vm/ ». +Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire `vmware-vsphere-cli-distrib/apps/vm/`. Voici la liste des scripts déjà disponibles dans ce répertoire : -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -255,10 +258,10 @@ Nous allons créer un snapshot « test » sur la VM « Debian1 » Pour cela, tapez la commande suivante : -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Aller plus loin -Échangez avec notre [communauté d'utilisateurs](/links/community). +Échangez avec notre [communauté d'utilisateurs](/links/community). \ No newline at end of file diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.it-it.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.it-it.md index dc0370f1415..0a213133dce 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.it-it.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.it-it.md @@ -1,14 +1,24 @@ --- title: Utilizzare SDK vSphere excerpt: Come installare e utilizzare il Software Development Kit di vSphere -updated: 2020-11-18 +updated: 2025-05-21 --- ## Obiettivo Per automatizzare le azioni all’interno della propria infrastruttura è possibile utilizzare il Software Development Kit (SDK) offerto da vSphere. -**Questa guida ti mostra come installare e utilizzare questo strumento utilizzando diversi linguaggi.** +**Questa guida ti mostra come implementare e utilizzare i diversi linguaggi di programmazione.** + +## Prerequisiti + +- Avere accesso allo [Spazio Cliente OVHcloud](/links/manager). +- Una macchina virtuale creata con uno dei nostri [templates OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + + +> [!warning] +> Gli esempi di codice seguenti sono stati creati utilizzando Python 2.7. Se l'ambiente utilizzato utilizza Debian 12, potrebbe essere necessario modificare i comandi di conseguenza. In questo caso, ti consigliamo di scaricare l’ultima versione di Python 3. +> ## Procedura @@ -16,41 +26,40 @@ Per automatizzare le azioni all’interno della propria infrastruttura è possib #### Configura l’ambiente -##### OS - -In questa guida utilizzeremo una VM installata su Debian 9, creata a partire dai [template disponibili sul servizio Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +In questo esempio viene utilizzata una VM installata con Debian 9, implementata a partire da [templates disponibili per la tua infrastruttura Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Prerequisiti -Installa i seguenti pacchetti: +Per iniziare, è necessario installare questi pacchetti: -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere + +#### SDK vSphere Scarica SDK vSphere utilizzando il comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Viene creata la directory “/vsphere-automation-sdk-python”. Accedi a questa cartella per eseguire il comando di installazione: -``` +Viene creata la directory `/vsphere-automation-sdk-python`. Accedi a questa cartella per eseguire il comando di installazione: + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` Nel nostro esempio, sarà il comando: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` A questo punto SDK è installato ed è possibile utilizzarlo negli script. -#### Esempio di script +### Esempio di script -##### Connessione +#### Connessione Questo primo esempio mostra come testare login e logout al vCenter e verificare che tutto sia correttamente installato: @@ -83,7 +92,7 @@ print("Disconnecting..") vconnect() ``` -##### Visualizza la lista delle VM presenti nel Managed Bare Metal +#### Visualizza la lista delle VM presenti nel Managed Bare Metal In questo esempio, recupereremo la lista di tutte le macchine virtuali presenti sul Managed Bare Metal: @@ -132,29 +141,23 @@ vconnect() #### Configura l’ambiente -##### OS - In questo esempio utilizziamo una VM installata su Ubuntu 18.04, creata a partire dai [template disponibili sul servizio Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Prerequisiti - Installa i seguenti pacchetti: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### SDK vSphere +#### SDK vSphere Accedi alla pagina disponibile al link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Scarica la versione di SDK vSphere compatibile con il sistema operativo utilizzato. @@ -162,19 +165,19 @@ Nel nostro esempio, il file scaricato è "VMware-vSphere-Perl-SDK-6.7.0-8156551. Estrai l’archivio eseguendo il comando -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` e avvia l’installazione con il comando -``` +```bash cd vmware-vsphere-cli-distrib ``` A questo punto esegui: -``` +```bash ./vmware-install.pl ``` @@ -182,11 +185,11 @@ Leggi e accetta le condizioni contrattuali e clicca su `Enter`{.action} per cont Alla fine dell’operazione verranno installati ulteriori moduli. Clicca su `Enter`{.action} per continuare l’installazione. -Per completare la procedura, scegli la cartella su cui installare SDK (di default è la directory “ /usr/bin”). +Per completare la procedura, scegli la cartella su cui installare SDK (di default è la directory “/usr/bin”). -#### Esempio di script +### Esempio di script -##### Connessione +#### Connessione Questo primo esempio mostra come testare login e logout al vCenter e verificare che tutto sia correttamente installato: @@ -209,7 +212,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Visualizza la lista delle VM presenti nel Managed Bare Metal +#### Visualizza la lista delle VM presenti nel Managed Bare Metal In questo esempio, recupereremo la lista di tutte le macchine virtuali presenti sul Managed Bare Metal: @@ -241,22 +244,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilizza i samples +#### Utilizza i samples -In questo esempio utilizzeremo uno script già creato, contenuto nella cartella “vmware-vsphere-cli-distrib/apps/vm/”. +In questo esempio utilizzeremo uno script già creato, contenuto nella cartella `vmware-vsphere-cli-distrib/apps/vm/`. Ecco la lista degli script già disponibili in questa directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` + Creiamo lo Snapshot “test” della VM “Debian1” con il comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Per saperne di più -Contatta la nostra Community di utenti all’indirizzo . +Contatta la nostra [Community di utenti](/links/community). diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pl-pl.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pl-pl.md index 82f98168925..d63911c7646 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pl-pl.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pl-pl.md @@ -1,7 +1,7 @@ --- title: Korzystanie z SDK vSphere excerpt: Dowiedz się, jak uruchomić SDK vSphere i jak z niego korzystać -updated: 2020-11-18 +updated: 2025-05-21 --- ## Wprowadzenie @@ -10,47 +10,54 @@ Działania w infrastrukturze można zautomatyzować przy użyciu SDK vSphere. **Z tego przewodnika dowiesz się, jak go uruchomić i jak z niego korzystać w różnych językach.** -## W praktyce +## Wymagania początkowe -### Python +- Dostęp do [panelu klienta OVHcloud](/links/manager). +- Maszyna wirtualna utworzona w jednym z naszych [szablonów OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + +> [!warning] +> Poniższe przykłady kodu zostały utworzone przy użyciu Python 2.7. Pamiętaj, że może być konieczne odpowiednie dostosowanie Twoich zamówień, jeśli Twoje środowisko korzysta z Debiana 12. W takim przypadku zalecamy pobranie najnowszej wersji Pythona 3. +> -#### Uruchamianie środowiska +## W praktyce -##### System operacyjny +### Python -Tutaj korzystamy z maszyny wirtualnej zainstalowanej w systemie Debian 9 i wdrożonej z [szablonów udostępnionych w Twojej usłudze Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). +#### Wdrożenie środowiska -##### Wymagania początkowe +W tym przykładzie wykorzystano wirtualną maszynę zainstalowaną w systemie Debian 9 i wdrożoną z [szablonów dostępnych dla infrastruktury Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). Zainstalowanie następujących pakietów: -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere + +#### SDK vSphere Pobierz SDK vSphere za pomocą następującego polecenia: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Zostanie utworzony folder “/vsphere-automation-sdk-python”. Przejdź do tego folderu, aby wykonać polecenie instalacji: -``` +Zostanie utworzony folder `/vsphere-automation-sdk-python`. Przejdź do tego folderu, aby wykonać polecenie instalacji: + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` W tym przykładzie mówimy o następującym poleceniu: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Zestaw SDK został zainstalowany. Możemy teraz wykonać kilka skryptów. -#### Przykładowy skrypt +### Przykładowy skrypt -##### Logowanie +#### Logowanie W pierwszym przykładzie testujemy logowanie do vCenter i wylogowywanie się z niego. Dzięki temu upewnimy się też, czy wszystko zostało prawidłowo zainstalowane: @@ -83,7 +90,7 @@ print("Disconnecting..") vconnect() ``` -##### Wyświetlenie listy maszyn wirtualnych w usłudze Managed Bare Metal +#### Wyświetlenie listy maszyn wirtualnych w usłudze Managed Bare Metal W tym przykładzie wyświetlimy listę wszystkich maszyn wirtualnych obecnych w usłudze Managed Bare Metal: @@ -130,31 +137,25 @@ vconnect() ### Perl -#### Uruchamianie środowiska - -##### System operacyjny +#### Wdrożenie środowiska Tutaj korzystamy z maszyny wirtualnej zainstalowanej w systemie Ubuntu 18.04 i wdrożonej z [szablonów udostępnionych w Twojej usłudze Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -##### Wymagania początkowe - Zainstalowanie następujących pakietów: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### SDK vSphere +#### SDK vSphere Pobierz zestaw SDK vSphere dostępny pod tym linkiem: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Pobierz wersję kompatybilną z Twoim systemem operacyjnym. @@ -162,19 +163,19 @@ W tym przykładzie pobieramy “VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar Rozpakuj pobrany plik przy użyciu polecenia: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Uruchom instalator przy użyciu następującego polecenia: -``` +```bash cd vmware-vsphere-cli-distrib ``` Następnie: -``` +```bash ./vmware-install.pl ``` @@ -184,9 +185,9 @@ Następnie zostaną zainstalowane pozostałe moduły. Kliknij `Enter`{.action}, Aby zakończyć instalację, wybierz folder, w którym zostanie zainstalowany zestaw SDK. Domyślnie jest to folder “/usr/bin”. -#### Przykładowy skrypt +### Przykładowy skrypt -##### Logowanie +#### Logowanie W pierwszym przykładzie testujemy logowanie do vCenter i wylogowywanie się z niego. Dzięki temu upewnimy się też, czy wszystko zostało prawidłowo zainstalowane: @@ -209,7 +210,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Wyświetlenie listy maszyn wirtualnych w usłudze Managed Bare Metal +#### Wyświetlenie listy maszyn wirtualnych w usłudze Managed Bare Metal W tym przykładzie wyświetlimy listę wszystkich maszyn wirtualnych obecnych w usłudze Managed Bare Metal: @@ -241,13 +242,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Używanie próbek +#### Używanie próbek -W tym przykładzie użyjemy już utworzonego skryptu, znajdującego się w folderze “vmware-vsphere-cli-distrib/apps/vm/”. +W tym przykładzie użyjemy już utworzonego skryptu, znajdującego się w folderze `vmware-vsphere-cli-distrib/apps/vm/`. Oto lista skryptów dostępnych już w tym folderze: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -255,10 +256,10 @@ Utworzymy snapshot “test” na maszynie wirtualnej “Debian1” W tym celu wpisz następujące polecenie: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Sprawdź również -Dołącz do społeczności naszych użytkowników na stronie . +Dołącz do [grona naszych użytkowników](/links/community). diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pt-pt.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pt-pt.md index b82151937b2..a2a9b19b239 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pt-pt.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.pt-pt.md @@ -1,7 +1,7 @@ --- title: Utilização do SDK vSphere excerpt: Utilização e implementação do SDK vSphere -updated: 2020-11-18 +updated: 2025-05-21 --- ## Objetivo @@ -10,49 +10,55 @@ updated: 2020-11-18 **Este manual explica a implementação e a utilização em diferentes linguagens.** +## Requisitos + +- Ter acesso à [Área de Cliente OVHcloud](/links/manager). +- Uma máquina virtual criada com um dos nossos [templates OVF](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). + +> [!warning] +> Os exemplos de código abaixo foram criados utilizando Python 2.7. Tenha em conta que poderá ser necessário ajustar os seus comandos de forma correspondente se o seu ambiente estiver a utilizar Debian 12. Neste caso, recomendamos que transfira a última versão do Python 3. +> + ## Instruções ### Python #### Implementação do ambiente -##### OS +Este exemplo utiliza uma VM instalada com Debian 9, implementada a partir de [templates disponíveis para a sua infraestrutura Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). -Aqui, iremos utilizar uma VM instalada em Debian 9, implementada através dos [templates disponibilizados no seu Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). - -##### Requisitos É necessário instalar os seguintes packs: -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere +#### SDK vSphere Descarregue o SDK vSphere com o seguinte comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -O diretório “/vsphere-automation-sdk-python” será criado. Aceda a esta pasta para efetuar o seguinte comando de instalação: +Será criado o diretório `/vsphere-automation-sdk-python`. Mude para esta pasta para executar o comando de instalação: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` Neste exemplo, será o seguinte comando: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` O SDK já está instalado e é possível realizar alguns scripts. -#### Exemplo de script +### Exemplo de script -##### Ligação +#### Ligação Neste primeiro exemplo, testamos a ligação e a desconexão ao vCenter. Isto permitirá também ver se a instalação foi bem-sucedida: @@ -85,7 +91,7 @@ print("Disconnecting..") vconnect() ``` -##### Listar as VM presentes num Managed Bare Metal +#### Listar as VM presentes num Managed Bare Metal Neste exemplo, iremos listar todas as VM presentes no Managed Bare Metal: @@ -134,49 +140,43 @@ vconnect() #### Implementação do ambiente -##### OS - -Aqui, iremos utilizar uma VM instalada em Ubuntu 18.04, implementada através dos [templates disponibilizados no seu Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). - -##### Requisitos +Este exemplo utiliza uma VM instalada com Ubuntu 18.04, implementada a partir de [templates disponíveis para a sua infraestrutura Managed Bare Metal](/pages/bare_metal_cloud/managed_bare_metal/ovf_template). É necessário instalar os seguintes packs: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### SDK vSphere +#### SDK vSphere Descarregue o SDK vSphere disponível nesta ligação: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Descarregue a versão compatível com o seu sistema operativo. -Neste exemplo, iremos descarregar o "VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz". +Neste exemplo, o ficheiro descarregado é: « VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz » Descomprima o ficheiro que acabou de descarregar através do comando: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Inicie o instalador utilizando o seguinte comando: -``` +```bash cd vmware-vsphere-cli-distrib ``` A partir daí: -``` +```bash ./vmware-install.pl ``` @@ -186,9 +186,9 @@ Após a instalação, outros módulos serão instalados. Clique em `Enter`{.acti Para terminar a instalação, deve escolher um diretório no qual o SDK será instalado. Por predefinição, o diretório é “/usr/bin”. -#### Exemplo de script +### Exemplo de script -##### Ligação +#### Ligação Neste primeiro exemplo, testamos a ligação e a desconexão ao vCenter. Isto permitirá também ver se a instalação foi bem-sucedida: @@ -211,7 +211,7 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listar as VM presentes num Managed Bare Metal +#### Listar as VM presentes num Managed Bare Metal Neste exemplo, iremos listar todas as VM presentes no Managed Bare Metal: @@ -243,13 +243,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilização das amostras +#### Utilização das amostras Neste exemplo, iremos utilizar um script já criado e presente no diretório “vmware-vsphere-cli-distrib/apps/vm/”. Esta é a lista dos scripts disponíveis neste diretório: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -258,10 +258,10 @@ Iremos criar uma snapshot “test” na VM “Debian1”. Para o fazer, utilize o seguinte comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Quer saber mais? -Fale com a nossa comunidade de utilizadores em . +Fale com a nossa [comunidade de utilizadores](/links/community). diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md index d7f5edaa434..aad27a8acb7 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md @@ -1,7 +1,7 @@ --- title: vSphere SDK verwenden excerpt: Erfahren Sie hier, wie Sie das vSphere SDK einrichten und verwenden -updated: 2020-07-13 +updated: 2025-05-21 --- ## Ziel @@ -10,6 +10,16 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w **Diese Anleitung erklärt, wie Sie das vSphere SDK in verschiedenen Programmiersprachen einrichten und verwenden.** +## Voraussetzungen + +- Sie sind in Ihrem [OVHcloud Kundencenter](/links/manager) angemeldet. +- Eine virtuelle Maschine, die mit einem unserer [OVF Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) erstellt wurde . +- Eine Infrastruktur [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Die folgenden Codebeispiele wurden mit Python 2.7 erstellt. Bitte beachten Sie, dass Sie Ihre Bestellungen möglicherweise anpassen müssen, wenn Ihre Umgebung Debian 12 verwendet. In diesem Fall empfehlen wir Ihnen, die neueste Version von Python 3 herunterzuladen. +> + ## In der praktischen Anwendung ### Python @@ -18,39 +28,39 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w ##### Betriebssystem -Dieses Beispiel verwendet eine auf Debian 9 installierte VM, die mithilfe der [für Ihre Private Cloud bereitgestellten Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) deployt wurde. - -##### Voraussetzungen +Dieses Beispiel verwendet eine mit Debian 9 installierte VM, die aus [für Ihre Private Cloud bereitgestellten Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) deployt wurde. Folgende Pakete müssen installiert werden: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK + +#### vSphere SDK Laden Sie das vSphere SDK mit folgendem Befehl herunter: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Das Verzeichnis „/vsphere-automation-sdk-python“ wird erstellt. Gehen Sie in diesen Ordner, um den Installationsbefehl auszuführen: -``` +Das Verzeichnis `/vsphere-automation-sdk-python` wird erstellt. Wechseln Sie zu diesem Ordner, um den Installationsbefehl auszuführen: + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -Im vorliegenden Beispiel handelt es sich um folgenden Befehl: +In diesem Beispiel ist dies der folgende Befehl: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Sobald das SDK installiert ist, können Sie Skripte verwenden. -#### Skriptbeispiel +### Beispielskript -##### Verbindung +#### Verbindung Dieses Beispiel testet Login und Logout von vCenter. Hierbei können Sie auch überprüfen, ob alles korrekt installiert ist: @@ -65,7 +75,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -83,9 +93,9 @@ print("Disconnecting..") vconnect() ``` -##### VMs einer Private Cloud auflisten +#### Auflisten der in Managed Bare Metal vorhandenen VMs -In diesem Beispiel werden alle VMs in der Private Cloud aufgelistet: +In diesem Beispiel werden alle VMs in der Managed Bare Metal aufgelistet: ```python #!/usr/bin/env python @@ -98,7 +108,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -132,45 +142,41 @@ vconnect() #### Umgebung einrichten -##### Betriebssystem - -Wir verwenden hier eine auf Ubuntu 18.04 installierte VM, die mithilfe der [für Ihre Private Cloud bereitgestellten Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) deployt wurde. - -##### Voraussetzungen +Dieses Beispiel verwendet eine mit Ubuntu 18.04 installierte VM, die aus [für Ihre Private Cloud bereitgestellten Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) deployt wurde. Folgende Pakete müssen installiert werden: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils ``` -##### vSphere SDK +#### vSphere SDK Laden Sie das vSphere SDK über folgenden Link herunter: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Stellen Sie sicher, dass es sich um die mit Ihrem Betriebssystem kompatible Version handelt. -In diesem Beispiel ist die heruntergeladene Datei: „VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz“ +In diesem Beispiel ist die heruntergeladene Datei: “VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz” Extrahieren Sie die soeben heruntergeladene Datei mit folgendem Befehl: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Starten Sie den Installer mit den folgenden Befehlen: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -178,11 +184,11 @@ Wenn Sie die Bedingungen gelesen haben, akzeptieren Sie diese und drücken Sie a Nach der Installation werden weitere Module installiert. Drücken Sie auf `Enter`{.action}, um die Installation fortzusetzen. -Um die Installation abzuschließen, muss ein Verzeichnis ausgewählt werden, in dem das SDK installiert wird. Standardmäßig ist dieses Verzeichnis „/usr/bin“. +Um die Installation abzuschließen, muss ein Verzeichnis ausgewählt werden, in dem das SDK installiert wird. Standardmäßig ist dieses Verzeichnis “/usr/bin”. -#### Skriptbeispiel +### Beispielskript -##### Verbindung +#### Verbindung Dieses Beispiel testet Login und Logout von vCenter. Hierbei können Sie auch überprüfen, ob alles korrekt installiert ist: @@ -205,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### VMs einer Private Cloud auflisten +#### Auflisten der in Managed Bare Metal vorhandenen VMs -Dieses Beispiel listet alle VMs einer Private Cloud Infrastruktur auf: +Dieses Beispiel listet alle VMs einer Managed Bare Metal Infrastruktur auf: ```perl #!/usr/bin/perl @@ -237,23 +243,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Samples verwenden +#### Samples verwenden -Im vorliegenden Beispiel wird ein bereits erstelltes Skript aus dem Verzeichnis „vmware-vsphere-cli-distrib/apps/vm/“ aufgerufen. +Im vorliegenden Beispiel wird ein bereits erstelltes Skript aus dem Verzeichnis `vmware-vsphere-cli-distrib/apps/vm/` aufgerufen. Hier ist die Liste der Skripte, die bereits in diesem Verzeichnis verfügbar sind: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` Um einen Snapshot "test" der VM "Debian1" zu erstellen, verwenden Sie diesen Befehl (vorher die Platzhalter mit Ihren Anmeldeinformationen ersetzen): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Weiterführende Informationen -Für den Austausch mit unserer User Community gehen Sie auf . +Für den Austausch mit unserer [User Community](/links/community). diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-asia.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-asia.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-asia.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-asia.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-au.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-au.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-au.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-au.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ca.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ca.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ca.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ca.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-gb.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-gb.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-gb.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-gb.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ie.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ie.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ie.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-ie.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-sg.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-sg.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-sg.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-sg.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-us.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-us.md index 8a677610ac4..3fdf606fcad 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-us.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.en-us.md @@ -1,7 +1,7 @@ --- title: Using the vSphere SDK excerpt: Find out how to implement and use the vSphere SDK -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objective @@ -12,47 +12,51 @@ Actions within your infrastructure can be automated using the vSphere SDK. ## Instructions +- Access to the [OVHcloud Control Panel](/links/manager). +- A virtual machine created with one of our [OVF templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- A [Hosted Private Cloud](/links/hosted-private-cloud/vmware) infrastructure. + +> [!warning] +> The code examples below were created using Pythin 2.7. Please note that you may need to adjust your commands accordingly if your environment uses Debian 12. In this case, we recommend that you download the latest version of Python 3. +> + ### Python #### Setting up the environment -##### OS - This example uses a VM installed with Debian 9, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements +To begin, it is necessary to install these packages: -It is necessary to install these packages: - -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK with the following command: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -The directory "/vsphere-automation-sdk-python" will be created. Switch to this folder to perform the installation command: +The directory `/vsphere-automation-sdk-python` will be created. Switch to this folder to perform the installation command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` In this example, it is the following command: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Once the SDK is installed, you can make use of scripts. -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -67,7 +71,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +89,9 @@ print("Disconnecting..") vconnect() ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```python #!/usr/bin/env python @@ -100,7 +104,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +138,23 @@ vconnect() #### Setting up the environment -##### OS - This example uses a VM installed with Ubuntu 18.04, deployed from [templates available for your Hosted Private Cloud infrastructure](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requirements - -It is necessary to install these packages: +To begin, it is necessary to install these packages: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Download the vSphere SDK using this link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Make sure to download the version that is compatible with your operating system. @@ -164,17 +162,17 @@ In this example the file downloaded is: "VMware-vSphere-Perl-SDK-6.7.0-8156551.x Extract the file you just downloaded using this command: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Start the installer using the following commands: -``` +```bash cd vmware-vsphere-cli-distrib ``` -``` +```bash ./vmware-install.pl ``` @@ -184,9 +182,9 @@ After the installation, additional modules will be installed. Hit `Enter`{.actio In order to complete the installation, you will need to select a directory in which the SDK will install. By default, the directory is "/usr/bin". -#### Script example +### Script example -##### Connection +#### Connection This example tests the connection and disconnection to vCenter. It will also help to verify if everything is properly installed. @@ -209,9 +207,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listing the VMs of a Private Cloud infrastructure +#### Listing the VMs of a Managed Bare Metal infrastructure -This example lists all VMs of a Private Cloud infrastructure. +This example lists all VMs of a Managed Bare Metal infrastructure. ```perl #!/usr/bin/perl @@ -241,23 +239,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Using samples +#### Using samples In this example, a script that is already created and present in the directory "vmware-vsphere-cli-distrib/apps/vm/" is called. Here is a list of the scripts already available in this directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` To create a snapshot "test" of the VM "Debian1", use this command (replacing the example placeholders with your credentials): -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Go further -Join our community of users on . +Join our [community of users](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-es.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-es.md index c71c654b33b..44360ee365e 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-es.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-es.md @@ -1,14 +1,24 @@ --- title: Usar el conjunto de librerías vSphere SDK -excerpt: Instrumentación y uso del conjunto de librerías vSphere SDK -updated: 2020-07-13 +excerpt: Cómo implementar y utilizar vSphere SDK +updated: 2025-05-21 --- ## Objetivo -Es posible automatizar las acciones en su infraestructura utilizando el conjunto de librerías vSphere SDK. +Las acciones en su infraestructura pueden automatizarse gracias al SDK vSphere. -**En esta guía, se explica la instrumentación y el uso en varios idiomas.** +**Esta guía explica la implementación y el uso en diferentes lenguajes de programación.** + +## Requisitos + +- Estar conectado a su [área de cliente de OVHcloud](/links/manager). +- Una máquina virtual creada con uno de nuestros [templates OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Una infraestructura [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Los ejemplos de código siguientes se crearon utilizando Python 2.7. Tenga en cuenta que, si su entorno utiliza Debian 12, es posible que tenga que ajustar sus pedidos en consecuencia. En ese caso, le recomendamos que descargue la última versión de Python 3. +> ## Procedimiento @@ -16,45 +26,41 @@ Es posible automatizar las acciones en su infraestructura utilizando el conjunto #### Instrumentación del entorno -##### S. O. - En esta guía, utilizaremos una máquina virtual instalada en Debian 9, instrumentada a partir de [las plantillas disponibles en su Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requisitos - Se deben instalar los siguientes paquetes: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK con el siguiente comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Se creará el directorio «/vsphere-automation-sdk-python». Acceda a la carpeta correspondiente para ejecutar el comando de instalación: +Se creará el directorio `/vsphere-automation-sdk-python`. Acceda a la carpeta correspondiente para ejecutar el comando de instalación: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` En este ejemplo, el comando es el siguiente: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -El kit de desarrollo de software (SDK) ya está instalado. Ahora podemos ejecutar algunas secuencias de comandos. +Una vez instalado el SDK, puede utilizar scripts. -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión -En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. +En este primer ejemplo, probamos la conexión y la desconexión al vCenter. También podrá comprobar si todo se ha instalado correctamente: ```python #!/usr/bin/env python @@ -67,7 +73,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +91,9 @@ print("Disconnecting..") vconnect() ``` -##### Ver un listado de las máquinas virtuales en un Private Cloud +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal -En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Private Cloud: +En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: ```python #!/usr/bin/env python @@ -100,7 +106,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +140,23 @@ vconnect() #### Instrumentación del entorno -##### S. O. - -En esta guía, utilizaremos una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +En este ejemplo se utiliza una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requisitos +En primer lugar, deberá instalar los siguientes paquetes: -Se deben instalar los siguientes paquetes: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK en este enlace: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Descargue la versión compatible con su sistema operativo. @@ -164,31 +164,31 @@ En este ejemplo, vamos a descargar «VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_6 Utilice el siguiente comando para descomprimir el archivo que acaba de descargar: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Utilice el siguiente comando para iniciar el instalador: -``` +```bash cd vmware-vsphere-cli-distrib ``` Y luego: -``` +```bash ./vmware-install.pl ``` -Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `«Aceptar»`{.action}. +Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `Enter`{.action}. -Al final de la instalación, se instalarán otros módulos. Haga clic en `«Aceptar»`{.action} para continuar con la instalación. +Al final de la instalación, se instalarán otros módulos. Haga clic en `Enter`{.action} para continuar con la instalación. Para completar la instalación, debe seleccionar un directorio en el que se instalará el kit de desarrollo de software (SDK). El directorio por defecto es «/usr/bin». -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. @@ -211,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Ver un listado de las máquinas virtuales en un Private Cloud +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal -En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Private Cloud: +En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: ```perl #!/usr/bin/perl @@ -243,24 +243,25 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Uso de muestras +#### Uso de muestras -En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio «vmware-vsphere-cli-distrib/apps/vm/». +En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio `vmware-vsphere-cli-distrib/apps/vm/`. Esta es la lista de secuencias de comandos disponibles en este directorio: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` + Vamos a crear la instantánea «test» en la máquina virtual «Debian 1» Para ello, escriba el siguiente comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Más información -Interactúe con nuestra comunidad de usuarios en . +Interactúe con nuestra [comunidad de usuarios](/links/community). diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-us.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-us.md index c71c654b33b..b104efa620e 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-us.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.es-us.md @@ -1,14 +1,24 @@ --- title: Usar el conjunto de librerías vSphere SDK -excerpt: Instrumentación y uso del conjunto de librerías vSphere SDK -updated: 2020-07-13 +excerpt: Cómo implementar y utilizar vSphere SDK +updated: 2025-05-21 --- ## Objetivo -Es posible automatizar las acciones en su infraestructura utilizando el conjunto de librerías vSphere SDK. +Las acciones en su infraestructura pueden automatizarse gracias al SDK vSphere. -**En esta guía, se explica la instrumentación y el uso en varios idiomas.** +**Esta guía explica la implementación y el uso en diferentes lenguajes de programación.** + +## Requisitos + +- Estar conectado a su [área de cliente de OVHcloud](/links/manager). +- Una máquina virtual creada con uno de nuestros [templates OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Una infraestructura [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Los ejemplos de código siguientes se crearon utilizando Python 2.7. Tenga en cuenta que, si su entorno utiliza Debian 12, es posible que tenga que ajustar sus pedidos en consecuencia. En ese caso, le recomendamos que descargue la última versión de Python 3. +> ## Procedimiento @@ -16,45 +26,41 @@ Es posible automatizar las acciones en su infraestructura utilizando el conjunto #### Instrumentación del entorno -##### S. O. - En esta guía, utilizaremos una máquina virtual instalada en Debian 9, instrumentada a partir de [las plantillas disponibles en su Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requisitos - Se deben instalar los siguientes paquetes: -``` +```bash apt-get install python git python-pip ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK con el siguiente comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Se creará el directorio «/vsphere-automation-sdk-python». Acceda a la carpeta correspondiente para ejecutar el comando de instalación: +Se creará el directorio `/vsphere-automation-sdk-python`. Acceda a la carpeta correspondiente para ejecutar el comando de instalación: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` En este ejemplo, el comando es el siguiente: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -El kit de desarrollo de software (SDK) ya está instalado. Ahora podemos ejecutar algunas secuencias de comandos. +Una vez instalado el SDK, puede utilizar scripts. -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión -En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. +En este primer ejemplo, probamos la conexión y la desconexión al vCenter. También podrá comprobar si todo se ha instalado correctamente: ```python #!/usr/bin/env python @@ -67,7 +73,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +91,9 @@ print("Disconnecting..") vconnect() ``` -##### Ver un listado de las máquinas virtuales en un Private Cloud +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal -En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Private Cloud: +En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: ```python #!/usr/bin/env python @@ -100,7 +106,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,29 +140,23 @@ vconnect() #### Instrumentación del entorno -##### S. O. - -En esta guía, utilizaremos una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +En este ejemplo se utiliza una máquina virtual instalada en Debian 18.04, instrumentada a partir de [las plantillas disponibles en su Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Requisitos +En primer lugar, deberá instalar los siguientes paquetes: -Se deben instalar los siguientes paquetes: - -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### vSphere SDK +#### vSphere SDK Descargue el conjunto de librerías vSphere SDK en este enlace: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Descargue la versión compatible con su sistema operativo. @@ -164,31 +164,31 @@ En este ejemplo, vamos a descargar «VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_6 Utilice el siguiente comando para descomprimir el archivo que acaba de descargar: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Utilice el siguiente comando para iniciar el instalador: -``` +```bash cd vmware-vsphere-cli-distrib ``` Y luego: -``` +```bash ./vmware-install.pl ``` -Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `«Aceptar»`{.action}. +Una vez leídas las condiciones, acéptelas para continuar, haciendo clic en `Enter`{.action}. -Al final de la instalación, se instalarán otros módulos. Haga clic en `«Aceptar»`{.action} para continuar con la instalación. +Al final de la instalación, se instalarán otros módulos. Haga clic en `Enter`{.action} para continuar con la instalación. Para completar la instalación, debe seleccionar un directorio en el que se instalará el kit de desarrollo de software (SDK). El directorio por defecto es «/usr/bin». -#### Ejemplo de secuencia de comandos +### Ejemplo de script -##### Conexión +#### Conexión En este primer ejemplo, vamos a probar la conexión y desconexión a la utilidad vCenter. Esto también nos permitirá comprobar si todo se ha instalado correctamente. @@ -211,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Ver un listado de las máquinas virtuales en un Private Cloud +#### Ver un listado de las máquinas virtuales en un Managed Bare Metal -En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Private Cloud: +En este ejemplo, vamos a obtener un listado de todas las máquinas virtuales en el Managed Bare Metal: ```perl #!/usr/bin/perl @@ -243,24 +243,25 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Uso de muestras +#### Uso de muestras -En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio «vmware-vsphere-cli-distrib/apps/vm/». +En este ejemplo, vamos a utilizar una secuencia de comandos ya creada y que se encuentra en el directorio `vmware-vsphere-cli-distrib/apps/vm/`. Esta es la lista de secuencias de comandos disponibles en este directorio: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` + Vamos a crear la instantánea «test» en la máquina virtual «Debian 1» Para ello, escriba el siguiente comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Más información -Interactúe con nuestra comunidad de usuarios en . +Interactúe con nuestra [comunidad de usuarios](/links/community). \ No newline at end of file diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-ca.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-ca.md index faf67d4519e..034336dddde 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-ca.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-ca.md @@ -1,14 +1,24 @@ --- title: Utilisation SDK vSphere -excerpt: Utilisation et mise en place du SDK vSphere -updated: 2020-07-13 +excerpt: Découvrez comment implémenter et utiliser le SDK vSphere +updated: 2025-05-21 --- ## Objectif -Il est possible d'automatiser les actions au sein de votre infrastructure en utilisant le SDK vSphere. +Les actions au sein de votre infrastructure peuvent être automatisées grâce au SDK vSphere. -**Ce guide explique la mise en place et l'utilisation dans différents langages.** +**Ce guide explique la mise en œuvre et l'utilisation dans différents langages de programmation.** + +## Prérequis + +- Être connecté à votre [espace client OVHcloud](/links/manager). +- Une machine virtuelle créée avec l’un de nos [templates OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Une infrastructure [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Les exemples de code ci-dessous ont été créés en utilisant Python 2.7. Veuillez noter que vous devrez peut-être ajuster vos commandes en conséquence si votre environnement utilise Debian 12. Dans ce cas, nous vous recommandons de télécharger la dernière version de Python 3. +> ## En pratique @@ -16,41 +26,38 @@ Il est possible d'automatiser les actions au sein de votre infrastructure en uti #### Mise en place de l'environnement -##### OS - Ici nous utilisons une VM installée sur Debian 9, déployée depuis [les templates mis à disposition sur votre Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Prérequis - -Il est nécessaire d'installer les paquets suivants : +Pour commencer, il est nécessaire d'installer ces packages : -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere avec la commande suivante : -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Le répertoire « /vsphere-automation-sdk-python » sera créé, rendez vous dans ce dossier pour effectuer la commande d'installation : -``` +Le répertoire `/vsphere-automation-sdk-python` sera créé. Basculez vers ce dossier pour exécuter la commande d'installation : + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -Dans cet exemple, il s'agira de la commande suivante : +Dans cet exemple, il s'agit de la commande suivante : -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -Le SDK est à présent installé, nous pouvons maintenant réaliser quelques scripts. +Une fois le SDK installé, vous pouvez utiliser des scripts. -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -65,7 +72,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -83,9 +90,9 @@ print("Disconnecting..") vconnect() ``` -##### Lister les VM présentes dans un Private Cloud +#### Lister les VM présentes dans un Managed Bare Metal -Dans cet exemple, nous allons lister toutes les VM présentes sur le Private Cloud : +Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : ```python #!/usr/bin/env python @@ -98,7 +105,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -132,49 +139,44 @@ vconnect() #### Mise en place de l'environnement -##### OS - Ici nous utilisons une VM installée sur Ubuntu 18.04, déployée depuis [les templates mis à disposition sur votre Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Prérequis - -Il est nécessaire d'installer les paquets suivants : +Pour commencer, il est nécessaire d'installer ces packages : -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere disponible sur ce lien : -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Téléchargez la version compatible avec votre système d'exploitation. -Dans cet exemple, nous téléchargerons "VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz" +Dans cet exemple, le fichier téléchargé est : « VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz » Décompressez le ficher que vous venez de télécharger en utilisant la commande : -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` -Et démarrez l'installeur en utilisant la commande suivante : +Lancez le programme d'installation à l'aide des commandes suivantes : -``` +```bash cd vmware-vsphere-cli-distrib ``` Puis : -``` +```bash ./vmware-install.pl ``` @@ -182,11 +184,11 @@ Après avoir lu les conditions, acceptez-les et continuez en cliquant sur `Entr A la suite de l'installation, d'autres modules vont être installés, cliquez sur `Entrée`{.action} pour continuer l'installation. -Afin de terminer l'installation, vous devez choisir un répertoire dans lequel le SDK s'installera. Par défaut, le répertoire est « /usr/bin ». +Afin de terminer l'installation, vous devrez sélectionner un répertoire dans lequel le SDK va s'installer. Par défaut, le répertoire est « /usr/bin » -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -209,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Lister les VM présentes dans un Private Cloud +#### Lister les VM présentes dans un Managed Bare Metal -Dans cet exemple, nous allons lister toutes les VM présentes sur le Private Cloud : +Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : ```perl #!/usr/bin/perl @@ -241,13 +243,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilisation des samples +#### Utilisation des samples -Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire « vmware-vsphere-cli-distrib/apps/vm/ ». +Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire `vmware-vsphere-cli-distrib/apps/vm/`. Voici la liste des scripts déjà disponibles dans ce répertoire : -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -255,7 +257,7 @@ Nous allons créer un snapshot « test » sur la VM « Debian1 » Pour cela, tapez la commande suivante : -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-fr.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-fr.md index faf67d4519e..034336dddde 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-fr.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.fr-fr.md @@ -1,14 +1,24 @@ --- title: Utilisation SDK vSphere -excerpt: Utilisation et mise en place du SDK vSphere -updated: 2020-07-13 +excerpt: Découvrez comment implémenter et utiliser le SDK vSphere +updated: 2025-05-21 --- ## Objectif -Il est possible d'automatiser les actions au sein de votre infrastructure en utilisant le SDK vSphere. +Les actions au sein de votre infrastructure peuvent être automatisées grâce au SDK vSphere. -**Ce guide explique la mise en place et l'utilisation dans différents langages.** +**Ce guide explique la mise en œuvre et l'utilisation dans différents langages de programmation.** + +## Prérequis + +- Être connecté à votre [espace client OVHcloud](/links/manager). +- Une machine virtuelle créée avec l’un de nos [templates OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Une infrastructure [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Les exemples de code ci-dessous ont été créés en utilisant Python 2.7. Veuillez noter que vous devrez peut-être ajuster vos commandes en conséquence si votre environnement utilise Debian 12. Dans ce cas, nous vous recommandons de télécharger la dernière version de Python 3. +> ## En pratique @@ -16,41 +26,38 @@ Il est possible d'automatiser les actions au sein de votre infrastructure en uti #### Mise en place de l'environnement -##### OS - Ici nous utilisons une VM installée sur Debian 9, déployée depuis [les templates mis à disposition sur votre Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Prérequis - -Il est nécessaire d'installer les paquets suivants : +Pour commencer, il est nécessaire d'installer ces packages : -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere avec la commande suivante : -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Le répertoire « /vsphere-automation-sdk-python » sera créé, rendez vous dans ce dossier pour effectuer la commande d'installation : -``` +Le répertoire `/vsphere-automation-sdk-python` sera créé. Basculez vers ce dossier pour exécuter la commande d'installation : + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -Dans cet exemple, il s'agira de la commande suivante : +Dans cet exemple, il s'agit de la commande suivante : -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` -Le SDK est à présent installé, nous pouvons maintenant réaliser quelques scripts. +Une fois le SDK installé, vous pouvez utiliser des scripts. -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -65,7 +72,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -83,9 +90,9 @@ print("Disconnecting..") vconnect() ``` -##### Lister les VM présentes dans un Private Cloud +#### Lister les VM présentes dans un Managed Bare Metal -Dans cet exemple, nous allons lister toutes les VM présentes sur le Private Cloud : +Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : ```python #!/usr/bin/env python @@ -98,7 +105,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -132,49 +139,44 @@ vconnect() #### Mise en place de l'environnement -##### OS - Ici nous utilisons une VM installée sur Ubuntu 18.04, déployée depuis [les templates mis à disposition sur votre Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Prérequis - -Il est nécessaire d'installer les paquets suivants : +Pour commencer, il est nécessaire d'installer ces packages : -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils ``` -##### SDK vSphere +#### SDK vSphere Téléchargez le SDK vSphere disponible sur ce lien : -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Téléchargez la version compatible avec votre système d'exploitation. -Dans cet exemple, nous téléchargerons "VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz" +Dans cet exemple, le fichier téléchargé est : « VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz » Décompressez le ficher que vous venez de télécharger en utilisant la commande : -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` -Et démarrez l'installeur en utilisant la commande suivante : +Lancez le programme d'installation à l'aide des commandes suivantes : -``` +```bash cd vmware-vsphere-cli-distrib ``` Puis : -``` +```bash ./vmware-install.pl ``` @@ -182,11 +184,11 @@ Après avoir lu les conditions, acceptez-les et continuez en cliquant sur `Entr A la suite de l'installation, d'autres modules vont être installés, cliquez sur `Entrée`{.action} pour continuer l'installation. -Afin de terminer l'installation, vous devez choisir un répertoire dans lequel le SDK s'installera. Par défaut, le répertoire est « /usr/bin ». +Afin de terminer l'installation, vous devrez sélectionner un répertoire dans lequel le SDK va s'installer. Par défaut, le répertoire est « /usr/bin » -#### Exemple de script +### Exemple de script -##### Connexion +#### Connexion Dans ce premier exemple, nous testons la connexion et la déconnexion au vCenter. Cela permettra également de voir si tout s'est bien installé : @@ -209,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Lister les VM présentes dans un Private Cloud +#### Lister les VM présentes dans un Managed Bare Metal -Dans cet exemple, nous allons lister toutes les VM présentes sur le Private Cloud : +Dans cet exemple, nous allons lister toutes les VM présentes sur le Managed Bare Metal : ```perl #!/usr/bin/perl @@ -241,13 +243,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilisation des samples +#### Utilisation des samples -Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire « vmware-vsphere-cli-distrib/apps/vm/ ». +Dans cet exemple, nous allons utiliser un script déjà crée et présent dans le répertoire `vmware-vsphere-cli-distrib/apps/vm/`. Voici la liste des scripts déjà disponibles dans ce répertoire : -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -255,7 +257,7 @@ Nous allons créer un snapshot « test » sur la VM « Debian1 » Pour cela, tapez la commande suivante : -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.it-it.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.it-it.md index 6b1373be3a6..4bb4156c578 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.it-it.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.it-it.md @@ -1,14 +1,24 @@ --- title: Utilizzare SDK vSphere excerpt: Come installare e utilizzare il Software Development Kit di vSphere -updated: 2020-07-13 +updated: 2025-05-21 --- ## Obiettivo Per automatizzare le azioni all’interno della propria infrastruttura è possibile utilizzare il Software Development Kit (SDK) offerto da vSphere. -**Questa guida ti mostra come installare e utilizzare questo strumento utilizzando diversi linguaggi.** +**Questa guida ti mostra come implementare e utilizzare i diversi linguaggi di programmazione.** + +## Prerequisiti + +- Avere accesso allo [Spazio Cliente OVHcloud](/links/manager). +- una macchina virtuale creata con uno dei nostri [templates OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Un'infrastruttura [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Gli esempi di codice seguenti sono stati creati utilizzando Python 2.7. Se l'ambiente utilizzato utilizza Debian 12, potrebbe essere necessario modificare i comandi di conseguenza. In questo caso, ti consigliamo di scaricare l’ultima versione di Python 3. +> ## Procedura @@ -16,41 +26,39 @@ Per automatizzare le azioni all’interno della propria infrastruttura è possib #### Configura l’ambiente -##### OS +In questo esempio viene utilizzata una VM installata su Debian 9, creata a partire dai [template disponibili sul servizio Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -In questa guida utilizzeremo una VM installata su Debian 9, creata a partire dai [template disponibili sul servizio Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). - -##### Prerequisiti - -Installa i seguenti pacchetti: +Per iniziare, è necessario installare questi pacchetti: -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere + +#### SDK vSphere Scarica SDK vSphere utilizzando il comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Viene creata la directory “/vsphere-automation-sdk-python”. Accedi a questa cartella per eseguire il comando di installazione: -``` +Viene creata la directory `/vsphere-automation-sdk-python`. Accedi a questa cartella per eseguire il comando di installazione: + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` Nel nostro esempio, sarà il comando: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` A questo punto SDK è installato ed è possibile utilizzarlo negli script. -#### Esempio di script +### Esempio di script -##### Connessione +#### Connessione Questo primo esempio mostra come testare login e logout al vCenter e verificare che tutto sia correttamente installato: @@ -65,7 +73,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -83,9 +91,9 @@ print("Disconnecting..") vconnect() ``` -##### Visualizza la lista delle VM presenti nel Private Cloud +#### Visualizza la lista delle VM presenti nel Managed Bare Metal -In questo esempio, recupereremo la lista di tutte le macchine virtuali presenti sul Private Cloud: +In questo esempio, recupereremo la lista di tutte le macchine virtuali presenti sul Managed Bare Metal: ```python #!/usr/bin/env python @@ -98,7 +106,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -132,29 +140,23 @@ vconnect() #### Configura l’ambiente -##### OS - In questo esempio utilizziamo una VM installata su Ubuntu 18.04, creata a partire dai [template disponibili sul servizio Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Prerequisiti - Installa i seguenti pacchetti: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### SDK vSphere +#### SDK vSphere Accedi alla pagina disponibile al link: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Scarica la versione di SDK vSphere compatibile con il sistema operativo utilizzato. @@ -162,19 +164,19 @@ Nel nostro esempio, il file scaricato è "VMware-vSphere-Perl-SDK-6.7.0-8156551. Estrai l’archivio eseguendo il comando -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` e avvia l’installazione con il comando -``` +```bash cd vmware-vsphere-cli-distrib ``` A questo punto esegui: -``` +```bash ./vmware-install.pl ``` @@ -182,11 +184,11 @@ Leggi e accetta le condizioni contrattuali e clicca su `Enter`{.action} per cont Alla fine dell’operazione verranno installati ulteriori moduli. Clicca su `Enter`{.action} per continuare l’installazione. -Per completare la procedura, scegli la cartella su cui installare SDK (di default è la directory “ /usr/bin”). +Per completare la procedura, scegli la cartella su cui installare SDK (di default è la directory “/usr/bin”). -#### Esempio di script +### Esempio di script -##### Connessione +#### Connessione Questo primo esempio mostra come testare login e logout al vCenter e verificare che tutto sia correttamente installato: @@ -209,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Visualizza la lista delle VM presenti nel Private Cloud +#### Visualizza la lista delle VM presenti nel Managed Bare Metal -In questo esempio, recupereremo la lista di tutte le macchine virtuali presenti sul Private Cloud: +In questo esempio, recupereremo la lista di tutte le macchine virtuali presenti sul Managed Bare Metal: ```perl #!/usr/bin/perl @@ -241,22 +243,23 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilizza i samples +#### Utilizza i samples -In questo esempio utilizzeremo uno script già creato, contenuto nella cartella “vmware-vsphere-cli-distrib/apps/vm/”. +In questo esempio utilizzeremo uno script già creato, contenuto nella cartella `vmware-vsphere-cli-distrib/apps/vm/`. Ecco la lista degli script già disponibili in questa directory: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` + Creiamo lo Snapshot “test” della VM “Debian1” con il comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Per saperne di più -Contatta la nostra Community di utenti all’indirizzo . +Contatta la nostra [Community di utenti](/links/community). diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pl-pl.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pl-pl.md index bc7d5e3126e..e2b948412f8 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pl-pl.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pl-pl.md @@ -1,7 +1,7 @@ --- title: Korzystanie z SDK vSphere excerpt: Dowiedz się, jak uruchomić SDK vSphere i jak z niego korzystać -updated: 2020-07-13 +updated: 2025-05-21 --- ## Wprowadzenie @@ -10,47 +10,55 @@ Działania w infrastrukturze można zautomatyzować przy użyciu SDK vSphere. **Z tego przewodnika dowiesz się, jak go uruchomić i jak z niego korzystać w różnych językach.** +## Wymagania początkowe + +- Dostęp do [Panelu klienta OVHcloud](/links/manager). +- Maszyna wirtualna utworzona w jednym z naszych [szablonów OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Infrastruktura [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Poniższe przykłady kodu zostały utworzone przy użyciu Python 2.7. Pamiętaj, że może być konieczne odpowiednie dostosowanie Twoich zamówień, jeśli Twoje środowisko korzysta z Debiana 12. W takim przypadku zalecamy pobranie najnowszej wersji Pythona 3. +> + ## W praktyce ### Python -#### Uruchamianie środowiska - -##### System operacyjny +#### Wdrożenie środowiska Tutaj korzystamy z maszyny wirtualnej zainstalowanej w systemie Debian 9 i wdrożonej z [szablonów udostępnionych w Twojej usłudze Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Wymagania początkowe - Zainstalowanie następujących pakietów: -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere + +#### SDK vSphere Pobierz SDK vSphere za pomocą następującego polecenia: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -Zostanie utworzony folder „/vsphere-automation-sdk-python”. Przejdź do tego folderu, aby wykonać polecenie instalacji: -``` +Zostanie utworzony folder `/vsphere-automation-sdk-python`. Przejdź do tego folderu, aby wykonać polecenie instalacji: + +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` W tym przykładzie mówimy o następującym poleceniu: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` Zestaw SDK został zainstalowany. Możemy teraz wykonać kilka skryptów. -#### Przykładowy skrypt +### Przykładowy skrypt -##### Logowanie +#### Logowanie W pierwszym przykładzie testujemy logowanie do vCenter i wylogowywanie się z niego. Dzięki temu upewnimy się też, czy wszystko zostało prawidłowo zainstalowane: @@ -65,7 +73,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -83,9 +91,9 @@ print("Disconnecting..") vconnect() ``` -##### Wyświetlenie listy maszyn wirtualnych w usłudze Private Cloud +#### Wyświetlenie listy maszyn wirtualnych w usłudze Managed Bare Metal -W tym przykładzie wyświetlimy listę wszystkich maszyn wirtualnych obecnych w usłudze Private Cloud: +W tym przykładzie wyświetlimy listę wszystkich maszyn wirtualnych obecnych w usłudze Managed Bare Metal: ```python #!/usr/bin/env python @@ -98,7 +106,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -130,51 +138,45 @@ vconnect() ### Perl -#### Uruchamianie środowiska - -##### System operacyjny +#### Wdrożenie środowiska Tutaj korzystamy z maszyny wirtualnej zainstalowanej w systemie Ubuntu 18.04 i wdrożonej z [szablonów udostępnionych w Twojej usłudze Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -##### Wymagania początkowe - Zainstalowanie następujących pakietów: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### SDK vSphere +#### SDK vSphere Pobierz zestaw SDK vSphere dostępny pod tym linkiem: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Pobierz wersję kompatybilną z Twoim systemem operacyjnym. -W tym przykładzie pobieramy „VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz” +W tym przykładzie pobieramy “VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz” Rozpakuj pobrany plik przy użyciu polecenia: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Uruchom instalator przy użyciu następującego polecenia: -``` +```bash cd vmware-vsphere-cli-distrib ``` Następnie: -``` +```bash ./vmware-install.pl ``` @@ -182,11 +184,11 @@ Po przeczytaniu warunków zaakceptuj je i kliknij `Enter`{.action}, aby kontynuo Następnie zostaną zainstalowane pozostałe moduły. Kliknij `Enter`{.action}, aby kontynuować instalację. -Aby zakończyć instalację, wybierz folder, w którym zostanie zainstalowany zestaw SDK. Domyślnie jest to folder „/usr/bin”. +Aby zakończyć instalację, wybierz folder, w którym zostanie zainstalowany zestaw SDK. Domyślnie jest to folder “/usr/bin”. -#### Przykładowy skrypt +### Przykładowy skrypt -##### Logowanie +#### Logowanie W pierwszym przykładzie testujemy logowanie do vCenter i wylogowywanie się z niego. Dzięki temu upewnimy się też, czy wszystko zostało prawidłowo zainstalowane: @@ -209,9 +211,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Wyświetlenie listy maszyn wirtualnych w usłudze Private Cloud +#### Wyświetlenie listy maszyn wirtualnych w usłudze Managed Bare Metal -W tym przykładzie wyświetlimy listę wszystkich maszyn wirtualnych obecnych w usłudze Private Cloud: +W tym przykładzie wyświetlimy listę wszystkich maszyn wirtualnych obecnych w usłudze Managed Bare Metal: ```perl #!/usr/bin/perl @@ -241,24 +243,24 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Używanie próbek +#### Używanie próbek -W tym przykładzie użyjemy już utworzonego skryptu, znajdującego się w folderze „vmware-vsphere-cli-distrib/apps/vm/”. +W tym przykładzie użyjemy już utworzonego skryptu, znajdującego się w folderze `vmware-vsphere-cli-distrib/apps/vm/`. Oto lista skryptów dostępnych już w tym folderze: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` -Utworzymy snapshot „test” na maszynie wirtualnej „Debian1” +Utworzymy snapshot “test” na maszynie wirtualnej “Debian1” W tym celu wpisz następujące polecenie: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Sprawdź również -Dołącz do społeczności naszych użytkowników na stronie . +Dołącz do [grona naszych użytkowników](/links/community). diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pt-pt.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pt-pt.md index 6544a25220c..469bbd10fc2 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pt-pt.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.pt-pt.md @@ -1,7 +1,7 @@ --- title: Utilização do SDK vSphere excerpt: Utilização e implementação do SDK vSphere -updated: 2020-07-13 +updated: 2025-05-21 --- ## Objetivo @@ -10,49 +10,56 @@ updated: 2020-07-13 **Este manual explica a implementação e a utilização em diferentes linguagens.** +## Requisitos + +- Ter acesso à [Área de Cliente OVHcloud](/links/manager). +- Uma máquina virtual criada com um dos nossos [templates OVF](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). +- Uma infraestrutura [Hosted Private Cloud](/links/hosted-private-cloud/vmware). + +> [!warning] +> Os exemplos de código abaixo foram criados utilizando Python 2.7. Tenha em conta que poderá ser necessário ajustar os seus comandos de forma correspondente se o seu ambiente estiver a utilizar Debian 12. Neste caso, recomendamos que transfira a última versão do Python 3. +> + ## Instruções ### Python #### Implementação do ambiente -##### OS +Este exemplo utiliza uma VM instalada com Debian 9, implementada a partir de [templates disponibilizados no seu Hosted Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). -Aqui, iremos utilizar uma VM instalada em Debian 9, implementada através dos [templates disponibilizados no seu Hosted Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). - -##### Requisitos É necessário instalar os seguintes packs: -``` +```bash apt-get install python git python-pip ``` -##### SDK vSphere +#### SDK vSphere Descarregue o SDK vSphere com o seguinte comando: -``` +```bash git clone https://github.com/vmware/vsphere-automation-sdk-python.git ``` -O diretório “/vsphere-automation-sdk-python” será criado. Aceda a esta pasta para efetuar o seguinte comando de instalação: +Será criado o diretório `/vsphere-automation-sdk-python`. Mude para esta pasta para executar o comando de instalação: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` Neste exemplo, será o seguinte comando: -``` +```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib ``` O SDK já está instalado e é possível realizar alguns scripts. -#### Exemplo de script +### Exemplo de script -##### Ligação +#### Ligação Neste primeiro exemplo, testamos a ligação e a desconexão ao vCenter. Isto permitirá também ver se a instalação foi bem-sucedida: @@ -67,7 +74,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -85,9 +92,9 @@ print("Disconnecting..") vconnect() ``` -##### Listar as VM presentes num Hosted Private Cloud +#### Listar as VM presentes num Managed Bare Metal -Neste exemplo, iremos listar todas as VM presentes no Hosted Private Cloud: +Neste exemplo, iremos listar todas as VM presentes no Managed Bare Metal: ```python #!/usr/bin/env python @@ -100,7 +107,7 @@ from pyVmomi import vim def vconnect(): - s = ssl.SSLContext(ssl.PROTOCOL_TLS) + s = ssl.SSLContext(ssl.PROTOCOL_TLSv1) s.verify_mode = ssl.CERT_NONE service_instance = connect.SmartConnect(host="pcc-149-202-xxx-xxx.ovh.com", @@ -134,49 +141,43 @@ vconnect() #### Implementação do ambiente -##### OS - -Aqui, iremos utilizar uma VM instalada em Ubuntu 18.04, implementada através dos [templates disponibilizados no seu Hosted Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). - -##### Requisitos +Este exemplo utiliza uma VM instalada com Ubuntu 18.04, implementada a partir de [templates disponibilizados no seu Hosted Private Cloud](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template). É necessário instalar os seguintes packs: -``` +```bash apt-get install lib32z1 lib32ncurses5 uuid uuid-dev libssl-dev perl-doc libxml-libxml-perl libcrypt-ssleay-perl libsoap-lite-perl libdata-compare-perl libmodule-build-perl libuuid-perl libsocket6-perl libnet-inet6glue-perl libarchive-zip-perl - ``` -``` +```bash cpan install Crypt::OpenSSL::RSA UUID::Random Exception::Class Crypt::X509 List::MoreUtils - ``` -##### SDK vSphere +#### SDK vSphere Descarregue o SDK vSphere disponível nesta ligação: -[https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67](https://my.vmware.com/group/vmware/get-download?downloadGroup=VS-PERL-SDK67) + Descarregue a versão compatível com o seu sistema operativo. -Neste exemplo, iremos descarregar o "VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz". +Neste exemplo, o ficheiro descarregado é: « VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz » Descomprima o ficheiro que acabou de descarregar através do comando: -``` +```bash tar –zxvf VMware-vSphere-Perl-SDK-6.7.0-8156551.x86_64.tar.gz ``` Inicie o instalador utilizando o seguinte comando: -``` +```bash cd vmware-vsphere-cli-distrib ``` A partir daí: -``` +```bash ./vmware-install.pl ``` @@ -186,9 +187,9 @@ Após a instalação, outros módulos serão instalados. Clique em `Enter`{.acti Para terminar a instalação, deve escolher um diretório no qual o SDK será instalado. Por predefinição, o diretório é “/usr/bin”. -#### Exemplo de script +### Exemplo de script -##### Ligação +#### Ligação Neste primeiro exemplo, testamos a ligação e a desconexão ao vCenter. Isto permitirá também ver se a instalação foi bem-sucedida: @@ -211,9 +212,9 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Listar as VM presentes num Hosted Private Cloud +#### Listar as VM presentes num Managed Bare Metal -Neste exemplo, iremos listar todas as VM presentes no Hosted Private Cloud: +Neste exemplo, iremos listar todas as VM presentes no Managed Bare Metal: ```perl #!/usr/bin/perl @@ -243,13 +244,13 @@ Util::disconnect(); print "Disconnected \n"; ``` -##### Utilização das amostras +#### Utilização das amostras Neste exemplo, iremos utilizar um script já criado e presente no diretório “vmware-vsphere-cli-distrib/apps/vm/”. Esta é a lista dos scripts disponíveis neste diretório: -``` +```bash ls vmware-vsphere-cli-distrib/apps/vm/ guestinfo.pl sharesmanager.pl snapshotmanager.pl vdiskcreate.pl vmclone.pl vmcontrol.pl vmcreate.pl vminfo.pl vmmigrate.pl vmreconfig.pl vmregister.pl vmsnapshot.pl vmtemplate.pl ``` @@ -258,10 +259,10 @@ Iremos criar uma snapshot “test” na VM “Debian1”. Para o fazer, utilize o seguinte comando: -``` +```bash perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien --password MyPassword --operation create --vmname Debian1 --snapshotname test ``` ## Quer saber mais? -Fale com a nossa comunidade de utilizadores em . +Fale com a nossa [comunidade de utilizadores](/links/community). From 7774de511ebf335e73752af905e8f5dcdd97fdd5 Mon Sep 17 00:00:00 2001 From: tcpdumpfbacke <63296875+tcpdumpfbacke@users.noreply.github.com> Date: Thu, 22 May 2025 09:55:59 +0200 Subject: [PATCH 2/3] DE proof --- .../using-vsphere-sdk/guide.de-de.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md index 87cf856995c..8dbb1578294 100644 --- a/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md +++ b/pages/bare_metal_cloud/managed_bare_metal/using-vsphere-sdk/guide.de-de.md @@ -12,12 +12,12 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w ## Voraussetzungen -- Sie sind in Ihrem [OVHcloud Kundencenter](/links/manager) angemeldet. +- Sie haben Zugriff auf Ihr [OVHcloud Kundencenter](/links/manager). - Eine virtuelle Maschine, die mit einem unserer [OVF-Templates](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) erstellt wurde. > [!warning] -> Die folgenden Codebeispiele wurden mit Python 2.7 erstellt. Bitte beachten Sie, dass Sie Ihre Bestellungen möglicherweise anpassen müssen, wenn Ihre Umgebung Debian 12 verwendet. In diesem Fall empfehlen wir Ihnen, die neueste Version von Python 3 herunterzuladen. +> Die folgenden Codebeispiele wurden mit Python 2.7 erstellt. Beachten Sie, dass Sie Ihren Code möglicherweise anpassen müssen, wenn Ihre Umgebung Debian 12 verwendet. In diesem Fall empfehlen wir Ihnen, die neueste Version von Python 3 herunterzuladen. > ## In der praktischen Anwendung @@ -26,7 +26,7 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w #### Umgebung einrichten -Dieses Beispiel verwendet eine mit Debian 9 installierte VM, die aus [Templates für Ihre Managed Bare Metal Infrastruktur verfügbar](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) bereitgestellt wird. +Dieses Beispiel verwendet eine mit Debian 9 installierte VM, die aus [Templates für Ihre Managed Bare Metal Infrastruktur](/pages/bare_metal_cloud/managed_bare_metal/ovf_template) bereitgestellt wird. Folgende Pakete müssen installiert werden: @@ -48,7 +48,7 @@ Das Verzeichnis `/vsphere-automation-sdk-python` wird erstellt. Wechseln Sie zu pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -In diesem Beispiel ist dies der folgende Befehl: +Im vorliegenden Beispiel handelt es sich um folgenden Befehl: ```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib @@ -260,4 +260,4 @@ perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien - ## Weiterführende Informationen -Für den Austausch mit unserer [User Community](/links/community). +Treten Sie unserer [User Community](/links/community) bei. From e977b2d994f1d7c193f4b12dd60cec804cebf5cf Mon Sep 17 00:00:00 2001 From: tcpdumpfbacke <63296875+tcpdumpfbacke@users.noreply.github.com> Date: Thu, 22 May 2025 10:20:20 +0200 Subject: [PATCH 3/3] DE proof --- .../vmware_installation_api/guide.de-de.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md index aad27a8acb7..a87a4089898 100644 --- a/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md +++ b/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/vmware_installation_api/guide.de-de.md @@ -12,12 +12,12 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w ## Voraussetzungen -- Sie sind in Ihrem [OVHcloud Kundencenter](/links/manager) angemeldet. -- Eine virtuelle Maschine, die mit einem unserer [OVF Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) erstellt wurde . -- Eine Infrastruktur [Hosted Private Cloud](/links/hosted-private-cloud/vmware). +- Sie haben Zugriff auf Ihr [OVHcloud Kundencenter](/links/manager). +- Eine virtuelle Maschine, die mit einem unserer [OVF Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) erstellt wurde. +- Sie haben eine [Hosted Private Cloud Infrastruktur](/links/hosted-private-cloud/vmware). > [!warning] -> Die folgenden Codebeispiele wurden mit Python 2.7 erstellt. Bitte beachten Sie, dass Sie Ihre Bestellungen möglicherweise anpassen müssen, wenn Ihre Umgebung Debian 12 verwendet. In diesem Fall empfehlen wir Ihnen, die neueste Version von Python 3 herunterzuladen. +> Die folgenden Codebeispiele wurden mit Python 2.7 erstellt. Beachten Sie, dass Sie Ihre Bestellungen möglicherweise anpassen müssen, wenn Ihre Umgebung Debian 12 verwendet. In diesem Fall empfehlen wir Ihnen, die neueste Version von Python 3 herunterzuladen. > ## In der praktischen Anwendung @@ -28,7 +28,7 @@ Aktionen in Ihrer Infrastruktur können mithilfe des vSphere SDK automatisiert w ##### Betriebssystem -Dieses Beispiel verwendet eine mit Debian 9 installierte VM, die aus [für Ihre Private Cloud bereitgestellten Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) deployt wurde. +Dieses Beispiel verwendet eine mit Debian 9 installierte VM, die aus [für Ihre Private Cloud bereitgestellten Templates](/pages/hosted_private_cloud/hosted_private_cloud_powered_by_vmware/ovf_template) bereitgestellt wurde. Folgende Pakete müssen installiert werden: @@ -50,7 +50,7 @@ Das Verzeichnis `/vsphere-automation-sdk-python` wird erstellt. Wechseln Sie zu pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:////lib ``` -In diesem Beispiel ist dies der folgende Befehl: +Im vorliegenden Beispiel handelt es sich um folgenden Befehl: ```bash pip install --upgrade --force-reinstall -r requirements.txt --extra-index-url file:///root/vsphere-automation-sdk-python/lib @@ -180,9 +180,9 @@ cd vmware-vsphere-cli-distrib ./vmware-install.pl ``` -Wenn Sie die Bedingungen gelesen haben, akzeptieren Sie diese und drücken Sie auf `Enter`{.action}. +Wenn Sie die Bedingungen gelesen haben, akzeptieren Sie diese und drücken Sie `Enter`{.action}. -Nach der Installation werden weitere Module installiert. Drücken Sie auf `Enter`{.action}, um die Installation fortzusetzen. +Nach der Installation werden weitere Module installiert. Drücken Sie `Enter`{.action}, um die Installation fortzusetzen. Um die Installation abzuschließen, muss ein Verzeichnis ausgewählt werden, in dem das SDK installiert wird. Standardmäßig ist dieses Verzeichnis “/usr/bin”. @@ -262,4 +262,4 @@ perl snapshotmanager.pl --server pcc-149-202-xxx-xxx.ovh.com --username damien - ## Weiterführende Informationen -Für den Austausch mit unserer [User Community](/links/community). +Treten Sie unserer [User Community](/links/community) bei.