zoukankan      html  css  js  c++  java
  • powercli

    安装powercli
    创建删除快照脚本
    Import-Module VMware.VimAutomation.Core
    Connect-VIServer -Server 'SSSSS' -User 'AAAA' -Password 'BBB'
    Get-VM | Select-Object Name,PowerState
    #Get-VM | Where {$_.PowerState -eq 'Poweredon'}
    Get-VM | Where {$_.Name -eq 'D-svr2016-00'} | Get-Snapshot | Remove-Snapshot -Confirm:$false
    Get-VM | Where {$_.Name -eq 'D-DEV-00'} | Get-Snapshot | Remove-Snapshot -Confirm:$false
    Get-VM | Where {$_.Name -eq 'T-centos7-00'} | Get-Snapshot | Remove-Snapshot -Confirm:$false
    Get-VM | Where {$_.Name -eq 'D-svr2016-00'} | New-Snapshot -Name snapdaily
    Get-VM | Where {$_.Name -eq 'D-DEV-00'} | New-Snapshot -Name snapdaily
    Get-VM | Where {$_.Name -eq 'T-centos7-00'} | New-Snapshot -Name snapdaily
    常用
    Connect-VIServer -Server A -User B -Password C
    Get-VM | Get-Snapshot
    Get-VM | Where-Object {$_.PowerState -eq 'PoweredOn'}
    get-vm |where {$_.PowerState -eq "PoweredOn"} |New-Snapshot -Name "20180906"
    get-vm | get-snapshot -name "20180906" | remove-snapshot
    Get-VM | where {$_.Name -eq 'T-centos7-00'}| New-Snapshot -Name '20200108'
    Get-VM | where {$_.Name -eq 'T-centos7-00'}| Get-Snapshot
    Get-VM | where {$_.Name -eq 'T-centos7-00'}| Get-Snapshot | Remove-Snapshot
    Get-VM | where {$_.Name -eq 'T-centos7-00'} | Get-Snapshot | Remove-Snapshot -Confirm:$false
    
  • 相关阅读:
    2017 《Java》预备作业计科1502宋奇蕊
    在 Kubernetes 上调度 GPU 资源
    ceph
    网络设备的 38 个知识点
    CF1066 ABCD
    单调队列优化动态规划
    对拍
    【关于此博客】
    使用Morphia框架操作mongodb
    通过mybatis读取数据库数据并提供rest接口访问
  • 原文地址:https://www.cnblogs.com/kylingx/p/12165938.html
Copyright © 2011-2022 走看看