Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] implement GetVolumeStats for smb client #208

Closed
andyzhangx opened this issue May 30, 2022 · 9 comments
Closed

[feature request] implement GetVolumeStats for smb client #208

andyzhangx opened this issue May 30, 2022 · 9 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@andyzhangx
Copy link
Member

Is your feature request related to a problem?/Why is this needed

Describe the solution you'd like in detail

We could find there is GetVolumeStats for volume client which is mainly for getting disk usage, it does not work for smb mount:

// GetVolumeStats - retrieves the volume stats for a given volume
func (VolumeAPI) GetVolumeStats(volumeID string) (int64, int64, error) {
// get the size and sizeRemaining for the volume
cmd := fmt.Sprintf("(Get-Volume -UniqueId \"%s\" | Select SizeRemaining,Size) | ConvertTo-Json", volumeID)
out, err := utils.RunPowershellCmd(cmd)
if err != nil {
return -1, -1, fmt.Errorf("error getting capacity and used size of volume. cmd: %s, output: %s, error: %v", cmd, string(out), err)
}
var getVolume map[string]int64
outString := string(out)
err = json.Unmarshal([]byte(outString), &getVolume)
if err != nil {
return -1, -1, fmt.Errorf("out %v outstring %v err %v", out, outString, err)
}
var volumeSizeRemaining int64
var volumeSize int64
volumeSize = getVolume["Size"]
volumeSizeRemaining = getVolume["SizeRemaining"]
volumeUsedSize := volumeSize - volumeSizeRemaining
return volumeSize, volumeUsedSize, nil
}

PS C:\Users\azureuser> Get-Volume

DriveLetter FriendlyName      FileSystemType DriveType HealthStatus OperationalStatus SizeRemaining      Size
----------- ------------      -------------- --------- ------------ ----------------- -------------      ----
                              NTFS           Fixed     Healthy      OK                     19.82 GB  19.87 GB
                              NTFS           Fixed     Healthy      OK                     19.84 GB  19.87 GB
                              NTFS           Fixed     Healthy      OK                     19.82 GB  19.87 GB
            System Reserved   NTFS           Fixed     Healthy      OK                    466.45 MB    500 MB
C           Windows           NTFS           Fixed     Healthy      OK                     108.4 GB 127.51 GB
D           Temporary Storage NTFS           Fixed     Healthy      OK                     24.02 GB     32 GB
E                             Unknown        CD-ROM    Healthy      Unknown                     0 B       0 B
                              NTFS           Fixed     Healthy      OK                     19.82 GB  19.87 GB

for smb mount, it's using New-SmbGlobalMapping, not sure how to get usage on Windows

PS C:\Users\azureuser> Get-SmbGlobalMapping -RemotePath \\xxx.file.core.windows.net\pvc-0ce04732-33d4-4e02-8df0-b3fd06bbde8d

Status Local Path Remote Path
------ ---------- -----------
OK                \\xxx.file.core.windows.net\pvc-0ce04732-33d4-4e02-8df0-b3fd06bbde8d

Describe alternatives you've considered

Additional context

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 28, 2022
@Kartik494
Copy link
Member

/remove-lifecycle stale
/assign

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 6, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 5, 2022
@Kartik494
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 5, 2022
alexander-ding added a commit to alexander-ding/csi-proxy that referenced this issue Dec 8, 2022
78c0fb7 Merge pull request kubernetes-csi#208 from jsafrane/skip-selinux
36e433e Skip SELinux tests in CI by default
348d4a9 Merge pull request kubernetes-csi#207 from RaunakShah/reviewers
1efc272 Merge pull request kubernetes-csi#206 from RaunakShah/update-prow
7d410d8 Changes to csi prow to run e2e tests in sidecars
cfa5a75 Merge pull request kubernetes-csi#203 from humblec/test-vendor
4edd1d8 Add RaunakShah to CSI reviewers group
7ccc959 release tools update to 1.19

git-subtree-dir: release-tools
git-subtree-split: 78c0fb714fa4448b29962a0f34fa18b7b7d97ae6
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 5, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 4, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2023
@mauriciopoppe
Copy link
Member

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

5 participants