Commandes PowerCLI : Différence entre versions
(Page créée avec « == Création VM == * Création à partir d'un template <syntaxhighlight> New-VM - Name VMName -Template TemplateName -ResourcePool PoolName -Datastore DatastoreName -Loca... ») |
|||
| Ligne 1 : | Ligne 1 : | ||
| − | == Création VM == | + | {{ Introduction | Cette page reprend un certains nombre de commande dont j'ai eu besoin }} |
| + | |||
| + | == Identification == | ||
| + | |||
| + | === Création d'un fichier avec identifiant === | ||
| + | |||
| + | <syntaxhighlight lang=powershell> | ||
| + | #Cela stocke les identifiants dans un fichier xml. Vous pouvez ouvrir le fichier xml, mais le mot de passe est haché | ||
| + | |||
| + | New-VICredentialStoreItem -Host ESXorvCenterHostname -User root -Password "Super$ecretPassword" -File C:\vsphere-credential.xml | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | === Utilisation d'un fichier d'identification === | ||
| + | <syntaxhighlight lang=powershell> | ||
| + | #Création de l'objet avec les informations de connexion | ||
| + | $credential = Get-VICredentialStoreItem -File $PathCredentialFile | ||
| + | |||
| + | #Conexion au serveur | ||
| + | $connexion = Connect-VIServer -Server $credential.Host -User $credential.User -Password $credential.Password -WarningAction SilentlyContinue | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | == VM == | ||
| + | |||
| + | === Création VM === | ||
* Création à partir d'un template | * Création à partir d'un template | ||
Version du 4 mars 2016 à 10:27
Cette page reprend un certains nombre de commande dont j'ai eu besoin
Sommaire
Identification
Création d'un fichier avec identifiant
#Cela stocke les identifiants dans un fichier xml. Vous pouvez ouvrir le fichier xml, mais le mot de passe est haché
New-VICredentialStoreItem -Host ESXorvCenterHostname -User root -Password "Super$ecretPassword" -File C:\vsphere-credential.xmlUtilisation d'un fichier d'identification
#Création de l'objet avec les informations de connexion
$credential = Get-VICredentialStoreItem -File $PathCredentialFile
#Conexion au serveur
$connexion = Connect-VIServer -Server $credential.Host -User $credential.User -Password $credential.Password -WarningAction SilentlyContinueVM
Création VM
- Création à partir d'un template
New-VM - Name VMName -Template TemplateName -ResourcePool PoolName -Datastore DatastoreName -Location location